Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update filename logic and add branding #11

Merged
merged 1 commit into from
Aug 27, 2024
Merged
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
22 changes: 19 additions & 3 deletions src-ui/App.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
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]);

const handleChange: ChangeEventHandler<HTMLTextAreaElement> = (event) => {
setParameters(event.target.value.split("\n"));
Expand All @@ -30,7 +36,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 +67,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