Skip to content

Commit

Permalink
Feat/warning for resolution delay (#213)
Browse files Browse the repository at this point in the history
* feat: add a warning for resolution delay
  • Loading branch information
wantedsystem authored Jul 25, 2024
1 parent eb561c0 commit df04d01
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
5 changes: 4 additions & 1 deletion packages/linea-ens-app/public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -386,5 +386,8 @@
},
"dns": {
"refresh": "Refresh DNS"
},
"warning": {
"finalization": "You will be able to use your new domain anywhere ENS is supported once the transaction is finalized on L1. This process takes 8 to 32 hours. <a href='https://docs.linea.build/' style='color:blue;' target='_blank'>Read more</a>"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { useAddRecentTransaction } from '@app/hooks/transactions/useAddRecentTra
import { useRecentTransactions } from '@app/hooks/transactions/useRecentTransactions'
import { useIsSafeApp } from '@app/hooks/useIsSafeApp'
import { useQueryOptions } from '@app/hooks/useQueryOptions'
import { Content } from '@app/layouts/Content'
import {
ManagedDialogProps,
TransactionFlowAction,
Expand Down Expand Up @@ -506,6 +507,17 @@ export const TransactionStageModal = ({
</Outlink>
)}
{lowerError && <Helper type="error">{lowerError}</Helper>}
{stage === 'complete' ? (
<Content title="" hideHeading>
{{
warning: {
type: 'warning',
message: t('warning.finalization'),
},
trailing: <></>,
}}
</Content>
) : null}
</InnerDialog>
<Dialog.Footer
currentStep={currentStep}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { Card } from '@app/components/Card'
import { Button } from '@app/components/styled/Button'
import { Typography } from '@app/components/styled/Typography'
import useWindowSize from '@app/hooks/useWindowSize'
import { Content } from '@app/layouts/Content'

const StyledCard = styled(Card)(
({ theme }) => css`
Expand Down Expand Up @@ -122,6 +123,7 @@ type Props = {

const CompletePoh = ({ name, beautifiedName, callback }: Props) => {
const { t } = useTranslation('register')
const { t: translateCommon } = useTranslation()
const { width, height } = useWindowSize()
const { avatarSrc } = useEthInvoice(name)

Expand Down Expand Up @@ -175,6 +177,15 @@ const CompletePoh = ({ name, beautifiedName, callback }: Props) => {
</Typography>
</TitleContainer>
<Typography>{t('steps.complete.description')}</Typography>
<Content title="" hideHeading>
{{
warning: {
type: 'warning',
message: translateCommon('warning.finalization'),
},
trailing: <></>,
}}
</Content>
<ButtonContainer>
<MobileFullWidth>
<Button data-testid="view-name" onClick={() => callback(true)}>
Expand Down
2 changes: 1 addition & 1 deletion packages/linea-ens-app/src/layouts/Content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ export const Content = ({
const WarningComponent = !loading && warning && (
<WarningWrapper>
<Banner title={warning.title} alert={warning.type}>
{warning.message}
<div dangerouslySetInnerHTML={{ __html: warning.message! }} />
</Banner>
</WarningWrapper>
)
Expand Down

0 comments on commit df04d01

Please sign in to comment.