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

EtherscanButton #45

Merged
merged 4 commits into from
Jul 24, 2020
Merged

EtherscanButton #45

merged 4 commits into from
Jul 24, 2020

Conversation

nicosampler
Copy link
Contributor

No description provided.

@nicosampler nicosampler requested review from mmv08 and dasanra July 23, 2020 20:33
@nicosampler nicosampler self-assigned this Jul 23, 2020
@github-actions
Copy link

github-actions bot commented Jul 23, 2020

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

@ghost
Copy link

ghost commented Jul 23, 2020

Travis automatic deployment:
https://pr45--safereactcomponents.review.gnosisdev.com

);

return (
<StyledButton className={className} onClick={goToEtherscan}>
Copy link
Member

Choose a reason for hiding this comment

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

why are we using a button for a link?

Copy link
Member

Choose a reason for hiding this comment

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

This was implemented the right way in safe-react... https://github.com/gnosis/safe-react/blob/development/src/components/EtherscanBtn/index.tsx

please pay more attention to semantics of html elements you're using

@mmv08
Copy link
Member

mmv08 commented Jul 23, 2020

also, these are components library, we shouldn't put any logic there

@nicosampler
Copy link
Contributor Author

also, these are components library, we shouldn't put any logic there

forming a URL could not be considered "putting logic".

@nicosampler
Copy link
Contributor Author

changes applied

@ghost
Copy link

ghost commented Jul 23, 2020

Travis automatic deployment:
https://pr45--safereactcomponents.review.gnosisdev.com

Copy link
Member

@mmv08 mmv08 left a comment

Choose a reason for hiding this comment

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

Also please check eslint warnings

@ghost
Copy link

ghost commented Jul 24, 2020

Travis automatic deployment:
https://pr45--safereactcomponents.review.gnosisdev.com

value,
network = 'mainnet',
}: Props): React.ReactElement => {
const getEtherscanLink = () =>
Copy link
Member

Choose a reason for hiding this comment

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

Why this couldn't be just

const etherscanLink = `https://${getNetwork(network)}etherscan.io/${type}/${value}`

I've seen multiple places where you define value as const getValue = () => value and then use the function in render method and always wanted to ask this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

right, it was used for the button, now that we are using a link, it's no needed.

@ghost
Copy link

ghost commented Jul 24, 2020

Travis automatic deployment:
https://pr45--safereactcomponents.review.gnosisdev.com

@mmv08 mmv08 merged commit 7f91bf1 into development Jul 24, 2020
@mmv08 mmv08 deleted the etherScan branch July 24, 2020 15:38
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.

3 participants