From ccbe6cafa422616ec4ffe5c2d1caed7597719007 Mon Sep 17 00:00:00 2001 From: bobzel Date: Sat, 30 Mar 2024 10:14:19 -0400 Subject: cleanup of import orderings. --- .../views/newlightbox/Header/LightboxHeader.tsx | 108 +++++++++++---------- 1 file changed, 58 insertions(+), 50 deletions(-) (limited to 'src/client/views/newlightbox/Header/LightboxHeader.tsx') diff --git a/src/client/views/newlightbox/Header/LightboxHeader.tsx b/src/client/views/newlightbox/Header/LightboxHeader.tsx index a272ce294..76efe0185 100644 --- a/src/client/views/newlightbox/Header/LightboxHeader.tsx +++ b/src/client/views/newlightbox/Header/LightboxHeader.tsx @@ -1,62 +1,70 @@ -import './LightboxHeader.scss'; -import * as React from 'react'; -import { INewLightboxHeader } from "./utils"; -import { NewLightboxView } from '../NewLightboxView'; -import { StrCast } from '../../../../fields/Types'; -import { EditableText } from '../components/EditableText'; -import { getType } from '../utils'; import { Button, IconButton, Size, Type } from 'browndash-components'; -import { MdExplore, MdTravelExplore } from 'react-icons/md' -import { BsBookmark, BsBookmarkFill } from 'react-icons/bs' +import * as React from 'react'; +import { BsBookmark, BsBookmarkFill } from 'react-icons/bs'; +import { MdTravelExplore } from 'react-icons/md'; import { Doc } from '../../../../fields/Doc'; +import { StrCast } from '../../../../fields/Types'; import { LightboxView } from '../../LightboxView'; import { Colors } from '../../global/globalEnums'; - +import { NewLightboxView } from '../NewLightboxView'; +import { EditableText } from '../components/EditableText'; +import { getType } from '../utils'; +import './LightboxHeader.scss'; +import { INewLightboxHeader } from './utils'; export const NewLightboxHeader = (props: INewLightboxHeader) => { - const {height = 100, width} = props; - const [doc, setDoc] = React.useState(LightboxView.LightboxDoc) - const [editing, setEditing] = React.useState(false) - const [title, setTitle] = React.useState( - (null) - ) + const { height = 100, width } = props; + const [doc, setDoc] = React.useState(LightboxView.LightboxDoc); + const [editing, setEditing] = React.useState(false); + const [title, setTitle] = React.useState(null); React.useEffect(() => { - let lbDoc = LightboxView.LightboxDoc - setDoc(lbDoc) + let lbDoc = LightboxView.LightboxDoc; + setDoc(lbDoc); if (lbDoc) { setTitle( - { - if(lbDoc) lbDoc.title = newText; - }} - setEditing={setEditing} - />) + { + if (lbDoc) lbDoc.title = newText; + }} + setEditing={setEditing} + /> + ); } - }, [LightboxView.LightboxDoc]) + }, [LightboxView.LightboxDoc]); - const [saved, setSaved] = React.useState(false) + const [saved, setSaved] = React.useState(false); - if (!doc) return null - else return
e.stopPropagation()} style={{ minHeight: height, height: height, width: width }}> -
-
Title
- {title} -
-
-
Type
-
{getType(StrCast(doc.type))}
-
-
- setSaved(!saved)} color={Colors.DARK_GRAY} icon={saved ? : }/> - setSaved(!saved)} color={Colors.DARK_GRAY} icon={saved ? : }/> -
-
-
-
-} \ No newline at end of file + if (!doc) return null; + else + return ( +
e.stopPropagation()} style={{ minHeight: height, height: height, width: width }}> +
+
Title
+ {title} +
+
+
Type
+
{getType(StrCast(doc.type))}
+
+
+ setSaved(!saved)} color={Colors.DARK_GRAY} icon={saved ? : } /> + setSaved(!saved)} color={Colors.DARK_GRAY} icon={saved ? : } /> +
+
+
+
+ ); +}; -- cgit v1.2.3-70-g09d2