feat: Add titles to the diff viewer

pull/28/head
Boaz Poolman 2021-11-19 20:39:32 +01:00
parent b07ffa6281
commit 15c770e9d0
1 changed files with 16 additions and 8 deletions

View File

@ -3,6 +3,8 @@ import ReactDiffViewer, { DiffMethod } from 'react-diff-viewer';
import { ModalLayout, ModalBody, ModalHeader } from '@strapi/design-system/ModalLayout'; import { ModalLayout, ModalBody, ModalHeader } from '@strapi/design-system/ModalLayout';
import { ButtonText } from '@strapi/design-system/Text'; import { ButtonText } from '@strapi/design-system/Text';
import { Grid, GridItem } from '@strapi/design-system/Grid';
import { Typography } from '@strapi/design-system/Typography';
const ConfigDiff = ({ isOpen, onClose, oldValue, newValue, configName }) => { const ConfigDiff = ({ isOpen, onClose, oldValue, newValue, configName }) => {
if (!isOpen) { if (!isOpen) {
@ -20,14 +22,20 @@ const ConfigDiff = ({ isOpen, onClose, oldValue, newValue, configName }) => {
</ButtonText> </ButtonText>
</ModalHeader> </ModalHeader>
<ModalBody> <ModalBody>
<section style={{ marginTop: 20 }}> <Grid paddingBottom={4} style={{ textAlign: 'center' }}>
<GridItem col={6}>
<Typography variant="delta">Sync directory</Typography>
</GridItem>
<GridItem col={6}>
<Typography variant="delta">Database</Typography>
</GridItem>
</Grid>
<ReactDiffViewer <ReactDiffViewer
oldValue={JSON.stringify(oldValue, null, 2)} oldValue={JSON.stringify(oldValue, null, 2)}
newValue={JSON.stringify(newValue, null, 2)} newValue={JSON.stringify(newValue, null, 2)}
splitView splitView
compareMethod={DiffMethod.WORDS} compareMethod={DiffMethod.WORDS}
/> />
</section>
</ModalBody> </ModalBody>
</ModalLayout> </ModalLayout>
); );