Skip to content

Commit

Permalink
show hide thumbnails
Browse files Browse the repository at this point in the history
  • Loading branch information
ciur committed Aug 10, 2024
1 parent 50bcf0d commit bf9695d
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 2 deletions.
1 change: 0 additions & 1 deletion ui2/src/components/Viewer/Pages.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@
padding: 1rem 1rem 0rem 1rem;
width: 600px;
}
margin-left: 1rem;
}
2 changes: 2 additions & 0 deletions ui2/src/components/Viewer/Thumbnails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import PanelContext from "@/contexts/PanelContext"
import type {PanelMode} from "@/types"
import {RootState} from "@/app/types"
import Thumbnail from "./Thumbnail"
import ThumbnailsToggle from "./ThumbnailsToggle"
import classes from "./Thumbnails.module.css"

export default function Thumbnails() {
Expand All @@ -22,6 +23,7 @@ export default function Thumbnails() {
return (
<Stack className={classes.thumbnails} justify="flex-start">
{thumbnails}
<ThumbnailsToggle />
</Stack>
)
}
4 changes: 4 additions & 0 deletions ui2/src/components/Viewer/ThumbnailsToggle.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.thumbnailsToggle {
background-color: #666;
color: white;
}
17 changes: 17 additions & 0 deletions ui2/src/components/Viewer/ThumbnailsToggle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import {UnstyledButton, Flex} from "@mantine/core"
import {IconMenu2} from "@tabler/icons-react"
import classes from "./ThumbnailsToggle.module.css"

export default function ThumbnailsToggle() {
const onClick = () => {
console.log("Thumbnails toggled")
}

return (
<Flex align-items={"flex-start"} className={classes.thumbnailsToggle}>
<UnstyledButton onClick={() => onClick()}>
<IconMenu2 />
</UnstyledButton>
</Flex>
)
}
3 changes: 3 additions & 0 deletions ui2/src/components/Viewer/Viewer.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.inner {
outline: 1px solid #ccc;
}
5 changes: 4 additions & 1 deletion ui2/src/components/Viewer/Viewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ import Breadcrumbs from "@/components/Breadcrumbs"
import PanelContext from "@/contexts/PanelContext"
import {selectContentHeight} from "@/slices/sizes"
import ActionButtons from "./ActionButtons"
import ThumbnailsToggle from "./ThumbnailsToggle"
import Pages from "./Pages"
import Thumbnails from "./Thumbnails"
import classes from "./Viewer.module.css"

export default function Viewer() {
const mode: PanelMode = useContext(PanelContext)
Expand Down Expand Up @@ -52,8 +54,9 @@ export default function Viewer() {
<div>
<ActionButtons />
<Breadcrumbs onClick={onClick} />
<Flex style={{height: `${height}px`}}>
<Flex className={classes.inner} style={{height: `${height}px`}}>
<Thumbnails />
<ThumbnailsToggle />
<Pages />
</Flex>
</div>
Expand Down

0 comments on commit bf9695d

Please sign in to comment.