11// import Update from '@/components/update'
2- import React , { useContext , useEffect } from ' react' ;
3- import Workshop from ' ./pages/Workshop' ;
4- import UIPage from ' ./pages/UIPage' ;
5- import { useUserComp } from ' ./hooks/useContextHooks' ;
6- import ' ./App.scss' ;
7- import FileExplorer from ' ./components/FileExplorer/FileExplorer' ;
8- import { ShowUIContext } from ' ./components/context/ShowUIContext' ;
9- import { motion } from ' framer-motion' ;
10- import path from ' path' ;
11- import fs from 'fs' ;
12- import { PayloadType , UserActionType } from ' ./components/context/ContextTypes' ;
13- const os = require ( 'os' ) ;
2+ import React , { useContext , useEffect } from " react" ;
3+ import Workshop from " ./pages/Workshop" ;
4+ import UIPage from " ./pages/UIPage" ;
5+ import { useUserComp } from " ./hooks/useContextHooks" ;
6+ import " ./App.scss" ;
7+ import FileExplorer from " ./components/FileExplorer/FileExplorer" ;
8+ import { ShowUIContext } from " ./components/context/ShowUIContext" ;
9+ import { motion } from " framer-motion" ;
10+ import path from " path" ;
11+ import fs from "fs" ;
12+ import { PayloadType , UserActionType } from " ./components/context/ContextTypes" ;
13+ const os = require ( "os" ) ;
1414
1515const pageVariants = {
1616 initial : {
1717 opacity : 0 ,
1818 y : 5 ,
19- scale : 0.9
19+ scale : 0.9 ,
2020 } ,
2121 animate : {
2222 opacity : 1 ,
@@ -26,39 +26,37 @@ const pageVariants = {
2626 type : "spring" ,
2727 stiffness : 800 ,
2828 damping : 100 ,
29- duration : 1
30- }
29+ duration : 1 ,
30+ } ,
3131 } ,
3232 exit : {
3333 opacity : 0 ,
3434 y : - 100 ,
3535 scale : 1.2 ,
3636 transition : {
37- duration : 1
38- }
39- }
37+ duration : 1 ,
38+ } ,
39+ } ,
4040} ;
4141
4242function App ( ) {
4343 // for more info on useContext with typescript: https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/context
44- const contextVal = useContext ( ShowUIContext ) ?? { showUI : [ null , null ] }
45- const [ showUIVal , setShowUIVal ] = contextVal . showUI
44+ const contextVal = useContext ( ShowUIContext ) ?? { showUI : [ null , null ] } ;
45+ const [ showUIVal , setShowUIVal ] = contextVal . showUI ;
4646 const { components, dispatch } = useUserComp ( ) ;
4747
48-
4948 useEffect ( ( ) => {
50- const filePath = path . join ( os . homedir ( ) , ' AthenaData123.json' ) ;
49+ const filePath = path . join ( os . homedir ( ) , " AthenaData123.json" ) ;
5150
5251 // Read the file's contents
53- fs . readFile ( filePath , ' utf8' , ( err , data ) => {
52+ fs . readFile ( filePath , " utf8" , ( err , data ) => {
5453 if ( err ) {
5554 console . error ( `Error reading file: ${ err . message } ` ) ;
5655 } else {
5756 // Parse the JSON data
5857 const jsonData = JSON . parse ( data ) ;
59- console . log ( jsonData ) ;
6058 // Set user components
61- dispatch ( { type : ' SET_COMPS' , payload : jsonData } ) ;
59+ dispatch ( { type : " SET_COMPS" , payload : jsonData } ) ;
6260 }
6361 } ) ;
6462 } , [ ] ) ;
@@ -71,28 +69,26 @@ function App() {
7169 initial = "initial"
7270 animate = "animate"
7371 exit = "exit"
74- className = ' App'
72+ className = " App"
7573 >
7674 < UIPage />
7775 </ motion . div >
78- )
79- }
80-
81- else {
76+ ) ;
77+ } else {
8278 return (
8379 < motion . div
8480 key = { 2 }
8581 variants = { pageVariants }
8682 initial = "initial"
8783 animate = "animate"
8884 exit = "exit"
89- className = ' App'
85+ className = " App"
9086 >
9187 < FileExplorer />
9288 < Workshop />
9389 </ motion . div >
94- )
90+ ) ;
9591 }
9692}
9793
98- export default App
94+ export default App ;
0 commit comments