-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
156 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.page { | ||
display: block; | ||
text-align: center; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import Page from "./Page" | ||
|
||
export default Page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
.inner { | ||
outline: 1px solid #ccc; | ||
outline: 1px solid light-dark(#ccc, #666); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.zoom { | ||
background-color: hsla(0, 0%, 83%, 0.49); | ||
color: #3e3e3e; | ||
width: 40%; | ||
position: sticky; | ||
bottom: 1rem; | ||
padding: 0.5rem; | ||
margin: auto; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import {useContext} from "react" | ||
import {useDispatch} from "react-redux" | ||
import {Group} from "@mantine/core" | ||
import {IconZoomIn, IconZoomOut} from "@tabler/icons-react" | ||
import classes from "./Zoom.module.css" | ||
import PanelContext from "@/contexts/PanelContext" | ||
import type {PanelMode} from "@/types" | ||
import { | ||
incZoomFactor, | ||
decZoomFactor, | ||
fitZoomFactor | ||
} from "@/slices/dualPanel/dualPanel" | ||
|
||
export default function Zoom() { | ||
const mode: PanelMode = useContext(PanelContext) | ||
const dispatch = useDispatch() | ||
|
||
const incZoom = () => { | ||
dispatch(incZoomFactor(mode)) | ||
} | ||
const decZoom = () => { | ||
dispatch(decZoomFactor(mode)) | ||
} | ||
|
||
const fitZoom = () => { | ||
dispatch(fitZoomFactor(mode)) | ||
} | ||
|
||
return ( | ||
<Group justify={"center"} className={classes.zoom}> | ||
<IconZoomIn onClick={incZoom} /> | ||
<IconZoomOut onClick={decZoom} /> | ||
<div onClick={fitZoom}>Fit</div> | ||
</Group> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import Zoom from "./Zoom" | ||
|
||
export default Zoom |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters