Skip to content

Commit 1534bb8

Browse files
Copilotsix7
andcommitted
Complete Box component migration - final comprehensive fix
Co-authored-by: six7 <4548309+six7@users.noreply.github.com>
1 parent 4a33fdd commit 1534bb8

File tree

4 files changed

+49
-29
lines changed

4 files changed

+49
-29
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.loadingBarContainer {
2+
position: fixed;
3+
width: 100%;
4+
z-index: 20;
5+
}

packages/tokens-studio-for-figma/src/app/components/LoadingBar.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@ import React from 'react';
22
import get from 'just-safe-get';
33
import { useSelector } from 'react-redux';
44
import {
5-
Box, Button, Spinner, Stack, Text,
5+
Button, Spinner, Stack, Text,
66
} from '@tokens-studio/ui';
77
import { useDelayedFlag } from '@/hooks';
88
import { BackgroundJobs } from '@/constants/BackgroundJobs';
99
import { backgroundJobsSelector, windowSizeSelector } from '@/selectors';
1010
import { AsyncMessageTypes } from '@/types/AsyncMessages';
1111
import { AsyncMessageChannel } from '@/AsyncMessageChannel';
1212
import { formatNumber } from '@/utils/formatNumber';
13+
import styles from './LoadingBar.module.css';
1314
// TODO : i18n needs some refactoring
1415
export const backgroundJobTitles = {
1516
[BackgroundJobs.NODEMANAGER_FINDNODESWITHDATA]: 'Finding nodes...',
@@ -68,7 +69,7 @@ export default function LoadingBar() {
6869
const message = get(backgroundJobTitles, backgroundJobs[backgroundJobs.length - 1]?.name ?? '', '');
6970

7071
return (
71-
<Box css={{ position: 'fixed', width: '100%', zIndex: 20 }} data-testid="loadingBar">
72+
<div className={styles.loadingBarContainer} data-testid="loadingBar">
7273
<Stack
7374
direction="row"
7475
align="center"
@@ -97,6 +98,6 @@ export default function LoadingBar() {
9798
</Stack>
9899
)}
99100
</Stack>
100-
</Box>
101+
</div>
101102
);
102103
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
.mainContainer {
2+
align-items: center;
3+
flex-direction: row;
4+
flex-grow: 1;
5+
display: flex;
6+
overflow: hidden;
7+
gap: var(--space-3, 12px);
8+
}
9+
10+
.iconContainer {
11+
/* Icon wrapper */
12+
}
13+
14+
.contentContainer {
15+
/* Content wrapper */
16+
}
17+
18+
.titleText {
19+
font-size: var(--font-sizes-small);
20+
font-weight: var(--font-weights-sans-bold);
21+
}
22+
23+
.actionsContainer {
24+
margin-right: var(--space-2, 8px);
25+
min-height: var(--sizes-control-small);
26+
display: flex;
27+
align-items: center;
28+
gap: var(--space-2, 8px);
29+
}

packages/tokens-studio-for-figma/src/app/components/LocalStorageItem.tsx

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import { useTranslation } from 'react-i18next';
33
import {
4-
Button, Box, Text,
4+
Button, Text,
55
} from '@tokens-studio/ui';
66
import { useDispatch, useSelector } from 'react-redux';
77

@@ -13,6 +13,7 @@ import { storageTypeSelector } from '@/selectors';
1313
import useConfirm from '../hooks/useConfirm';
1414
import { StorageProviderType } from '@/constants/StorageProviderType';
1515
import { TokenFormatBadge } from './TokenFormatBadge';
16+
import styles from './LocalStorageItem.module.css';
1617

1718
const LocalStorageItem = () => {
1819
const { t } = useTranslation(['storage']);
@@ -48,32 +49,16 @@ const LocalStorageItem = () => {
4849

4950
return (
5051
<StyledStorageItem active={isActive} style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
51-
<Box
52-
css={{
53-
alignItems: 'center',
54-
flexDirection: 'row',
55-
flexGrow: '1',
56-
display: 'flex',
57-
overflow: 'hidden',
58-
gap: '$3',
59-
}}
60-
>
61-
<Box>
52+
<div className={styles.mainContainer}>
53+
<div className={styles.iconContainer}>
6254
<IconFile />
63-
</Box>
64-
<Box>
65-
<Box css={{ fontSize: '$small', fontWeight: '$sansBold' }}>{t('localDocument')}</Box>
55+
</div>
56+
<div className={styles.contentContainer}>
57+
<div className={styles.titleText}>{t('localDocument')}</div>
6658
<Text muted size="xsmall">Tokens will be stored on this Figma file</Text>
67-
</Box>
68-
</Box>
69-
<Box
70-
css={{
71-
marginRight: '$2',
72-
minHeight: '$controlSmall',
73-
display: 'flex',
74-
alignItems: 'center',
75-
}}
76-
>
59+
</div>
60+
</div>
61+
<div className={styles.actionsContainer}>
7762
{isActive ? (
7863
<TokenFormatBadge extended />
7964
) : (
@@ -86,7 +71,7 @@ const LocalStorageItem = () => {
8671
{t('apply')}
8772
</Button>
8873
)}
89-
</Box>
74+
</div>
9075
</StyledStorageItem>
9176
);
9277
};

0 commit comments

Comments
 (0)