Skip to content

Commit e8db8c6

Browse files
committed
fix: rename design-system components for migtration to v2
1 parent 1ccd3d2 commit e8db8c6

File tree

4 files changed

+22
-27
lines changed

4 files changed

+22
-27
lines changed

admin/src/components/ConfigDiff/index.jsx

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@ import ReactDiffViewer, { DiffMethod } from 'react-diff-viewer-continued';
33
import { useIntl } from 'react-intl';
44

55
import {
6-
ModalLayout,
7-
ModalBody,
8-
ModalHeader,
6+
Modal,
97
Grid,
10-
GridItem,
118
Typography,
129
} from '@strapi/design-system';
1310

@@ -16,32 +13,32 @@ const ConfigDiff = ({ isOpen, onClose, oldValue, newValue, configName }) => {
1613
if (!isOpen) return null;
1714

1815
return (
19-
<ModalLayout
16+
<Modal.Root
2017
onClose={onClose}
2118
labelledBy="title"
2219
>
23-
<ModalHeader>
20+
<Modal.Header>
2421
<Typography variant="omega" fontWeight="bold" textColor="neutral800">
2522
{formatMessage({ id: 'config-sync.ConfigDiff.Title' })} {configName}
2623
</Typography>
27-
</ModalHeader>
28-
<ModalBody>
29-
<Grid paddingBottom={4} style={{ textAlign: 'center' }}>
30-
<GridItem col={6}>
24+
</Modal.Header>
25+
<Modal.Body>
26+
<Grid.Root paddingBottom={4} style={{ textAlign: 'center' }}>
27+
<Grid.Item col={6}>
3128
<Typography variant="delta">{formatMessage({ id: 'config-sync.ConfigDiff.SyncDirectory' })}</Typography>
32-
</GridItem>
33-
<GridItem col={6}>
29+
</Grid.Item>
30+
<Grid.Item col={6}>
3431
<Typography variant="delta">{formatMessage({ id: 'config-sync.ConfigDiff.Database' })}</Typography>
35-
</GridItem>
36-
</Grid>
32+
</Grid.Item>
33+
</Grid.Root>
3734
<ReactDiffViewer
3835
oldValue={JSON.stringify(oldValue, null, 2)}
3936
newValue={JSON.stringify(newValue, null, 2)}
4037
splitView
4138
compareMethod={DiffMethod.WORDS}
4239
/>
43-
</ModalBody>
44-
</ModalLayout>
40+
</Modal.Body>
41+
</Modal.Root>
4542
);
4643
};
4744

admin/src/components/ConfigList/ConfigListRow/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { Tr, Td, BaseCheckbox } from '@strapi/design-system';
2+
import { Tr, Td, Checkbox } from '@strapi/design-system';
33

44
const CustomRow = ({ row, checked, updateValue }) => {
55
const { configName, configType, state, onClick } = row;
@@ -42,7 +42,7 @@ const CustomRow = ({ row, checked, updateValue }) => {
4242
style={{ cursor: 'pointer' }}
4343
>
4444
<Td>
45-
<BaseCheckbox
45+
<Checkbox
4646
aria-label={`Select ${configName}`}
4747
value={checked}
4848
onValueChange={updateValue}

admin/src/components/ConfigList/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
Tr,
1111
Th,
1212
Typography,
13-
BaseCheckbox,
13+
Checkbox,
1414
Loader,
1515
} from '@strapi/design-system';
1616

@@ -128,7 +128,7 @@ const ConfigList = ({ diff, isLoading }) => {
128128
<Thead>
129129
<Tr>
130130
<Th>
131-
<BaseCheckbox
131+
<Checkbox
132132
aria-label={formatMessage({ id: 'config-sync.ConfigList.SelectAll' })}
133133
indeterminate={isIndeterminate}
134134
onValueChange={(value) => setCheckedItems(checkedItems.map(() => value))}

admin/src/components/ConfirmModal/index.jsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import { useSelector } from 'react-redux';
44

55
import {
66
Dialog,
7-
DialogBody,
8-
DialogFooter,
97
Flex,
108
Typography,
119
Button,
@@ -23,12 +21,12 @@ const ConfirmModal = ({ isOpen, onClose, onSubmit, type }) => {
2321
if (!isOpen) return null;
2422

2523
return (
26-
<Dialog
24+
<Dialog.Root
2725
onClose={onClose}
2826
title={formatMessage({ id: "config-sync.popUpWarning.Confirmation" })}
2927
isOpen={isOpen}
3028
>
31-
<DialogBody icon={<WarningCircle />}>
29+
<Dialog.Body icon={<WarningCircle />}>
3230
<Flex size={2}>
3331
<Flex justifyContent="center">
3432
<Typography variant="omega" id="confirm-description" style={{ textAlign: 'center' }}>
@@ -37,7 +35,7 @@ const ConfirmModal = ({ isOpen, onClose, onSubmit, type }) => {
3735
</Typography>
3836
</Flex>
3937
</Flex>
40-
</DialogBody>
38+
</Dialog.Body>
4139
{(soft && type === 'import') && (
4240
<React.Fragment>
4341
<Divider />
@@ -53,7 +51,7 @@ const ConfirmModal = ({ isOpen, onClose, onSubmit, type }) => {
5351
</Box>
5452
</React.Fragment>
5553
)}
56-
<DialogFooter
54+
<Dialog.Footer
5755
startAction={(
5856
<Button
5957
onClick={() => {
@@ -75,7 +73,7 @@ const ConfirmModal = ({ isOpen, onClose, onSubmit, type }) => {
7573
{formatMessage({ id: `config-sync.popUpWarning.button.${type}` })}
7674
</Button>
7775
)} />
78-
</Dialog>
76+
</Dialog.Root>
7977
);
8078
};
8179

0 commit comments

Comments
 (0)