diff options
author | Sophie Zhang <sophie_zhang@brown.edu> | 2023-07-20 00:54:24 -0400 |
---|---|---|
committer | Sophie Zhang <sophie_zhang@brown.edu> | 2023-07-20 00:54:24 -0400 |
commit | e11aa60b774d457cb016bb0f375ce092f0a733af (patch) | |
tree | 3d04f80a07c48a7f9c3cc67015200594a2128abf /src/client/views/StyleProvider.tsx | |
parent | 078d595cb498592667a653a937b8ba25bcbf41bb (diff) | |
parent | d7a3e39e901054d0308df158cfa578a94f80c467 (diff) |
Merge branch 'master' into sophie-ai-images
Diffstat (limited to 'src/client/views/StyleProvider.tsx')
-rw-r--r-- | src/client/views/StyleProvider.tsx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/client/views/StyleProvider.tsx b/src/client/views/StyleProvider.tsx index 2d4fce899..c7616a9ba 100644 --- a/src/client/views/StyleProvider.tsx +++ b/src/client/views/StyleProvider.tsx @@ -323,13 +323,12 @@ export function DefaultStyleProvider(doc: Opt<Doc>, props: Opt<DocumentViewProps } export function DashboardToggleButton(doc: Doc, field: string, onIcon: IconProp, offIcon: IconProp, clickFunc?: () => void) { - const color = StrCast(Doc.UserDoc().userColor) - if (!doc[field]) return null + const color = StrCast(Doc.UserDoc().userColor); return ( <IconButton size={Size.XSMALL} color={color} - icon={<FontAwesomeIcon icon={(doc[field] ? (onIcon as any) : offIcon) as IconProp}/>} + icon={<FontAwesomeIcon icon={(doc[field] ? (onIcon as any) : offIcon) as IconProp} />} onClick={undoBatch( action((e: React.MouseEvent) => { e.stopPropagation(); @@ -343,9 +342,8 @@ export function DashboardToggleButton(doc: Doc, field: string, onIcon: IconProp, * add lock and hide button decorations for the "Dashboards" flyout TreeView */ export function DashboardStyleProvider(doc: Opt<Doc>, props: Opt<FieldViewProps | DocumentViewProps>, property: string) { - if (doc && property.split(':')[0] === StyleProp.Decorations) { - return doc._type_collection === CollectionViewType.Docking + return doc._type_collection === CollectionViewType.Docking || Doc.IsSystem(doc) ? null : DashboardToggleButton(doc, 'hidden', 'eye-slash', 'eye', () => DocFocusOrOpen(doc, { toggleTarget: true, willZoomCentered: true, zoomScale: 0 }, DocCast(doc?.embedContainer ?? doc?.annotationOn))); } |