diff options
author | geireann <geireann.lindfield@gmail.com> | 2021-09-12 10:03:00 -0400 |
---|---|---|
committer | geireann <geireann.lindfield@gmail.com> | 2021-09-12 10:03:00 -0400 |
commit | 939c7d092635e47e081aa8f047b73af36058f3b7 (patch) | |
tree | 7b5d4a9dce0c66ce3e2bd62755f536d41db48181 /src/client/views/StyleProvider.tsx | |
parent | f20dfa857e1651ced1eb2303ea8a8462483fbc4c (diff) | |
parent | d9419c89ccdac7435c87b27a55486b7a5980ae29 (diff) |
Merge branch 'menu_updates_geireann' of https://github.com/brown-dash/Dash-Web into menu_updates_geireann
Diffstat (limited to 'src/client/views/StyleProvider.tsx')
-rw-r--r-- | src/client/views/StyleProvider.tsx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/client/views/StyleProvider.tsx b/src/client/views/StyleProvider.tsx index e528e84e3..3c88a4830 100644 --- a/src/client/views/StyleProvider.tsx +++ b/src/client/views/StyleProvider.tsx @@ -93,9 +93,12 @@ export function DefaultStyleProvider(doc: Opt<Doc>, props: Opt<DocumentViewProps case StyleProp.Opacity: return Cast(doc?._opacity, "number", Cast(doc?.opacity, "number", null)); case StyleProp.HideLinkButton: return props?.hideLinkButton || (!selected && (doc?.isLinkButton || doc?.hideLinkButton)); case StyleProp.FontSize: return StrCast(doc?.[fieldKey + "fontSize"]); - case StyleProp.ShowTitle: return doc && !doc.presentationTargetDoc && StrCast(doc._showTitle, - !Doc.IsSystem(doc) && doc.type === DocumentType.RTF ? - (doc.author === Doc.CurrentUserEmail ? StrCast(Doc.UserDoc().showTitle) : "author;creationDate") : "") || ""; + case StyleProp.ShowTitle: return (doc && !doc.presentationTargetDoc && + StrCast(doc._showTitle, + props?.showTitle?.() || + (!Doc.IsSystem(doc) && [DocumentType.COL, DocumentType.RTF, DocumentType.IMG, DocumentType.VID].includes(doc.type as any) ? + (doc.author === Doc.CurrentUserEmail ? StrCast(Doc.UserDoc().showTitle) : + "author;creationDate") : "")) || ""); case StyleProp.Color: if (MainView.Instance.LastButton === doc) return Colors.DARK_GRAY; const docColor: Opt<string> = StrCast(doc?.[fieldKey + "color"], StrCast(doc?._color)); |