Files
twenty/front/src/modules/ui/inplace-input/components/InplaceInputDoubleText.tsx
Gustavo Félix 59eb10ccc4 fix(#753): add autoComplete attribute for remove suggestion of passwo… (#913)
* fix(#753): add autoComplete attribute for remove suggestion of password managers

* fix(#753): add autoComplete attribute for remove suggestion of password managers

* Update front/src/modules/ui/inplace-input/components/InplaceInputDoubleText.tsx

* Update front/src/modules/ui/inplace-input/components/InplaceInputDoubleText.tsx

* Update front/src/modules/ui/inplace-input/components/InplaceInputDoubleText.tsx

* Update front/src/modules/ui/inplace-input/components/InplaceInputDoubleText.tsx

---------

Co-authored-by: Charles Bochet <charlesBochet@users.noreply.github.com>
2023-07-25 11:21:45 -07:00

53 lines
1.3 KiB
TypeScript

import { ChangeEvent } from 'react';
import styled from '@emotion/styled';
import { StyledInput } from '@/ui/inplace-input/components/InplaceInputTextEditMode';
type OwnProps = {
firstValue: string;
secondValue: string;
firstValuePlaceholder: string;
secondValuePlaceholder: string;
onChange: (firstValue: string, secondValue: string) => void;
};
const StyledContainer = styled.div`
align-items: center;
display: flex;
justify-content: space-between;
& > input:last-child {
border-left: 1px solid ${({ theme }) => theme.border.color.medium};
padding-left: ${({ theme }) => theme.spacing(2)};
}
`;
export function InplaceInputDoubleText({
firstValue,
secondValue,
firstValuePlaceholder,
secondValuePlaceholder,
onChange,
}: OwnProps) {
return (
<StyledContainer>
<StyledInput
autoFocus
placeholder={firstValuePlaceholder}
value={firstValue}
onChange={(event: ChangeEvent<HTMLInputElement>) => {
onChange(event.target.value, secondValue);
}}
/>
<StyledInput
autoComplete="off"
placeholder={secondValuePlaceholder}
value={secondValue}
onChange={(event: ChangeEvent<HTMLInputElement>) => {
onChange(firstValue, event.target.value);
}}
/>
</StyledContainer>
);
}