Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"pyatch-vm": "^1.2.9",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-draggable": "^4.4.6",
"react-firebase-hooks": "^5.1.1",
"react-split-pane": "^2.0.3",
"react-split-pane-next": "^1.0.5",
Expand Down
8 changes: 7 additions & 1 deletion src/components/App/component.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import React from "react";
import { useState, useEffect } from "react";
import SpritePane from "../SpritePane";
import { Button, Grid, Tooltip } from "@mui/material";
import { Backdrop, Button, Grid, Tooltip } from "@mui/material";
import "./style.css";
import { TopBar } from "../TopBar";
import { EditorPane, EditorTabButton } from "../EditorPane";
import { VerticalButtons } from "../PatchButton";
import { ThemeProvider } from "@emotion/react";
import { Tutorial } from "../Tutorial"

import darkTheme from "../../themes/dark";
import lightTheme from "../../themes/light";
Expand Down Expand Up @@ -40,6 +41,7 @@ import { LegalDialogueButton } from "./LegalDialogueButton";
import PatchFunctionJson from "../../assets/patch-api.json";

import Popover from "@mui/material/Popover";
import { useUser } from "../../hooks/useUser";

interface Parameter {
[key: string]: string;
Expand All @@ -59,6 +61,7 @@ const App = () => {
const patchVM = usePatchStore((state) => state.patchVM);
const saveTargetThreads = usePatchStore((state) => state.saveTargetThreads);
const editorTab = usePatchStore((state) => state.editorTab);
const [newUser, setNewUser] = React.useState(true);

// Popover state
const [anchorEl, setAnchorEl] = React.useState<HTMLButtonElement | null>(
Expand Down Expand Up @@ -98,6 +101,8 @@ const App = () => {

const open = Boolean(anchorEl);
const id = open ? "simple-popover" : undefined;
const userData = useUser();
console.log(userData.userMeta);

return (
<ThemeProvider theme={mode === "dark" ? darkTheme : lightTheme}>
Expand Down Expand Up @@ -229,6 +234,7 @@ const App = () => {
<SpritePane />
</Grid>
</Grid>
{(usePatchStore((state) => state.patchReady) && (userData.user == null || userData.userMeta?.newUser)) ? <Tutorial/> : <></>}
</SplashScreen>
</ThemeProvider>

Expand Down
1 change: 1 addition & 0 deletions src/components/TopBar/SignUpButton/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const SignUpButton = () => {
projects: [],
username: username,
role: "user",
newUser: true
};
const response = setDoc(reference, data, {merge: true, mergeFields: ["projects"]});
setProjectId("new");
Expand Down
Loading