Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show a new domain banner #1415

Merged
merged 1 commit into from
Apr 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion playwright/tests/syncTabs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ test.describe('syncTabs', () => {
// Second tab should sync the opened wallet
await tab2.goto('/')
await expect(tab2.getByTestId('account-selector')).toBeVisible()
await tab2.getByRole('link', { name: 'Wallet' }).click()
await tab2.getByRole('link', { name: 'Wallet', exact: true }).click()
await expect(tab2).toHaveURL(new RegExp(`/account/${privateKeyAddress}`))
await expect(tab2.getByTestId('account-balance-summary')).toContainText('ROSE')

Expand Down
31 changes: 29 additions & 2 deletions src/app/components/BuildPreviewBanner/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,42 @@
import { useTranslation } from 'react-i18next'
import { Trans, useTranslation } from 'react-i18next'
import { Alert } from 'grommet-icons/es6/icons/Alert'
import { Info } from 'grommet-icons/es6/icons/Info'
import { Box } from 'grommet/es6/components/Box'
import { Text } from 'grommet/es6/components/Text'
import { AlertBox } from 'app/components/AlertBox'
import { buildPreviewBannerZIndex } from '../../../styles/theme/elementSizes'
import { AnchorLink } from '../AnchorLink'

export const BuildPreviewBanner = () => {
const { t } = useTranslation()

if (!process.env.REACT_APP_BUILD_PREVIEW) {
return null
return (
<Box
background={{ color: 'white' }}
style={{
position: 'sticky',
top: 0,
zIndex: buildPreviewBannerZIndex,
}}
>
<AlertBox color="status-ok">
<Box direction="row" gap="small" align="center" justify="center">
<Info color="status-ok" size="20px" />
<Text size="12px">
<Trans
i18nKey="banner.domainMoved"
t={t}
components={{
NewLink: <AnchorLink to="https://wallet.oasis.io/" label="https://wallet.oasis.io/" />,
}}
defaults="Oasis Wallet has a new home at <NewLink />."
/>
</Text>
</Box>
</AlertBox>
</Box>
)
}

return (
Expand Down
3 changes: 3 additions & 0 deletions src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@
"oasismonitor": "Oasis Monitor API",
"oasisscan": "Oasis Scan API"
},
"banner": {
"domainMoved": "Oasis Wallet has a new home at <NewLink />."
},
"buildPreview": "Please note this is an experimental build of Oasis Wallet and that data that is shown might be incorrect.",
"common": {
"amount": "Amount",
Expand Down