Skip to content

Commit

Permalink
Fix losing mnemonic input when changing phone orientation
Browse files Browse the repository at this point in the history
A Layer inside Layer seems to lose useState inside MnemonicValidation.
  • Loading branch information
lukaw3d committed Jul 16, 2024
1 parent 8d49242 commit 2cebd0f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
1 change: 1 addition & 0 deletions .changelog/2008.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix losing mnemonic input when changing phone orientation
13 changes: 3 additions & 10 deletions src/app/pages/CreateWalletPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { Box } from 'grommet/es6/components/Box'
import { Button } from 'grommet/es6/components/Button'
import { CheckBox } from 'grommet/es6/components/CheckBox'
import { Grid } from 'grommet/es6/components/Grid'
import { Layer } from 'grommet/es6/components/Layer'
import { ResponsiveContext } from 'grommet/es6/contexts/ResponsiveContext'
import { Text } from 'grommet/es6/components/Text'
import { Refresh } from 'grommet-icons/es6/icons/Refresh'
Expand All @@ -27,6 +26,7 @@ import { selectShowAccountsSelectionModal } from 'app/state/importaccounts/selec
import { createWalletActions } from './slice'
import { selectCheckbox, selectMnemonic } from './slice/selectors'
import { WalletType } from 'app/state/wallet/types'
import { ThemeContext } from 'grommet/contexts/ThemeContext'

Check failure on line 29 in src/app/pages/CreateWalletPage/index.tsx

View workflow job for this annotation

GitHub Actions / lint

'grommet/contexts/ThemeContext' import is restricted from being used by a pattern. Import 'grommet/es6/*' instead

export interface CreateWalletProps {}

Expand Down Expand Up @@ -73,14 +73,7 @@ export function CreateWalletPage(props: CreateWalletProps) {
</AlertBox>
)}
{showConfirmation && (
<Layer
plain
full
style={{ backdropFilter: 'blur(5px)' }}
// Needed to prevent keyboard accessibility issues with layer inside
// layer: https://github.com/oasisprotocol/oasis-wallet-web/issues/863
modal={false}
>
<ThemeContext.Extend value={{ layer: { overlay: { backdropFilter: 'blur(5px)' } } }}>
<ResponsiveLayer
style={{
width: { small: '100vw', medium: '90vw', large: '1500px' }[size],
Expand All @@ -95,7 +88,7 @@ export function CreateWalletPage(props: CreateWalletProps) {
abortHandler={() => setConfirmation(false)}
></MnemonicValidation>
</ResponsiveLayer>
</Layer>
</ThemeContext.Extend>
)}
{showAccountsSelectionModal && (
<ImportAccountsSelectionModal
Expand Down

0 comments on commit 2cebd0f

Please sign in to comment.