-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathApp.tsx
More file actions
45 lines (40 loc) · 1.59 KB
/
App.tsx
File metadata and controls
45 lines (40 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Pic Display - A cute image viewer ❤ *
* Copyright © 2026 Moebytes <moebytes.com> *
* Licensed under CC BY-NC 4.0. See license.txt for details. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
import "bootstrap/dist/css/bootstrap.min.css"
import "react-image-crop/dist/ReactCrop.css"
import React, {useEffect} from "react"
import {createRoot} from "react-dom/client"
import {Provider} from "react-redux"
import store, {useActiveActions} from "./store"
import TitleBar from "./components/TitleBar"
import PhotoViewer from "./components/PhotoViewer"
import LinkDialog from "./components/LinkDialog"
import InfoDialog from "./components/InfoDialog"
import ContextMenu from "./components/ContextMenu"
import LocalStorage from "./LocalStorage"
import "./index.less"
const App = () => {
const {setHover} = useActiveActions()
useEffect(() => {
const preventPaste = (event: ClipboardEvent) => event.preventDefault()
document.addEventListener("paste", preventPaste)
return () => {
document.removeEventListener("paste", preventPaste)
}
}, [])
return (
<main className="app" onMouseEnter={() => setHover(true)} onMouseLeave={() => setHover(false)}>
<TitleBar/>
<ContextMenu/>
<LocalStorage/>
<LinkDialog/>
<InfoDialog/>
<PhotoViewer/>
</main>
)
}
const root = createRoot(document.getElementById("root")!)
root.render(<Provider store={store}><App/></Provider>)