-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* wip: refactor account select * refactor: update component names * Revert "refactor: update component names" This reverts commit c80ca13. * fix: rename components without breaking feature * disable all data refetching * wip: render xcm form when no wallet connected * remove redundant legacy component * workaround for account selection issue * Tidying up * handle TODO relating to SelectObject * remove comment * casing * selected styling * improvements * Add comment
- Loading branch information
Showing
11 changed files
with
105 additions
and
402 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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import Identicon from '@polkadot/react-identicon'; | ||
|
||
import { FlexProps } from '@/component-library/Flex'; | ||
import { useSelectModalContext } from '@/component-library/Select/SelectModalContext'; | ||
|
||
import { StyledAccountItemAddress, StyledAccountItemName, StyledAccountItemWrapper } from './AccountSelect.style'; | ||
|
||
type Props = { | ||
address: string; | ||
name?: string; | ||
}; | ||
|
||
type InheritAttrs = Omit<FlexProps, keyof Props | 'children'>; | ||
|
||
type AccountItemProps = Props & InheritAttrs; | ||
|
||
const AccountItem = ({ address, name, ...props }: AccountItemProps): JSX.Element => { | ||
const isSelected = useSelectModalContext().selectedItem?.key === address; | ||
|
||
return ( | ||
<StyledAccountItemWrapper alignItems='center' gap='spacing2' flex='1' {...props}> | ||
<Identicon size={24} value={address} theme='polkadot' /> | ||
<StyledAccountItemWrapper direction='column'> | ||
{name && ( | ||
<StyledAccountItemName size='s' $isSelected={!!isSelected}> | ||
{name} | ||
</StyledAccountItemName> | ||
)} | ||
<StyledAccountItemAddress size='xs' color='tertiary'> | ||
{address} | ||
</StyledAccountItemAddress> | ||
</StyledAccountItemWrapper> | ||
</StyledAccountItemWrapper> | ||
); | ||
}; | ||
|
||
export { AccountItem }; | ||
export type { AccountItemProps }; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,69 +1,25 @@ | ||
import styled from 'styled-components'; | ||
|
||
import { ChevronDown } from '@/assets/icons'; | ||
import { Flex } from '@/component-library/Flex'; | ||
import { List } from '@/component-library/List'; | ||
import { Span } from '@/component-library/Text'; | ||
import { theme } from '@/component-library/theme'; | ||
|
||
type StyledClickableProps = { | ||
$isClickable: boolean; | ||
}; | ||
import { Flex, Span, theme } from '@/component-library'; | ||
|
||
type StyledListItemSelectedLabelProps = { | ||
$isSelected: boolean; | ||
}; | ||
|
||
const StyledAccount = styled.span` | ||
font-size: ${theme.text.s}; | ||
color: ${theme.colors.textPrimary}; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
`; | ||
|
||
const StyledAccountSelect = styled(Flex)<StyledClickableProps>` | ||
background-color: ${theme.tokenInput.endAdornment.bg}; | ||
border-radius: ${theme.rounded.md}; | ||
font-size: ${theme.text.xl2}; | ||
padding: ${theme.spacing.spacing3}; | ||
cursor: ${({ $isClickable }) => $isClickable && 'pointer'}; | ||
height: 3rem; | ||
width: auto; | ||
overflow: hidden; | ||
`; | ||
|
||
const StyledChevronDown = styled(ChevronDown)` | ||
margin-left: ${theme.spacing.spacing1}; | ||
`; | ||
|
||
const StyledAccountLabelAddress = styled(Span)` | ||
const StyledAccountItemAddress = styled(Span)` | ||
text-overflow: ellipsis; | ||
overflow: hidden; | ||
white-space: nowrap; | ||
`; | ||
|
||
const StyledAccountLabelName = styled(StyledAccountLabelAddress)<StyledListItemSelectedLabelProps>` | ||
const StyledAccountItemName = styled(StyledAccountItemAddress)<StyledListItemSelectedLabelProps>` | ||
color: ${({ $isSelected }) => | ||
$isSelected ? theme.tokenInput.list.item.selected.text : theme.tokenInput.list.item.default.text}; | ||
`; | ||
|
||
const StyledList = styled(List)` | ||
overflow: auto; | ||
padding: 0 ${theme.dialog.medium.body.paddingX} ${theme.dialog.medium.body.paddingY} | ||
${theme.dialog.medium.body.paddingX}; | ||
`; | ||
|
||
const StyledAccountLabelWrapper = styled(Flex)` | ||
const StyledAccountItemWrapper = styled(Flex)` | ||
flex-grow: 1; | ||
overflow: hidden; | ||
`; | ||
|
||
export { | ||
StyledAccount, | ||
StyledAccountLabelAddress, | ||
StyledAccountLabelName, | ||
StyledAccountLabelWrapper, | ||
StyledAccountSelect, | ||
StyledChevronDown, | ||
StyledList | ||
}; | ||
export { StyledAccountItemAddress, StyledAccountItemName, StyledAccountItemWrapper }; |
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.
2fd08e0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
interbtc-ui-interlay-testnet – ./
interbtc-ui-interlay-testnet-interlay.vercel.app
interbtc-ui-interlay-testnet.vercel.app
interbtc-ui-interlay-testnet-git-master-interlay.vercel.app
testnet.interlay.io
2fd08e0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
interbtc-ui-kintsugi-testnet – ./
interbtc-ui.vercel.app
interbtc-ui-kintsugi-testnet-git-master-interlay.vercel.app
interbtc-ui-kintsugi-testnet-interlay.vercel.app
kintnet.interlay.io