Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Conversation

@Agupane
Copy link
Contributor

@Agupane Agupane commented Jun 10, 2020

Description

  • Adds identicon component

Adds ethereum-blockies-base64
@Agupane Agupane requested a review from nicosampler June 10, 2020 22:42
@Agupane Agupane self-assigned this Jun 10, 2020

type Props = {
address: string;
diameter: number;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Diameter values should be handled through the theme, as we do for Text size for example.


const Identicon = (props: Props) => {
const { address, diameter } = props;
const style: StyleProps = getStyleFrom(diameter);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to define style: StyledProps, the type it's inferred.

useEffect(() => {
const image = generateBlockieIdenticon(address, diameter);

if (!identicon || !identicon.current) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can simplify the condition in this way: if(!identicon?.current)

Also, you could move this block to the first sentence, so if it is not identicon attached, the image shouldn't be created.

@Agupane
Copy link
Contributor Author

Agupane commented Jun 11, 2020

Hey @nicosampler I simplified the component, should be better now , let me know what do you think :)

@nicosampler
Copy link
Contributor

great, I think we should change this: https://github.com/gnosis/safe-react-components/pull/17/files/ca3b021928af9b8d8028f2f8153dcb38ffddf189..d9afd368f19d93d35dbb20a74c06ea6324ffd189#r438738235. We should try to avoid using numbers for sizes as much as possible.

@Agupane
Copy link
Contributor Author

Agupane commented Jun 11, 2020

great, I think we should change this: https://github.com/gnosis/safe-react-components/pull/17/files/ca3b021928af9b8d8028f2f8153dcb38ffddf189..d9afd368f19d93d35dbb20a74c06ea6324ffd189#r438738235. We should try to avoid using numbers for sizes as much as possible.

It's better now

@Agupane Agupane requested a review from nicosampler June 11, 2020 13:48
@Agupane
Copy link
Contributor Author

Agupane commented Jun 12, 2020

Should be ok now, please check this out @nicosampler

@Agupane Agupane merged commit b1120d1 into development Jun 12, 2020
@Agupane Agupane deleted the identicons branch June 12, 2020 15:15
@nicosampler nicosampler mentioned this pull request Jul 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants