-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: account circle numbers and delete unused code
- Loading branch information
1 parent
99fb117
commit a6588dc
Showing
8 changed files
with
37 additions
and
88 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { memo } from 'react'; | ||
|
||
import { AccountAvatar } from '@app/components/account/account-avatar'; | ||
|
||
interface AccountAvatarItemProps { | ||
publicKey: string; | ||
index: number; | ||
name: string; | ||
} | ||
export const AccountAvatarItem = memo(({ name, publicKey, index }: AccountAvatarItemProps) => { | ||
return <AccountAvatar index={index} name={name} publicKey={publicKey} />; | ||
}); |
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,12 +1,26 @@ | ||
import { memo } from 'react'; | ||
|
||
import { AccountAvatar } from '@app/components/account/account-avatar/account-avatar'; | ||
import { Box, CircleProps } from 'leather-styles/jsx'; | ||
|
||
interface AccountAvatarItemProps { | ||
import { DynamicColorCircle } from '@app/ui/components/dynamic-color-circle'; | ||
|
||
const getAccountNumber = (index: number) => { | ||
// Always return account number in the Account Circle | ||
return String(index + 1); | ||
}; | ||
|
||
interface AccountAvatarProps extends CircleProps { | ||
name: string; | ||
publicKey: string; | ||
index: number; | ||
name: string; | ||
} | ||
export const AccountAvatarItem = memo(({ name, publicKey, index }: AccountAvatarItemProps) => { | ||
return <AccountAvatar index={index} name={name} publicKey={publicKey} />; | ||
export const AccountAvatar = memo(({ name, publicKey, index, ...props }: AccountAvatarProps) => { | ||
const gradient = publicKey + index.toString(); | ||
const text = getAccountNumber(index); | ||
|
||
return ( | ||
<DynamicColorCircle sizeParam="48" value={gradient} {...props}> | ||
<Box position="absolute">{text}</Box> | ||
</DynamicColorCircle> | ||
); | ||
}); |
42 changes: 0 additions & 42 deletions
42
src/app/components/account/account-avatar/account-avatar.tsx
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
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