Commit fb5726b7 authored by Max Alekseenko's avatar Max Alekseenko

update input bg color and border radius

parent 29f3a72f
import { FormControl, Input, InputGroup, InputRightElement, chakra } from '@chakra-ui/react'; import { FormControl, Input, InputGroup, InputRightElement, chakra, useColorModeValue } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import CopyToClipboard from 'ui/shared/CopyToClipboard'; import CopyToClipboard from 'ui/shared/CopyToClipboard';
...@@ -10,16 +10,29 @@ type Props = { ...@@ -10,16 +10,29 @@ type Props = {
className?: string; className?: string;
}; };
const CopyField = ({ label, value, className }: Props) => ( const CopyField = ({ label, value, className }: Props) => {
<FormControl variant="floating" id={ label } className={ className }> const bgColor = ` ${ useColorModeValue('gray.200', 'blackAlpha.900') } !important`;
<InputGroup> return (
<Input readOnly fontWeight="500" value={ value } overflow="hidden" textOverflow="ellipsis" pr="40px !important"/> <FormControl variant="floating" id={ label } className={ className }>
<InputPlaceholder text={ label }/> <InputGroup>
<InputRightElement w="40px" display="flex" justifyContent="flex-end" pr={ 2 }> <Input
<CopyToClipboard text={ value }/> readOnly
</InputRightElement> fontWeight="500"
</InputGroup> value={ value }
</FormControl> overflow="hidden"
); textOverflow="ellipsis"
pr="40px !important"
bgColor={ bgColor }
borderColor={ bgColor }
borderRadius="12px !important"
/>
<InputPlaceholder text={ label } bgColor={ bgColor }/>
<InputRightElement w="40px" display="flex" justifyContent="flex-end" pr={ 2 }>
<CopyToClipboard text={ value }/>
</InputRightElement>
</InputGroup>
</FormControl>
);
};
export default chakra(CopyField); export default chakra(CopyField);
...@@ -34,7 +34,7 @@ const LoginStepContent = ({ goNext }: { goNext: () => void }) => { ...@@ -34,7 +34,7 @@ const LoginStepContent = ({ goNext }: { goNext: () => void }) => {
</Flex> </Flex>
{ isSwitchChecked && ( { isSwitchChecked && (
<FormControl variant="floating" id="referral-code" mt={ 3 }> <FormControl variant="floating" id="referral-code" mt={ 3 }>
<Input fontWeight="500"/> <Input fontWeight="500" borderRadius="12px !important"/>
<InputPlaceholder text="Code"/> <InputPlaceholder text="Code"/>
</FormControl> </FormControl>
) } ) }
......
...@@ -7,9 +7,10 @@ interface Props { ...@@ -7,9 +7,10 @@ interface Props {
icon?: React.ReactNode; icon?: React.ReactNode;
error?: Partial<FieldError>; error?: Partial<FieldError>;
isFancy?: boolean; isFancy?: boolean;
className?: string;
} }
const InputPlaceholder = ({ text, icon, error, isFancy }: Props) => { const InputPlaceholder = ({ text, icon, error, isFancy, className }: Props) => {
let errorMessage = error?.message; let errorMessage = error?.message;
if (!errorMessage && error?.type === 'pattern') { if (!errorMessage && error?.type === 'pattern') {
...@@ -22,6 +23,7 @@ const InputPlaceholder = ({ text, icon, error, isFancy }: Props) => { ...@@ -22,6 +23,7 @@ const InputPlaceholder = ({ text, icon, error, isFancy }: Props) => {
{ ...(isFancy ? { 'data-fancy': true } : {}) } { ...(isFancy ? { 'data-fancy': true } : {}) }
variant="floating" variant="floating"
bgColor="deeppink" bgColor="deeppink"
className={ className }
> >
{ icon } { icon }
<chakra.span>{ text }</chakra.span> <chakra.span>{ text }</chakra.span>
...@@ -30,4 +32,4 @@ const InputPlaceholder = ({ text, icon, error, isFancy }: Props) => { ...@@ -30,4 +32,4 @@ const InputPlaceholder = ({ text, icon, error, isFancy }: Props) => {
); );
}; };
export default React.memo(InputPlaceholder); export default React.memo(chakra(InputPlaceholder));
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment