-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add account icon types * chore: squash * feat: add utility function to parse account icon and add icon to account avatar * feat: add icon selection to the edit account page * feat: add ability to change account background color * feat: add algorand and voi icons to the account icon list * feat: add currency icons to the account icons * feat: update whats new modal * feat: add option to show scroll bars on scroll container * refactor: use thin scroll bars on chrome * feat: re-add color to account icons
- Loading branch information
1 parent
7ac79c5
commit 0174529
Showing
40 changed files
with
1,140 additions
and
123 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
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,10 @@ | ||
import type { PropsWithChildren } from 'react'; | ||
|
||
// types | ||
import type { IAccountWithExtendedProps } from '@extension/types'; | ||
|
||
interface IProps extends PropsWithChildren { | ||
account: IAccountWithExtendedProps; | ||
} | ||
|
||
export default IProps; |
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 @@ | ||
export type { default as IProps } from './IProps'; |
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
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
88 changes: 88 additions & 0 deletions
88
src/extension/components/NewAccountItem/NewAccountItem.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,88 @@ | ||
import { Avatar, Center, HStack, Icon, Text, VStack } from '@chakra-ui/react'; | ||
import React, { type FC } from 'react'; | ||
import { IoWalletOutline } from 'react-icons/io5'; | ||
|
||
// constants | ||
import { DEFAULT_GAP } from '@extension/constants'; | ||
|
||
// hooks | ||
import useDefaultTextColor from '@extension/hooks/useDefaultTextColor'; | ||
import usePrimaryColor from '@extension/hooks/usePrimaryColor'; | ||
import usePrimaryButtonTextColor from '@extension/hooks/usePrimaryButtonTextColor'; | ||
import useSubTextColor from '@extension/hooks/useSubTextColor'; | ||
|
||
// types | ||
import type { IProps } from './types'; | ||
|
||
// utils | ||
import ellipseAddress from '@extension/utils/ellipseAddress'; | ||
|
||
const NewAccountItem: FC<IProps> = ({ | ||
address, | ||
name, | ||
subTextColor, | ||
textColor, | ||
}) => { | ||
// hooks | ||
const defaultSubTextColor = useSubTextColor(); | ||
const defaultTextColor = useDefaultTextColor(); | ||
const primaryButtonTextColor = usePrimaryButtonTextColor(); | ||
const primaryColor = usePrimaryColor(); | ||
|
||
return ( | ||
<HStack m={0} p={0} spacing={DEFAULT_GAP / 3} w="full"> | ||
{/*avatar*/} | ||
<Center> | ||
<Avatar | ||
bg={primaryColor} | ||
icon={<Icon as={IoWalletOutline} color={primaryButtonTextColor} />} | ||
size="sm" | ||
/> | ||
</Center> | ||
|
||
{name ? ( | ||
<VStack | ||
alignItems="flex-start" | ||
flexGrow={1} | ||
justifyContent="space-evenly" | ||
spacing={0} | ||
> | ||
<Text | ||
color={textColor || defaultTextColor} | ||
fontSize="sm" | ||
maxW={195} | ||
noOfLines={1} | ||
textAlign="left" | ||
> | ||
{name} | ||
</Text> | ||
|
||
<Text | ||
color={subTextColor || defaultSubTextColor} | ||
fontSize="xs" | ||
textAlign="left" | ||
> | ||
{ellipseAddress(address, { | ||
end: 10, | ||
start: 10, | ||
})} | ||
</Text> | ||
</VStack> | ||
) : ( | ||
<Text | ||
color={textColor || defaultTextColor} | ||
flexGrow={1} | ||
fontSize="sm" | ||
textAlign="left" | ||
> | ||
{ellipseAddress(address, { | ||
end: 10, | ||
start: 10, | ||
})} | ||
</Text> | ||
)} | ||
</HStack> | ||
); | ||
}; | ||
|
||
export default NewAccountItem; |
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 @@ | ||
export { default } from './NewAccountItem'; |
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,8 @@ | ||
interface IProps { | ||
address: string; | ||
name?: string; | ||
subTextColor?: string; | ||
textColor?: string; | ||
} | ||
|
||
export default IProps; |
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 @@ | ||
export type { default as IProps } from './IProps'; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Icon, type IconProps } from '@chakra-ui/react'; | ||
import React, { type FC } from 'react'; | ||
|
||
const VoiIcon: FC<IconProps> = (props: IconProps) => ( | ||
<Icon viewBox="0 0 38.231651 34.998402" {...props}> | ||
<path | ||
d="m 19.1157,35.4984 c -2.6714,0 -5.1412,-1.4216 -6.4824,-3.7317 L 1.01431,11.7568 C -1.06415,8.17804 0.153903,3.59172 3.73356,1.5138 7.314,-0.56412 11.9007,0.653619 13.9792,4.23234 l 5.1365,8.84566 5.1366,-8.84566 c 2.0784,-3.578721 6.6652,-4.79646 10.2456,-2.71854 3.5805,2.07792 4.7977,6.66345 2.7193,10.243 l -11.619,20.0099 c -1.3412,2.3101 -3.8111,3.7317 -6.4825,3.7317 z" | ||
fill="currentColor" | ||
/> | ||
</Icon> | ||
); | ||
|
||
export default VoiIcon; |
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 @@ | ||
export { default } from './VoiIcon'; |
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
Oops, something went wrong.