@@ -10,7 +10,7 @@ import {
10
10
POKER_SETTINGS_STATE ,
11
11
SETTINGS_STATE ,
12
12
} 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" ;
14
14
import { useEffect , useState } from "react" ;
15
15
import { atom , useRecoilState } from "recoil" ;
16
16
import { TAURI_STORE } from "./Root" ;
@@ -27,6 +27,8 @@ import { useHotkeys } from "react-hotkeys-hook";
27
27
import { notifications } from "@mantine/notifications" ;
28
28
import TouchscreenMenu from "./components/TouchscreenMenu" ;
29
29
import ChipBreakdown , { CHIP_BREAKDOWN_OPEN } from "./components/ChipBreakdown" ;
30
+ import { useLocalStorage } from "@mantine/hooks" ;
31
+ import { modals } from "@mantine/modals" ;
30
32
31
33
export const HOTKEY_SELECTOR_A_ENABLED = atom ( {
32
34
key : "hotkeySelectorA" ,
@@ -65,6 +67,61 @@ export default function App() {
65
67
const [ chips ] = useRecoilState ( CHIPS_STATE ) ;
66
68
const [ chipsLastSaved , setChipsLastSaved ] = useState ( 0 ) ;
67
69
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
+
68
125
const [ chipBreakdownOpen , setChipBreakdownOpen ] = useRecoilState ( CHIP_BREAKDOWN_OPEN ) ;
69
126
70
127
const [ hotkeySelectorAEnabled , setHotkeySelectorAEnabled ] =
@@ -300,52 +357,54 @@ export default function App() {
300
357
}
301
358
}
302
359
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
+ ) ;
351
410
}
0 commit comments