From 3a1bcf14466b40cec1d7a2a155a0479a891880e1 Mon Sep 17 00:00:00 2001 From: Goktug Poyraz Date: Tue, 21 Mar 2023 13:09:13 +0100 Subject: [PATCH] Adds desktop pairing page story and fix suggestions --- .../desktop-pairing.test.js.snap | 14 ++++----- .../desktop-pairing.component.js | 27 +++++++++-------- .../desktop-pairing.stories.js | 30 +++++++++++++++++++ ui/pages/desktop-pairing/index.scss | 17 ++--------- 4 files changed, 52 insertions(+), 36 deletions(-) create mode 100644 ui/pages/desktop-pairing/desktop-pairing.stories.js diff --git a/ui/pages/desktop-pairing/__snapshots__/desktop-pairing.test.js.snap b/ui/pages/desktop-pairing/__snapshots__/desktop-pairing.test.js.snap index c3a42d035..586e81444 100644 --- a/ui/pages/desktop-pairing/__snapshots__/desktop-pairing.test.js.snap +++ b/ui/pages/desktop-pairing/__snapshots__/desktop-pairing.test.js.snap @@ -117,12 +117,12 @@ exports[`Desktop Pairing page should render otp component 1`] = ` style="display: inline;" tabindex="0" > -

123456 -

+

@@ -153,12 +153,10 @@ exports[`Desktop Pairing page should render otp component 1`] = `

diff --git a/ui/pages/desktop-pairing/desktop-pairing.component.js b/ui/pages/desktop-pairing/desktop-pairing.component.js index 098976b66..c529aa261 100644 --- a/ui/pages/desktop-pairing/desktop-pairing.component.js +++ b/ui/pages/desktop-pairing/desktop-pairing.component.js @@ -1,7 +1,6 @@ import React, { useState, useEffect, useRef, useContext } from 'react'; import { useHistory } from 'react-router-dom'; import PropTypes from 'prop-types'; -import Button from '../../components/ui/button'; import { SECOND } from '../../../shared/constants/time'; import { I18nContext } from '../../contexts/i18n'; import IconDesktopPairing from '../../components/ui/icon/icon-desktop-pairing'; @@ -10,13 +9,14 @@ import { TextVariant, DISPLAY, AlignItems, - BLOCK_SIZES, JustifyContent, + BackgroundColor, + BorderRadius, } from '../../helpers/constants/design-system'; import Box from '../../components/ui/box/box'; import { useCopyToClipboard } from '../../hooks/useCopyToClipboard'; import Tooltip from '../../components/ui/tooltip'; -import { Text } from '../../components/component-library'; +import { Text, Button } from '../../components/component-library'; export default function DesktopPairingPage({ generateDesktopOtp, @@ -104,11 +104,7 @@ export default function DesktopPairingPage({ {t('desktopPageTitle')} - + {t('desktopPageSubTitle')} - + {otp} @@ -137,9 +137,12 @@ export default function DesktopPairingPage({ marginBottom={6} > {t('desktopPairingExpireMessage', [ { return ( - +