Skip to content

Commit

Permalink
Part of #18714: Replacing deprecated constants (#20003)
Browse files Browse the repository at this point in the history
* replacing deprecated constants

* updating Box in player.js

* created story for Player.js
  • Loading branch information
dhruvv173 authored Jul 19, 2023
1 parent 821888e commit 674bb13
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@ import React, { useEffect, useMemo, useState } from 'react';
import QRCode from 'qrcode.react';
import { UR, UREncoder } from '@ngraveio/bc-ur';
import PropTypes from 'prop-types';
import Box from '../../../ui/box';
import { useI18nContext } from '../../../../hooks/useI18nContext';
import {
AlignItems,
DISPLAY,
FLEX_DIRECTION,
Display,
FlexDirection,
TextAlign,
} from '../../../../helpers/constants/design-system';
import { PageContainerFooter } from '../../../ui/page-container';
import { Text } from '../../../component-library/text/deprecated';
import { Text, Box } from '../../../component-library';

const Player = ({ type, cbor, cancelQRHardwareSignRequest, toRead }) => {
const t = useI18nContext();
Expand Down Expand Up @@ -39,9 +38,9 @@ const Player = ({ type, cbor, cancelQRHardwareSignRequest, toRead }) => {
<Box
paddingTop={4}
paddingBottom={4}
display={DISPLAY.FLEX}
display={Display.Flex}
alignItems={AlignItems.center}
flexDirection={FLEX_DIRECTION.COLUMN}
flexDirection={FlexDirection.Column}
>
<div
style={{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from 'react';
import Player from './player';

export default {
title: 'Components/App/Player',
component: Player,
argTypes: {
type: {
control: 'text',
},
cbor: {
control: 'text',
},
cancelQRHardwareSignRequest: {
action: 'cancelQRHardwareSignRequest',
},
toRead: {
action: 'toRead',
},
},
args: {
type: 'abc',
cbor: 'abc',
},
};

export const DefaultStory = (args) => <Player {...args} />;

DefaultStory.storyName = 'Default';
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
import React from 'react';
import {
DISPLAY,
Display,
AlignItems,
Color,
JustifyContent,
} from '../../../../helpers/constants/design-system';
import Box from '../../../ui/box';
import { Icon, IconName } from '../../../component-library';
import { Icon, IconName, Box } from '../../../component-library';

const SignatureRequestSIWEIcon = () => {
return (
<Box
className="signature-request-siwe-icon"
display={DISPLAY.INLINE_FLEX}
display={Display.InlineFlex}
alignItems={AlignItems.center}
backgroundColor={Color.errorDefault}
justifyContent={JustifyContent.center}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import {
TextVariant,
Size,
DISPLAY,
Display,
AlignItems,
BackgroundColor,
TextColor,
Expand All @@ -16,7 +16,7 @@ const SignatureRequestSIWETag = ({ text }) => {
<Box
className="signature-request-siwe-tag"
marginRight={1}
display={DISPLAY.INLINE_FLEX}
display={Display.InlineFlex}
alignItems={AlignItems.center}
backgroundColor={BackgroundColor.errorDefault}
borderRadius={Size.XL}
Expand Down
7 changes: 3 additions & 4 deletions ui/components/app/tab-bar/tab-bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ import React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';

import { Icon, IconName, IconSize } from '../../component-library';
import Box from '../../ui/box';
import { Icon, IconName, IconSize, Box } from '../../component-library';
import {
BorderRadius,
Color,
DISPLAY,
Display,
} from '../../../helpers/constants/design-system';

const TabBar = (props) => {
Expand All @@ -33,7 +32,7 @@ const TabBar = (props) => {
className="tab-bar__tab__selected-indicator"
borderRadius={BorderRadius.pill}
backgroundColor={Color.primaryDefault}
display={[DISPLAY.NONE, DISPLAY.BLOCK]}
display={[Display.None, Display.Block]}
/>
)}
<div className="tab-bar__tab__content">
Expand Down

0 comments on commit 674bb13

Please sign in to comment.