Clean and re-organize post table refactoring (#1000)
* Clean and re-organize post table refactoring * Fix tests
This commit is contained in:
37
front/src/modules/ui/input/text/components/TextInputEdit.tsx
Normal file
37
front/src/modules/ui/input/text/components/TextInputEdit.tsx
Normal file
@ -0,0 +1,37 @@
|
||||
import styled from '@emotion/styled';
|
||||
|
||||
import { textInputStyle } from '@/ui/theme/constants/effects';
|
||||
|
||||
import { TextInputContainer } from './TextInputContainer';
|
||||
|
||||
export const InplaceInputTextInput = styled.input`
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
${textInputStyle}
|
||||
`;
|
||||
|
||||
type OwnProps = {
|
||||
placeholder?: string;
|
||||
value?: string;
|
||||
onChange?: (newValue: string) => void;
|
||||
autoFocus?: boolean;
|
||||
};
|
||||
|
||||
export function TextInputEdit({
|
||||
placeholder,
|
||||
value,
|
||||
onChange,
|
||||
autoFocus,
|
||||
}: OwnProps) {
|
||||
return (
|
||||
<TextInputContainer>
|
||||
<InplaceInputTextInput
|
||||
autoComplete="off"
|
||||
autoFocus={autoFocus}
|
||||
placeholder={placeholder}
|
||||
value={value}
|
||||
onChange={(e) => onChange?.(e.target.value)}
|
||||
/>
|
||||
</TextInputContainer>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user