From 3958654925e92b1046b3ed5d49160514b6e48258 Mon Sep 17 00:00:00 2001 From: geireann Date: Tue, 6 Jun 2023 14:36:21 -0400 Subject: added rec stuff and begun updating components --- .../views/newlightbox/Header/LightboxHeader.scss | 90 ++++++++++++++++++++++ .../views/newlightbox/Header/LightboxHeader.tsx | 67 ++++++++++++++++ src/client/views/newlightbox/Header/index.ts | 1 + src/client/views/newlightbox/Header/utils.ts | 4 + 4 files changed, 162 insertions(+) create mode 100644 src/client/views/newlightbox/Header/LightboxHeader.scss create mode 100644 src/client/views/newlightbox/Header/LightboxHeader.tsx create mode 100644 src/client/views/newlightbox/Header/index.ts create mode 100644 src/client/views/newlightbox/Header/utils.ts (limited to 'src/client/views/newlightbox/Header') diff --git a/src/client/views/newlightbox/Header/LightboxHeader.scss b/src/client/views/newlightbox/Header/LightboxHeader.scss new file mode 100644 index 000000000..2872a383b --- /dev/null +++ b/src/client/views/newlightbox/Header/LightboxHeader.scss @@ -0,0 +1,90 @@ +@import '../NewLightboxStyles.scss'; + +.newLightboxHeader-container { + width: 100%; + height: 100%; + background: $gray-l1; + border-radius: 20px 20px 0px 0px; + padding: 20px; + display: grid; + grid-template-columns: 70% 30%; + grid-template-rows: 50% 50%; + + .title-container, + .type-container { + display: flex; + flex-direction: row; + gap: 5px; + justify-content: flex-start; + align-items: center; + } + + .title-container { + grid-column: 1; + grid-row: 1; + } + + .type-container { + grid-column: 1; + grid-row: 2; + .type { + padding: 2px 7px !important; + background: $gray-l2; + } + } + + .lb-label { + color: $gray-l3; + font-weight: $h1-weight; + } + + .lb-button { + border: solid 1.5px black; + padding: 3px 5px; + cursor: pointer; + display: flex; + flex-direction: row; + justify-content: space-evenly; + align-items: center; + transition: 0.2s ease; + gap: 5px; + font-size: $body-size; + height: fit-content; + + &:hover { + background: $gray-l2; + } + + &.true { + background: $blue-l1; + } + } + + .lb-button2 { + padding: 3px; + cursor: pointer; + display: flex; + flex-direction: row; + justify-content: space-evenly; + align-items: center; + transition: 0.2s ease; + gap: 5px; + font-size: 15px; + height: fit-content; + border-radius: 3px; + + &:hover { + background: $gray-l2; + transform: scale(1.01); + } + } + + &.dark { + background: $black; + } + + &.light, + &.default { + background: $white; + } +} \ No newline at end of file diff --git a/src/client/views/newlightbox/Header/LightboxHeader.tsx b/src/client/views/newlightbox/Header/LightboxHeader.tsx new file mode 100644 index 000000000..a542d2943 --- /dev/null +++ b/src/client/views/newlightbox/Header/LightboxHeader.tsx @@ -0,0 +1,67 @@ +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, Size, Type } from 'browndash-components'; +import { MdExplore, MdTravelExplore } from 'react-icons/md' +import { BsBookmark, BsBookmarkFill } from 'react-icons/bs' +import { Doc } from '../../../../fields/Doc'; + + +export const NewLightboxHeader = (props: INewLightboxHeader) => { + const {height = 100, width} = props; + const [doc, setDoc] = React.useState(NewLightboxView.LightboxDoc) + const [editing, setEditing] = React.useState(false) + const [title, setTitle] = React.useState( + (null) + ) + React.useEffect(() => { + let lbDoc = NewLightboxView.LightboxDoc + setDoc(lbDoc) + if (lbDoc) { + setTitle( + { + if(lbDoc) lbDoc.title = newText; + }} + setEditing={setEditing} + />) + } + }, [NewLightboxView.LightboxDoc]) + + 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)}> + {saved ? : } +
+
setSaved(!saved)}> + {saved ? : } +
+
+
+
{ + console.log(NewLightboxView.ExploreMode) + NewLightboxView.SetExploreMode(!NewLightboxView.ExploreMode) + }}> + + t-SNE 2D Embeddings +
+
+
+} \ No newline at end of file diff --git a/src/client/views/newlightbox/Header/index.ts b/src/client/views/newlightbox/Header/index.ts new file mode 100644 index 000000000..090677c16 --- /dev/null +++ b/src/client/views/newlightbox/Header/index.ts @@ -0,0 +1 @@ +export * from './LightboxHeader' \ No newline at end of file diff --git a/src/client/views/newlightbox/Header/utils.ts b/src/client/views/newlightbox/Header/utils.ts new file mode 100644 index 000000000..22e0487c2 --- /dev/null +++ b/src/client/views/newlightbox/Header/utils.ts @@ -0,0 +1,4 @@ +export interface INewLightboxHeader { + height?: number + width?: number +} \ No newline at end of file -- cgit v1.2.3-70-g09d2