-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(input): remove InputTextField component
- Loading branch information
1 parent
7a00427
commit cc4de7e
Showing
21 changed files
with
271 additions
and
261 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,16 @@ | ||
import { css } from 'leather-styles/css'; | ||
import { HStack, HstackProps } from 'leather-styles/jsx'; | ||
|
||
import { Flag, type FlagProps } from '@app/ui/components/flag/flag'; | ||
import { ErrorCircleIcon } from '@app/ui/icons/error-circle-icon'; | ||
|
||
export function ErrorLabel({ children, ...rest }: HstackProps) { | ||
export function ErrorLabel({ children, ...rest }: FlagProps) { | ||
return ( | ||
<HStack | ||
alignItems="flex-start" | ||
className={css({ | ||
'& svg': { | ||
mt: '2px', | ||
}, | ||
})} | ||
<Flag | ||
img={<ErrorCircleIcon variant="small" />} | ||
spacing="space.02" | ||
color="red.action-primary-default" | ||
gap="space.02" | ||
textAlign="left" | ||
textStyle="body.02" | ||
{...rest} | ||
> | ||
<ErrorCircleIcon /> | ||
{children} | ||
</HStack> | ||
</Flag> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...end/send-crypto-asset-form/components/recipient-accounts-drawer/select-account-button.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import type { ComponentProps } from 'react'; | ||
|
||
import { SendCryptoAssetSelectors } from '@tests/selectors/send.selectors'; | ||
import { styled } from 'leather-styles/jsx'; | ||
|
||
interface SelectAccountButtonProps extends ComponentProps<typeof styled.button> { | ||
onClick(): void; | ||
} | ||
export function SelectAccountButton({ onClick, ...props }: SelectAccountButtonProps) { | ||
function preventFocusOfUnderlyingInput(e: React.MouseEvent) { | ||
e.preventDefault(); | ||
} | ||
|
||
return ( | ||
<styled.button | ||
type="button" | ||
color="accent.text-primary" | ||
textStyle="label.03" | ||
_hover={{ color: 'accent.action-primary-hover' }} | ||
data-testid={SendCryptoAssetSelectors.RecipientChooseAccountButton} | ||
fontWeight={500} | ||
onMouseDown={e => preventFocusOfUnderlyingInput(e)} | ||
onClick={e => { | ||
// Improves UX of selecting a recipient from the window. As the button | ||
// to open the drawer is inside the input, we force focus the button, | ||
// such that the focus is taken away from the input in background | ||
(e.target as HTMLButtonElement).focus(); | ||
onClick?.(); | ||
}} | ||
zIndex={9} | ||
{...props} | ||
> | ||
Select account | ||
</styled.button> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.