ohif-viewer/platform/ui/src/components/InputText/InputText.jsx
Rodrigo Antinarelli edd4a4118c
feat: Modal + ViewportDownloadForm (#1799)
* feat: Modal + ViewportDownloadForm

* styles for image preview box

* modal update & close handler

* open modal for Learn More (search info)

* change modal default alignment

* Update platform/ui/src/components/InputNumber/InputNumber.mdx

* nuke inputNumber and use inputText with refactor

* make input more reusable

* revert inputText "number" stuff

* replace inputText to Input

* fix input spacing + label

* fix modal overlay classes

* fix inline styles

* fix onclick learn more

* fix close icon

* revert transition

* remove inline styles

* remove unecessary stuff
2020-06-26 16:34:43 +01:00

51 lines
1.0 KiB
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import { Input, InputLabelWrapper } from '@ohif/ui';
const InputText = ({
label,
isSortable,
sortDirection,
onLabelClick,
value,
onChange,
}) => {
return (
<InputLabelWrapper
label={label}
isSortable={isSortable}
sortDirection={sortDirection}
onLabelClick={onLabelClick}
>
<Input
className="border-primary-main mt-2 bg-black"
type="text"
containerClassName="mr-2"
value={value}
onChange={event => {
onChange(event.target.value);
}}
/>
</InputLabelWrapper>
);
};
InputText.defaultProps = {
value: '',
isSortable: false,
onLabelClick: () => {},
sortDirection: 'none',
};
InputText.propTypes = {
label: PropTypes.string.isRequired,
isSortable: PropTypes.bool,
sortDirection: PropTypes.oneOf(['ascending', 'descending', 'none']),
onLabelClick: PropTypes.func,
value: PropTypes.any,
onChange: PropTypes.func.isRequired,
};
export default InputText;