fix(editor): Task 12 review minors, delete hint and cite label
This commit is contained in:
1 parent
8c420d4b53
commit
11c2b0c5ee
12 files changed
+113
-47
No files matched your search
@@ -12,8 +12,11 @@ const BOX =
|
||||
|
||||
/**
|
||||
* True when no open dialog lies over `host`: each open one is `host`, holds it, or comes
|
||||
* before it in the page (the editor's layers are stacked in tree order: the references
|
||||
* dialog after the finding dialog, the reference dialog after both).
|
||||
* before it in the page.
|
||||
* Invariant: an open dialog after `host` in tree order lies over it. The editor's layers
|
||||
* keep it (the finding dialog in the tab body, then the references dialog, then the
|
||||
* reference dialog); a modal mounted earlier in the tree must never open over a form
|
||||
* that uses this confirmation, or its question would be focused under that modal.
|
||||
*/
|
||||
const onTop = (host: Element) =>
|
||||
[...document.querySelectorAll('dialog[open]')].every(
|
||||
|
||||
@@ -90,7 +90,7 @@ function DraftRow({ id, props, onRemove }: RowProps) {
|
||||
)
|
||||
}
|
||||
|
||||
/** « Citer une référence » among those not cited yet, and « Nouvelle référence ». */
|
||||
/** « Citer une référence existante » among those not cited yet, and « Nouvelle référence ». */
|
||||
function AddRow({ props }: { props: DraftListProps }) {
|
||||
const t = useT()
|
||||
const options = useCitableOptions(props.ids)
|
||||
@@ -135,19 +135,25 @@ export default function CitationsDraftList(props: DraftListProps) {
|
||||
{t('editor.findings.references_none')}
|
||||
</p>
|
||||
)}
|
||||
<ul ref={focus.list} className="space-y-2">
|
||||
{ids.map((id, at) => (
|
||||
<DraftRow
|
||||
key={id}
|
||||
id={id}
|
||||
props={props}
|
||||
onRemove={() => {
|
||||
focus.removing(at)
|
||||
props.onRemove(id)
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
</ul>
|
||||
{ids.length > 0 && (
|
||||
<ul
|
||||
ref={focus.list}
|
||||
aria-label={t('editor.findings.references')}
|
||||
className="space-y-2"
|
||||
>
|
||||
{ids.map((id, at) => (
|
||||
<DraftRow
|
||||
key={id}
|
||||
id={id}
|
||||
props={props}
|
||||
onRemove={() => {
|
||||
focus.removing(at)
|
||||
props.onRemove(id)
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
</ul>
|
||||
)}
|
||||
<AddRow props={props} />
|
||||
</div>
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user