chore: swaps placement of version comparisons

This commit is contained in:
James
2022-02-09 13:56:08 -05:00
parent eaa4858580
commit e2814b5404
3 changed files with 11 additions and 11 deletions

View File

@@ -85,8 +85,8 @@ const Relationship: React.FC<Props & { field: RelationshipField}> = ({ field, ve
{field.label}
</Label>
<ReactDiffViewer
oldValue={typeof versionToRender !== 'undefined' ? String(versionToRender) : placeholder}
newValue={typeof comparisonToRender !== 'undefined' ? String(comparisonToRender) : placeholder}
oldValue={typeof comparisonToRender !== 'undefined' ? String(comparisonToRender) : placeholder}
newValue={typeof versionToRender !== 'undefined' ? String(versionToRender) : placeholder}
splitView
hideLineNumbers
showDiffOnly={false}

View File

@@ -30,8 +30,8 @@ const Text: React.FC<Props> = ({ field, locale, version, comparison, isRichText
</Label>
<ReactDiffViewer
compareMethod={DiffMethod[diffMethod]}
oldValue={typeof versionToRender !== 'undefined' ? String(versionToRender) : placeholder}
newValue={typeof comparisonToRender !== 'undefined' ? String(comparisonToRender) : placeholder}
oldValue={typeof comparisonToRender !== 'undefined' ? String(comparisonToRender) : placeholder}
newValue={typeof versionToRender !== 'undefined' ? String(versionToRender) : placeholder}
splitView
hideLineNumbers
showDiffOnly={false}

View File

@@ -187,6 +187,12 @@ const VersionView: React.FC<Props> = ({ collection, global }) => {
/>
</header>
<div className={`${baseClass}__controls`}>
<CompareVersion
baseURL={compareBaseURL}
parentID={parentID}
value={compareValue}
onChange={setCompareValue}
/>
{localization && (
<SelectLocales
onChange={setLocales}
@@ -194,19 +200,13 @@ const VersionView: React.FC<Props> = ({ collection, global }) => {
value={locales}
/>
)}
<CompareVersion
baseURL={compareBaseURL}
parentID={parentID}
value={compareValue}
onChange={setCompareValue}
/>
</div>
{isLoading && (
<Loading />
)}
{doc?.version && (
<RenderFieldsToDiff
locales={locales.map((locale) => locale.value)}
locales={locales.map(({ value }) => value)}
fields={fields}
fieldComponents={fieldComponents}
fieldPermissions={fieldPermissions}