1- import styled , { css } from 'styled-components'
1+ import styled from 'styled-components'
22
33import { InnerCard } from '@/src/components/card/InnerCard'
44import { TokenAddress } from '@/src/components/token/TokenAddress'
@@ -12,8 +12,6 @@ import {
1212 TELEPATHY_VALIDATOR_ADDRESS ,
1313 TELEPATHY_VALIDATOR_ADDRESS_REPLACED ,
1414} from '@/src/constants/misc'
15- import { IconLink } from '@/src/components/assets/IconLink'
16- import { Tooltip } from '@/src/components/tooltip'
1715
1816const Wrapper = styled ( InnerCard ) `
1917 min-height: var(--validator-item-min-height);
@@ -70,77 +68,6 @@ const Address = styled(TokenAddress)`
7068 }
7169`
7270
73- const TextCSS = css `
74- color: ${ ( { theme : { colors } } ) => colors . primary } ;
75- font-size: 1.4rem;
76- font-weight: 400;
77- line-height: 1.5;
78- `
79-
80- const ExternalLink = styled . a `
81- ${ TextCSS }
82-
83- align-items: center;
84- column-gap: var(--theme-common-space);
85- display: flex;
86- text-decoration: none;
87-
88- &:active {
89- opacity: 0.8;
90- }
91- `
92-
93- const CommonCSS = css `
94- transition: color 0.15s ease-in-out;
95-
96- &:hover {
97- color: ${ ( { theme : { colors } } ) => colors . primaryDark } ;
98- }
99-
100- &:active {
101- opacity: 0.6;
102- }
103- `
104-
105- const Link = styled ( IconLink ) `
106- color: ${ ( { theme : { colors } } ) => colors . primary_50 } ;
107- cursor: pointer;
108-
109- ${ CommonCSS }
110-
111- svg {
112- color: ${ ( { theme : { colors } } ) => colors . primary_50 } ;
113-
114- &:hover {
115- color: ${ ( { theme : { colors } } ) => colors . primary } ;
116- }
117- }
118- `
119-
120- const ExternalLinkWrapper = styled . span `
121- display: flex;
122- align-items: center;
123- column-gap: var(--theme-common-space);
124- `
125-
126- const HashiTooltip = styled ( Tooltip ) `
127- flex-grow: 1;
128- margin-left: var(--theme-common-space);
129- `
130-
131- const HashiTooltipWrapper = styled . div `
132- display: flex;
133- align-items: flex-start;
134- flex-grow: 1;
135- `
136-
137- const Column = styled . div `
138- display: flex;
139- flex-direction: column;
140- row-gap: var(--theme-common-space);
141- align-items: flex-end;
142- `
143-
14471interface Props {
14572 bridgeValidator : ValidatorType
14673}
@@ -161,20 +88,6 @@ export const Validator: React.FC<Props> = ({ bridgeValidator, ...restProps }) =>
16188 return HealthStatusTypes . success
16289 }
16390
164- // eslint-disable-next-line @typescript-eslint/no-explicit-any
165- const openLink = ( e : any , href : string ) => {
166- e . stopPropagation ( )
167- e . preventDefault ( )
168-
169- window . open ( href , '_blank' , 'noopener noreferrer' )
170- }
171-
172- const isHashi = bridgeValidator . shortName === 'H'
173-
174- // if (isHashi) {
175- // return null
176- // }
177-
17891 return (
17992 < Wrapper { ...restProps } >
18093 < ValidatorHeader
@@ -189,89 +102,28 @@ export const Validator: React.FC<Props> = ({ bridgeValidator, ...restProps }) =>
189102 </ Row >
190103 < Row >
191104 < Text > Signed (24hs)</ Text >
192- { isHashi && (
193- < HashiTooltipWrapper >
194- < HashiTooltip content = "A message is considered signed/approved by Hashi, when a threshold amount of oracles store the same message hash w.r.t the message id." />
195- </ HashiTooltipWrapper >
196- ) }
197105 < Value > { bridgeValidator . signed } </ Value >
198106 </ Row >
199- { isHashi ? (
200- < Row >
201- < Text > Executed (24hs)</ Text >
202- < HashiTooltipWrapper >
203- < HashiTooltip content = "Hashi only approves messages, the message is executed either by other bridge validators or by users." />
204- </ HashiTooltipWrapper >
205- < Value > N/A</ Value >
206- </ Row >
207- ) : (
208- < Row >
209- < Text > Executed (24hs)</ Text >
210- < Value > { bridgeValidator . executed } </ Value >
211- </ Row >
212- ) }
107+
108+ < Row >
109+ < Text > Executed (24hs)</ Text >
110+ < Value > { bridgeValidator . executed } </ Value >
111+ </ Row >
213112 </ Rows >
214113 < SubTitle > Balance</ SubTitle >
215114 < Row >
216- { isHashi ? (
217- < >
218- < Text > N/A</ Text >
219- < HashiTooltipWrapper >
220- < HashiTooltip content = "Hashi don’t need to execute a message, hence balance field is not applicable." />
221- </ HashiTooltipWrapper >
222- </ >
223- ) : (
224- < Balance balanceType = { balanceGnosis } />
225- ) }
115+ < Balance balanceType = { balanceGnosis } />
116+ </ Row >
117+
118+ < Row >
119+ < Text > Send tokens</ Text >
120+ < Address
121+ address = { validatorAddress }
122+ characters = { 6 }
123+ copy
124+ href = { getAddressScanUrl ( validatorAddress , bridgeValidator . scanUrl ?? 'gnosis' ) }
125+ />
226126 </ Row >
227- { isHashi ? (
228- < Row >
229- < Text > Find more info</ Text >
230- < Column className = "text-right" >
231- < ExternalLinkWrapper >
232- < ExternalLink href = "https://hashi-explorer.xyz/" rel = "noreferrer" target = "_blank" >
233- Hashi Explorer
234- </ ExternalLink >
235- < Link
236- className = "externalLink"
237- height = { 14 }
238- onClick = { ( e ) => openLink ( e , 'https://hashi-explorer.xyz/' ) }
239- width = { 14 }
240- />
241- </ ExternalLinkWrapper >
242- < ExternalLinkWrapper >
243- < ExternalLink
244- href = "https://docs.gnosischain.com/bridges/About%20Token%20Bridges/hashi-integration"
245- rel = "noreferrer"
246- target = "_blank"
247- >
248- Docs
249- </ ExternalLink >
250- < Link
251- className = "externalLink"
252- height = { 14 }
253- onClick = { ( e ) =>
254- openLink (
255- e ,
256- 'https://docs.gnosischain.com/bridges/About%20Token%20Bridges/hashi-integration' ,
257- )
258- }
259- width = { 14 }
260- />
261- </ ExternalLinkWrapper >
262- </ Column >
263- </ Row >
264- ) : (
265- < Row >
266- < Text > Send tokens</ Text >
267- < Address
268- address = { validatorAddress }
269- characters = { 6 }
270- copy
271- href = { getAddressScanUrl ( validatorAddress , bridgeValidator . scanUrl ?? 'gnosis' ) }
272- />
273- </ Row >
274- ) }
275127 </ Wrapper >
276128 )
277129}
0 commit comments