Skip to content

Commit

Permalink
fix: update filename logic and add branding
Browse files Browse the repository at this point in the history
  • Loading branch information
Selvio committed Aug 27, 2024
1 parent 555b1e1 commit d571f40
Show file tree
Hide file tree
Showing 4 changed files with 3,999 additions and 4 deletions.
24 changes: 21 additions & 3 deletions src-ui/App.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
import { ChangeEventHandler, useState } from "react";
import { ChangeEventHandler, useMemo, useState } from "react";
import Debugger from "./components/Debugger";
import FilePicker from "./components/FilePicker";
import cx from "classnames";
import gastronomyLogo from "./assets/images/gastronomy-logo.svg";
import sundaeLogo from "./assets/images/sundae-logo.svg";

function App() {
const [displayDebugger, setDisplayDebugger] = useState(false);
const [parameters, setParameters] = useState<string[]>([]);
const [file, setFile] = useState("");
const fileName = file.substring(Math.max(file.lastIndexOf("/"), file.lastIndexOf("\\")) + 1);

const fileName = useMemo(() => {
const parts = file.split(/[/\\]/);
return parts[parts.length - 1];
}, [file]);

console.log("file", file);

const handleChange: ChangeEventHandler<HTMLTextAreaElement> = (event) => {
setParameters(event.target.value.split("\n"));
Expand All @@ -30,7 +38,10 @@ function App() {
/>
) : (
<div className="p-4 flex justify-center items-center h-full flex-col gap-11">
<h1 className="text-6xl uppercase font-['Pixelify_Sans']">Gastronomy</h1>
<h1 className="text-6xl uppercase font-['Pixelify_Sans'] flex gap-2 items-center">
<img src={gastronomyLogo} alt="Gastronomy" className="h-16" />
Gastronomy
</h1>
<div className="border border-lime-600 p-6 flex flex-col gap-6 w-[30rem]">
<FilePicker setFile={setFile} fileName={fileName} />
<div className="flex flex-col gap-4">
Expand Down Expand Up @@ -58,6 +69,13 @@ function App() {
Run Debugger
</button>
</div>
<div className="flex items-center gap-2">
<div>Created by </div>
<div className="text-xl font-['Pixelify_Sans'] flex gap-2 items-center text-white">
<img src={sundaeLogo} alt="Gastronomy" className="h-8" />
Sundae Labs
</div>
</div>
</div>
)}
</div>
Expand Down
Loading

0 comments on commit d571f40

Please sign in to comment.