fix(mobile): backlink ordering in doc info (#9015)

fix AF-1885
This commit is contained in:
pengx17
2024-12-09 03:48:08 +00:00
parent 5a6dd29d36
commit f073df3ee5
3 changed files with 42 additions and 42 deletions

View File

@@ -88,13 +88,13 @@ globalStyle(`${link} .affine-reference-title`, {
export const linkPreviewContainer = style({ export const linkPreviewContainer = style({
display: 'flex', display: 'flex',
flexDirection: 'column', flexDirection: 'column',
gap: '8px',
}); });
export const linkPreview = style({ export const linkPreview = style({
border: `1px solid ${cssVarV2('layer/insideBorder/border')}`, border: `1px solid ${cssVarV2('layer/insideBorder/border')}`,
borderRadius: '8px', borderRadius: '8px',
padding: '8px', padding: '8px',
marginBottom: '8px',
color: cssVarV2('text/primary'), color: cssVarV2('text/primary'),
':hover': { ':hover': {
backgroundColor: cssVarV2('layer/background/hoverOverlay'), backgroundColor: cssVarV2('layer/background/hoverOverlay'),

View File

@@ -95,26 +95,6 @@ export const InfoTable = ({
return ( return (
<> <>
{backlinks && backlinks.length > 0 ? (
<>
<LinksRow
references={backlinks}
onClick={onClose}
label={t['com.affine.page-properties.backlinks']()}
/>
<Divider size="thinner" />
</>
) : null}
{links && links.length > 0 ? (
<>
<LinksRow
references={links}
onClick={onClose}
label={t['com.affine.page-properties.outgoing-links']()}
/>
<Divider size="thinner" />
</>
) : null}
<PropertyCollapsibleSection <PropertyCollapsibleSection
title={t.t('com.affine.workspace.properties')} title={t.t('com.affine.workspace.properties')}
> >
@@ -166,6 +146,26 @@ export const InfoTable = ({
</PropertyCollapsibleSection> </PropertyCollapsibleSection>
<Divider size="thinner" /> <Divider size="thinner" />
<DocDatabaseBacklinkInfo onChange={onBacklinkPropertyChange} /> <DocDatabaseBacklinkInfo onChange={onBacklinkPropertyChange} />
{backlinks && backlinks.length > 0 ? (
<>
<LinksRow
references={backlinks}
onClick={onClose}
label={t['com.affine.page-properties.backlinks']()}
/>
<Divider size="thinner" />
</>
) : null}
{links && links.length > 0 ? (
<>
<LinksRow
references={links}
onClick={onClose}
label={t['com.affine.page-properties.outgoing-links']()}
/>
<Divider size="thinner" />
</>
) : null}
</> </>
); );
}; };

View File

@@ -78,27 +78,6 @@ export const DocInfoSheet = ({
<Suspense> <Suspense>
<TimeRow docId={docId} className={styles.timeRow} /> <TimeRow docId={docId} className={styles.timeRow} />
<Divider size="thinner" /> <Divider size="thinner" />
{backlinks && backlinks.length > 0 ? (
<>
<LinksRow
className={styles.linksRow}
references={backlinks}
label={t['com.affine.page-properties.backlinks']()}
/>
<Divider size="thinner" />
</>
) : null}
{links && links.length > 0 ? (
<>
<LinksRow
className={styles.linksRow}
references={links}
label={t['com.affine.page-properties.outgoing-links']()}
/>
<Divider size="thinner" />
</>
) : null}
<PropertyCollapsibleSection <PropertyCollapsibleSection
title={t.t('com.affine.workspace.properties')} title={t.t('com.affine.workspace.properties')}
> >
@@ -150,6 +129,27 @@ export const DocInfoSheet = ({
<Divider size="thinner" /> <Divider size="thinner" />
<DocDatabaseBacklinkInfo /> <DocDatabaseBacklinkInfo />
{backlinks && backlinks.length > 0 ? (
<>
<LinksRow
className={styles.linksRow}
references={backlinks}
label={t['com.affine.page-properties.backlinks']()}
/>
<Divider size="thinner" />
</>
) : null}
{links && links.length > 0 ? (
<>
<LinksRow
className={styles.linksRow}
references={links}
label={t['com.affine.page-properties.outgoing-links']()}
/>
<Divider size="thinner" />
</>
) : null}
</Suspense> </Suspense>
</Scrollable.Viewport> </Scrollable.Viewport>
<Scrollable.Scrollbar className={styles.scrollBar} /> <Scrollable.Scrollbar className={styles.scrollBar} />