@@ -2,61 +2,39 @@ import "bootstrap-italia/dist/css/bootstrap-italia.min.css";
22import { NotificationManager } from "design-react-kit" ;
33import { useState } from "react" ;
44import { useTranslation } from "react-i18next" ;
5- import { Provider } from "react-redux" ;
65import { Panel , PanelGroup , PanelResizeHandle } from "react-resizable-panels" ;
76import "react-widgets/styles.css" ;
87import "../assets/main.css" ;
98import Editor from "./components/Editor" ;
109import Head from "./components/Head" ;
1110import Layout from "./components/Layout" ;
12- import WarningBox , { Warning } from "./components/WarningBox" ;
13- import YamlPreview from "./components/YamlPreview" ;
14- import PublicCode , {
15- PublicCodeWithDeprecatedFields ,
16- } from "./contents/publiccode" ;
17- import { getYaml , useIsMobile } from "./lib/utils" ;
18- import store from "./store" ;
1911import SettingsPanel from "./components/SettingsPanel" ;
12+ import WarningBox from "./components/WarningBox" ;
13+ import YamlPreview from "./components/YamlPreview" ;
14+ import { useIsMobile } from "./lib/utils" ;
2015
2116const NOTIFICATION_TIMEOUT = 4_000 ;
2217export const App = ( ) => {
2318 const isMobile = useIsMobile ( ) ;
2419 const [ isSettingsOpen , setIsSettingsOpen ] = useState ( false ) ;
2520 const [ isLoading ] = useState ( false ) ;
26- const [ isPublicCodeImported , setPublicCodeImported ] = useState ( false ) ;
27- const [ warnings , setWarnings ] = useState < Warning [ ] > ( [ ] ) ;
28- const [ publicCodeData , setPublicCodeData ] = useState <
29- PublicCode | PublicCodeWithDeprecatedFields | undefined
30- > ( ) ;
3121 const { t } = useTranslation ( ) ;
3222
3323 const leftPanel = (
3424 < div className = "content__wrapper" >
35- < Editor
36- setData = { ( d ) => {
37- setPublicCodeData ( d ) ;
38- } }
39- setWarnings = { setWarnings }
40- setPublicCodeImported = { setPublicCodeImported }
41- isPublicCodeImported = { isPublicCodeImported }
42- />
25+ < Editor />
4326 </ div >
4427 ) ;
4528
4629 const rightPanel = (
4730 < div className = "content__sidebar" id = "content-sidebar" >
48- { warnings ?. length > 0 && (
49- < WarningBox
50- warnings = { warnings }
51- setWarnings = { ( items ) => setWarnings ( items as Warning [ ] ) }
52- />
53- ) }
54- < YamlPreview yaml = { getYaml ( publicCodeData as PublicCode ) as string } />
31+ < WarningBox />
32+ < YamlPreview />
5533 </ div >
5634 ) ;
5735
5836 return (
59- < Provider store = { store } >
37+ < div >
6038 { isLoading && (
6139 < div className = "d-flex align-items-center col-12 position-absolute h-100 w-100" >
6240 < div className = "mr-auto ml-auto" >
@@ -100,7 +78,7 @@ export const App = () => {
10078 </ div >
10179 </ div >
10280 </ Layout >
103- </ Provider >
81+ </ div >
10482 ) ;
10583} ;
10684
0 commit comments