@@ -10,7 +10,7 @@ import {
1010 POKER_SETTINGS_STATE ,
1111 SETTINGS_STATE ,
1212} from "@/Root" ;
13- import { AppShell , Container , Divider , Modal , Text , useMantineTheme } from "@mantine/core" ;
13+ import { AppShell , Container , Divider , Modal , Text , Title , useMantineTheme } from "@mantine/core" ;
1414import { useEffect , useState } from "react" ;
1515import { atom , useRecoilState } from "recoil" ;
1616import { TAURI_STORE } from "./Root" ;
@@ -27,6 +27,8 @@ import { useHotkeys } from "react-hotkeys-hook";
2727import { notifications } from "@mantine/notifications" ;
2828import TouchscreenMenu from "./components/TouchscreenMenu" ;
2929import ChipBreakdown , { CHIP_BREAKDOWN_OPEN } from "./components/ChipBreakdown" ;
30+ import { useLocalStorage } from "@mantine/hooks" ;
31+ import { modals } from "@mantine/modals" ;
3032
3133export const HOTKEY_SELECTOR_A_ENABLED = atom ( {
3234 key : "hotkeySelectorA" ,
@@ -65,6 +67,61 @@ export default function App() {
6567 const [ chips ] = useRecoilState ( CHIPS_STATE ) ;
6668 const [ chipsLastSaved , setChipsLastSaved ] = useState ( 0 ) ;
6769
70+ const [ firstTime , setFirstTime ] = useLocalStorage ( {
71+ key : "first-time" ,
72+ defaultValue : true ,
73+ } ) ;
74+
75+ if ( firstTime ) {
76+ modals . openConfirmModal ( {
77+ title : "Notice" ,
78+ size : "xl" ,
79+ children : (
80+ < >
81+ < Title order = { 3 } > License</ Title >
82+ < Text >
83+ Card Games Manager is NOT free software. All rights reserved. This project is not open
84+ source. You may not use, modify, or distribute this project without explicit permission
85+ from the creator. Licenses may be purchased for commercial uses. Please contact the
86+ creator for more information.
87+ </ Text >
88+ < Title mt = "sm" order = { 3 } >
89+ Disclaimer
90+ </ Title >
91+ < Text >
92+ This tool is intended for entertainment purposes only and does not endorse or promote
93+ gambling. The use of this tool for gambling, especially where money is involved, is
94+ strictly prohibited and may be illegal in certain jurisdictions. The creators of this
95+ tool are not responsible for any misuse or illegal activities associated with its use.
96+ Please use this tool responsibly and in accordance with applicable laws and regulations.
97+ Additionally, this tool should not be the single source of truth for any card games. It
98+ is recommended to use physical cards or other trusted sources to verify the results of
99+ any games played with this tool. Any random number generation in this tool is not
100+ guaranteed to be truly random and should not be used for any serious or high-stakes
101+ games. This tool is provided as-is and without any warranty. The creators of this tool
102+ are not responsible for any damages or losses incurred from the use of this tool.
103+ </ Text >
104+ < Divider my = "sm" />
105+ < Text >
106+ By clicking "I agree" you acknowledge that you have read and agree to the terms and
107+ conditions outlined in the license and disclaimer above. If you do not agree to these
108+ terms, please close this window and do not use this tool. If you have previously agreed,
109+ you can not revoke your agreement. To view this notice again, scroll to the buttom of
110+ the Settings page. You can email the creator at auro@mrauro.dev
111+ </ Text >
112+ </ >
113+ ) ,
114+ labels : { confirm : "I Agree" , cancel : "I Disagree" } ,
115+ onConfirm : ( ) => {
116+ setFirstTime ( false ) ;
117+ modals . closeAll ( ) ;
118+ } ,
119+ onCancel : async ( ) => {
120+ window . close ( ) ;
121+ } ,
122+ } ) ;
123+ }
124+
68125 const [ chipBreakdownOpen , setChipBreakdownOpen ] = useRecoilState ( CHIP_BREAKDOWN_OPEN ) ;
69126
70127 const [ hotkeySelectorAEnabled , setHotkeySelectorAEnabled ] =
@@ -300,52 +357,54 @@ export default function App() {
300357 }
301358 }
302359
303- return (
304- < >
305- < Modal
306- title = "Chip Breakdown"
307- opened = { chipBreakdownOpen }
308- onClose = { ( ) => setChipBreakdownOpen ( false ) }
309- >
310- < ChipBreakdown />
311- </ Modal >
312- < AppShell
313- aside = { {
314- width : asideWidth ,
315- breakpoint : 0 ,
316- } }
317- navbar = { {
318- width : navbarWidth ,
319- breakpoint : 0 ,
320- } }
321- >
322- < AppShell . Main >
323- < Header
324- active = { settings . activeTab }
325- setActive = { ( tab ) => {
326- setSettings ( { ...settings , activeTab : tab } ) ;
327- } }
328- />
329- < Divider my = "xs" />
330- { settings . debug ? (
331- < >
332- < DevTools />
333- < Divider my = "xs" />
334- </ >
335- ) : null }
336- < Container > { content } </ Container >
337- </ AppShell . Main >
338- { settings ?. touchscreenMenu &&
339- ( settings ?. touchscreenMenuPosition == "left" ? (
340- < AppShell . Navbar >
341- < TouchscreenMenu />
342- </ AppShell . Navbar >
343- ) : (
344- < AppShell . Aside >
345- < TouchscreenMenu />
346- </ AppShell . Aside >
347- ) ) }
348- </ AppShell >
349- </ >
350- ) ;
360+ if ( firstTime ) return null ;
361+ else
362+ return (
363+ < >
364+ < Modal
365+ title = "Chip Breakdown"
366+ opened = { chipBreakdownOpen }
367+ onClose = { ( ) => setChipBreakdownOpen ( false ) }
368+ >
369+ < ChipBreakdown />
370+ </ Modal >
371+ < AppShell
372+ aside = { {
373+ width : asideWidth ,
374+ breakpoint : 0 ,
375+ } }
376+ navbar = { {
377+ width : navbarWidth ,
378+ breakpoint : 0 ,
379+ } }
380+ >
381+ < AppShell . Main >
382+ < Header
383+ active = { settings . activeTab }
384+ setActive = { ( tab ) => {
385+ setSettings ( { ...settings , activeTab : tab } ) ;
386+ } }
387+ />
388+ < Divider my = "xs" />
389+ { settings . debug ? (
390+ < >
391+ < DevTools />
392+ < Divider my = "xs" />
393+ </ >
394+ ) : null }
395+ < Container > { content } </ Container >
396+ </ AppShell . Main >
397+ { settings ?. touchscreenMenu &&
398+ ( settings ?. touchscreenMenuPosition == "left" ? (
399+ < AppShell . Navbar >
400+ < TouchscreenMenu />
401+ </ AppShell . Navbar >
402+ ) : (
403+ < AppShell . Aside >
404+ < TouchscreenMenu />
405+ </ AppShell . Aside >
406+ ) ) }
407+ </ AppShell >
408+ </ >
409+ ) ;
351410}
0 commit comments