Skip to content

Commit

Permalink
minor bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fsimonjetz committed Dec 4, 2023
1 parent 6022b28 commit 8e9cb43
Showing 1 changed file with 14 additions and 22 deletions.
36 changes: 14 additions & 22 deletions src/corpus/ui/manuscripts/ManuscriptForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import { provenances, Provenances } from 'corpus/domain/provenance'
import BibliographyEntry from 'bibliography/domain/BibliographyEntry'
import Editor from 'editor/Editor'

const indent = '\u00A0'.repeat(4)

export default function ManuscriptForm({
manuscript,
onChange,
Expand Down Expand Up @@ -86,17 +88,12 @@ export default function ManuscriptForm({
value={manuscript.provenance.name}
onChange={handleEnumChange('provenance', Provenances)}
>
{provenances.map((provenance) =>
_.isNil(provenance.parent) ? (
<option key={provenance.name} value={provenance.name}>
{provenance.name}
</option>
) : (
<option key={provenance.name} value={provenance.name}>
&nbsp;&nbsp;&nbsp;&nbsp;{provenance.name}
</option>
)
)}
{provenances.map((provenance, index) => (
<option key={index} value={provenance.name}>
{provenance.parent && indent}
{provenance.name}
</option>
))}
</Form.Control>
</Form.Group>
<Form.Group as={Col}>
Expand All @@ -120,17 +117,12 @@ export default function ManuscriptForm({
value={manuscript.period.name}
onChange={handleEnumChange('period', Periods)}
>
{periods.map((period) =>
_.isNil(period.parent) ? (
<option key={period.name} value={period.name}>
{period.displayName ?? period.name} {period.description}
</option>
) : (
<option key={period.name} value={period.name}>
&nbsp;&nbsp;&nbsp;&nbsp;{period.name} {period.description}
</option>
)
)}
{periods.map((period, index) => (
<option key={index} value={period.name}>
{period.parent && indent}
{period.displayName ?? period.name} {period.description}
</option>
))}
</Form.Control>
</InputGroup>
</Form.Group>
Expand Down

0 comments on commit 8e9cb43

Please sign in to comment.