Default sidebar and WIP PluginLoader

This commit is contained in:
2022-02-27 01:17:52 -05:00
parent bf994d896f
commit 761ef80669
23 changed files with 2421 additions and 120 deletions

View File

@@ -1,8 +1,16 @@
import '../styles/globals.css'
import type { AppProps } from 'next/app'
import "../styles/globals.css";
import { Provider } from "react-redux";
import type { AppProps } from "next/app";
import store from "../lib/store";
function MyApp({ Component, pageProps }: AppProps) {
return <Component {...pageProps} />
return (
<Provider store={store}>
<Component {...pageProps} />
</Provider>
);
}
export default MyApp
export default MyApp;

View File

@@ -3,8 +3,11 @@ import Head from "next/head";
import "mapbox-gl/dist/mapbox-gl.css";
import Map from "../components/Map";
import { useAppDispatch } from "../lib/hooks";
import { setPluginsTxt } from "../slices/pluginsTxt";
const Home: NextPage = () => {
const dispatch = useAppDispatch();
return (
<>
<Head>
@@ -53,7 +56,31 @@ const Home: NextPage = () => {
<meta name="twitter:site" content="@tyhallada" />
<meta name="twitter:creator" content="@tyhallada" />
</Head>
<Map />
<div
style={{
margin: 0,
padding: 0,
width: "100%",
height: "100%",
}}
onDragOver={(evt) => {
console.log("drag over!");
evt.preventDefault();
}}
onDrop={async (evt) => {
console.log("drop!");
evt.preventDefault();
if (evt.dataTransfer.items && evt.dataTransfer.items.length > 0) {
const file = evt.dataTransfer.items[0].getAsFile();
if (file) {
dispatch(setPluginsTxt(await file.text()));
}
}
}}
>
<Map />
</div>
</>
);
};