Skip to content

Commit

Permalink
fix: rename design-system components for migtration to v2
Browse files Browse the repository at this point in the history
  • Loading branch information
boazpoolman committed Jul 10, 2024
1 parent 1ccd3d2 commit e8db8c6
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 27 deletions.
29 changes: 13 additions & 16 deletions admin/src/components/ConfigDiff/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@ import ReactDiffViewer, { DiffMethod } from 'react-diff-viewer-continued';
import { useIntl } from 'react-intl';

import {
ModalLayout,
ModalBody,
ModalHeader,
Modal,
Grid,
GridItem,
Typography,
} from '@strapi/design-system';

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

return (
<ModalLayout
<Modal.Root
onClose={onClose}
labelledBy="title"
>
<ModalHeader>
<Modal.Header>
<Typography variant="omega" fontWeight="bold" textColor="neutral800">
{formatMessage({ id: 'config-sync.ConfigDiff.Title' })} {configName}
</Typography>
</ModalHeader>
<ModalBody>
<Grid paddingBottom={4} style={{ textAlign: 'center' }}>
<GridItem col={6}>
</Modal.Header>
<Modal.Body>
<Grid.Root paddingBottom={4} style={{ textAlign: 'center' }}>
<Grid.Item col={6}>
<Typography variant="delta">{formatMessage({ id: 'config-sync.ConfigDiff.SyncDirectory' })}</Typography>
</GridItem>
<GridItem col={6}>
</Grid.Item>
<Grid.Item col={6}>
<Typography variant="delta">{formatMessage({ id: 'config-sync.ConfigDiff.Database' })}</Typography>
</GridItem>
</Grid>
</Grid.Item>
</Grid.Root>
<ReactDiffViewer
oldValue={JSON.stringify(oldValue, null, 2)}
newValue={JSON.stringify(newValue, null, 2)}
splitView
compareMethod={DiffMethod.WORDS}
/>
</ModalBody>
</ModalLayout>
</Modal.Body>
</Modal.Root>
);
};

Expand Down
4 changes: 2 additions & 2 deletions admin/src/components/ConfigList/ConfigListRow/index.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Tr, Td, BaseCheckbox } from '@strapi/design-system';
import { Tr, Td, Checkbox } from '@strapi/design-system';

const CustomRow = ({ row, checked, updateValue }) => {
const { configName, configType, state, onClick } = row;
Expand Down Expand Up @@ -42,7 +42,7 @@ const CustomRow = ({ row, checked, updateValue }) => {
style={{ cursor: 'pointer' }}
>
<Td>
<BaseCheckbox
<Checkbox
aria-label={`Select ${configName}`}
value={checked}
onValueChange={updateValue}
Expand Down
4 changes: 2 additions & 2 deletions admin/src/components/ConfigList/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
Tr,
Th,
Typography,
BaseCheckbox,
Checkbox,
Loader,
} from '@strapi/design-system';

Expand Down Expand Up @@ -128,7 +128,7 @@ const ConfigList = ({ diff, isLoading }) => {
<Thead>
<Tr>
<Th>
<BaseCheckbox
<Checkbox
aria-label={formatMessage({ id: 'config-sync.ConfigList.SelectAll' })}
indeterminate={isIndeterminate}
onValueChange={(value) => setCheckedItems(checkedItems.map(() => value))}
Expand Down
12 changes: 5 additions & 7 deletions admin/src/components/ConfirmModal/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { useSelector } from 'react-redux';

import {
Dialog,
DialogBody,
DialogFooter,
Flex,
Typography,
Button,
Expand All @@ -23,12 +21,12 @@ const ConfirmModal = ({ isOpen, onClose, onSubmit, type }) => {
if (!isOpen) return null;

return (
<Dialog
<Dialog.Root
onClose={onClose}
title={formatMessage({ id: "config-sync.popUpWarning.Confirmation" })}
isOpen={isOpen}
>
<DialogBody icon={<WarningCircle />}>
<Dialog.Body icon={<WarningCircle />}>
<Flex size={2}>
<Flex justifyContent="center">
<Typography variant="omega" id="confirm-description" style={{ textAlign: 'center' }}>
Expand All @@ -37,7 +35,7 @@ const ConfirmModal = ({ isOpen, onClose, onSubmit, type }) => {
</Typography>
</Flex>
</Flex>
</DialogBody>
</Dialog.Body>
{(soft && type === 'import') && (
<React.Fragment>
<Divider />
Expand All @@ -53,7 +51,7 @@ const ConfirmModal = ({ isOpen, onClose, onSubmit, type }) => {
</Box>
</React.Fragment>
)}
<DialogFooter
<Dialog.Footer
startAction={(
<Button
onClick={() => {
Expand All @@ -75,7 +73,7 @@ const ConfirmModal = ({ isOpen, onClose, onSubmit, type }) => {
{formatMessage({ id: `config-sync.popUpWarning.button.${type}` })}
</Button>
)} />
</Dialog>
</Dialog.Root>
);
};

Expand Down

0 comments on commit e8db8c6

Please sign in to comment.