-
Notifications
You must be signed in to change notification settings - Fork 485
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #1189
- Loading branch information
Showing
61 changed files
with
679 additions
and
132 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,16 @@ | ||
import type { IdenticonType } from 'types/views/address'; | ||
import { IDENTICON_TYPES } from 'types/views/address'; | ||
|
||
import { getEnvValue } from 'configs/app/utils'; | ||
|
||
const identiconType: IdenticonType = (() => { | ||
const value = getEnvValue(process.env.NEXT_PUBLIC_VIEWS_ADDRESS_IDENTICON_TYPE); | ||
|
||
return IDENTICON_TYPES.find((type) => value === type) || 'jazzicon'; | ||
})(); | ||
|
||
const config = Object.freeze({ | ||
identiconType: identiconType, | ||
}); | ||
|
||
export default config; |
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 +1,2 @@ | ||
export { default as block } from './block'; | ||
export { default as address } from './address'; |
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
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 { ArrayElement } from 'types/utils'; | ||
|
||
export const IDENTICON_TYPES = [ | ||
'github', | ||
'jazzicon', | ||
'gradient_avatar', | ||
'blockie', | ||
] as const; | ||
|
||
export type IdenticonType = ArrayElement<typeof IDENTICON_TYPES>; |
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
Binary file modified
BIN
-17.3 KB
(73%)
ui/address/__screenshots__/AddressTxs.pw.tsx_default_base-view-mobile-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-18.4 KB
(73%)
ui/address/__screenshots__/AddressTxs.pw.tsx_default_base-view-screen-xl-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+142 Bytes
(100%)
ui/address/__screenshots__/AddressTxs.pw.tsx_mobile_base-view-mobile-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Binary file modified
BIN
+8.99 KB
(180%)
...hots__/AddressQrCode.pw.tsx_dark-color-mode_default-view-mobile-dark-mode-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+10.9 KB
(220%)
..._screenshots__/AddressQrCode.pw.tsx_default_default-view-mobile-dark-mode-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+8.99 KB
(380%)
...__screenshots__/AddressQrCode.pw.tsx_mobile_default-view-mobile-dark-mode-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Binary file modified
BIN
-128 Bytes
(100%)
ui/home/__screenshots__/LatestTxs.pw.tsx_default_mobile-default-view-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-127 Bytes
(100%)
ui/pages/__screenshots__/Home.pw.tsx_default_mobile-base-view-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,43 @@ | ||
import { useColorModeValue, useToken, Box, chakra, Skeleton } from '@chakra-ui/react'; | ||
import dynamic from 'next/dynamic'; | ||
import React from 'react'; | ||
|
||
const Identicon = dynamic<{ bg: string; string: string; size: number }>( | ||
async() => { | ||
const lib = await import('react-identicons'); | ||
return typeof lib === 'object' && 'default' in lib ? lib.default : lib; | ||
}, | ||
{ | ||
loading: () => <Skeleton w="100%" h="100%"/>, | ||
ssr: false, | ||
}, | ||
); | ||
|
||
interface Props { | ||
className?: string; | ||
size: number; | ||
seed: string; | ||
} | ||
|
||
const IdenticonGithub = ({ size, seed }: Props) => { | ||
const bgColor = useToken('colors', useColorModeValue('gray.100', 'white')); | ||
|
||
return ( | ||
<Box | ||
boxSize={ `${ size * 2 }px` } | ||
transformOrigin="left top" | ||
transform="scale(0.5)" | ||
borderRadius="full" | ||
overflow="hidden" | ||
> | ||
<Identicon | ||
bg={ bgColor } | ||
string={ seed } | ||
// the displayed size is doubled for retina displays and then scaled down | ||
size={ size * 2 } | ||
/> | ||
</Box> | ||
); | ||
}; | ||
|
||
export default React.memo(chakra(IdenticonGithub)); |
Oops, something went wrong.