-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #506 from ethereum/dev
Release dev -> master
- Loading branch information
Showing
40 changed files
with
3,552 additions
and
550 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import React from 'react'; | ||
import { FormattedMessage } from 'react-intl'; | ||
import { Link } from './Link'; | ||
import { Alert } from './Alert'; | ||
import { Text } from './Text'; | ||
|
||
export const ClientMergeNotification = (props: { | ||
client: string; | ||
isConsensus?: boolean; | ||
}): JSX.Element => { | ||
const { client, isConsensus = false } = props; | ||
return ( | ||
<Alert variant="warning" className="my40"> | ||
<Text> | ||
<FormattedMessage | ||
defaultMessage="{client} is a {layerType}." | ||
values={{ | ||
client, | ||
layerType: ( | ||
<em> | ||
{isConsensus ? ( | ||
<FormattedMessage defaultMessage="consensus client" /> | ||
) : ( | ||
<FormattedMessage defaultMessage="execution client" /> | ||
)} | ||
</em> | ||
), | ||
}} | ||
/> | ||
</Text> | ||
<Text className="my10"> | ||
{isConsensus ? ( | ||
<FormattedMessage | ||
defaultMessage="Merge Readiness: In addition to a consensus client, after the Merge node operators must also run an {alternateClient} to remain active." | ||
values={{ | ||
alternateClient: ( | ||
<Link primary inline to="/checklist/#el-client"> | ||
<FormattedMessage defaultMessage="execution client" /> | ||
</Link> | ||
), | ||
}} | ||
/> | ||
) : ( | ||
<FormattedMessage | ||
defaultMessage="Merge Readiness: In addition to an execution client, after the Merge node operators must also run an {alternateClient} to remain active." | ||
values={{ | ||
alternateClient: ( | ||
<Link primary inline to="/checklist/#cl-client"> | ||
<FormattedMessage defaultMessage="consensus client" /> | ||
</Link> | ||
), | ||
}} | ||
/> | ||
)} | ||
</Text> | ||
<Link primary inline to="/merge-readiness"> | ||
<FormattedMessage defaultMessage="Merge readiness checklist" /> | ||
</Link> | ||
</Alert> | ||
); | ||
}; |
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,26 @@ | ||
import React from 'react'; | ||
import { FormattedMessage } from 'react-intl'; | ||
import styled from 'styled-components'; | ||
import { Link } from './Link'; | ||
import { Alert } from './Alert'; | ||
|
||
const StyledAlert = styled(Alert)` | ||
text-align: center; | ||
`; | ||
|
||
export const MergeNotification = (): JSX.Element => { | ||
return ( | ||
<StyledAlert variant="warning" round="none" pad="small"> | ||
<FormattedMessage | ||
defaultMessage="Attention stakers: The Merge is approaching! Review the {mergeReadinessChecklist} to make sure you're ready." | ||
values={{ | ||
mergeReadinessChecklist: ( | ||
<Link primary inline to="/merge-readiness"> | ||
<FormattedMessage defaultMessage="Merge readiness checklist" /> | ||
</Link> | ||
), | ||
}} | ||
/> | ||
</StyledAlert> | ||
); | ||
}; |
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 styled from 'styled-components'; | ||
|
||
export const NakedButton = styled.button` | ||
appearance: none; | ||
background: none; | ||
border: none; | ||
color: inherit; | ||
display: inline-block; | ||
font: inherit; | ||
padding: initial; | ||
cursor: pointer; | ||
`; |
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,20 @@ | ||
import { useEffect } from 'react'; | ||
|
||
export const useKeyPress = ( | ||
targetKey: string, | ||
handler: (event: KeyboardEvent) => void | ||
) => { | ||
const downHandler = (event: KeyboardEvent) => { | ||
if (event.key === targetKey) { | ||
handler(event); | ||
} | ||
}; | ||
|
||
useEffect(() => { | ||
window.addEventListener('keydown', downHandler); | ||
// Remove event listeners on cleanup | ||
return () => { | ||
window.removeEventListener('keydown', downHandler); | ||
}; | ||
}); | ||
}; |
Oops, something went wrong.