Skip to content

Commit

Permalink
Merge pull request #20 from signorecello/styling
Browse files Browse the repository at this point in the history
feat: adding some styling suggestions and a favicon :)
  • Loading branch information
signorecello authored Dec 5, 2023
2 parents 751ee3d + 1954873 commit 8b6305d
Show file tree
Hide file tree
Showing 7 changed files with 718 additions and 38 deletions.
Binary file modified .yarn/install-state.gz
Binary file not shown.
47 changes: 23 additions & 24 deletions packages/playground/src/components/actionsBox/actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,24 +52,29 @@ export const ActionsBox = ({

const submit = async (e: FormEvent) => {
e.preventDefault();
setPending(true);
const compileTO = new Promise((resolve, reject) =>
setTimeout(async () => {
try {
setPending(false);
await compile(code);
resolve(code);
} catch (err) {
reject(err);
}
}, 100)
);

await toast.promise(compileTO, {
pending: "Compiling...",
success: "Compiled!",
error: "Error compiling",
});
if (!compiledCode) {
setPending(true);
const compileTO = new Promise((resolve, reject) =>
setTimeout(async () => {
try {
setPending(false);
await compile(code);
resolve(code);
} catch (err) {
reject(err);
}
}, 100)
);

await toast.promise(compileTO, {
pending: "Compiling...",
success: "Compiled!",
error: "Error compiling",
});
} else {
await prove(e);
}
};

const prove = async (e: FormEvent) => {
Expand Down Expand Up @@ -116,7 +121,6 @@ export const ActionsBox = ({
Inputs
</h3>
<form
onSubmit={(e) => prove(e)}
className="flex-col mt-5 sm:flex sm:items-center"
id="inputs-container"
>
Expand All @@ -130,11 +134,6 @@ export const ActionsBox = ({
handleInput={handleInput}
/>
</div>
<ButtonContainer>
<Button type="submit" disabled={pending} $primary={true}>
📜 Prove
</Button>
</ButtonContainer>
</form>
</div>
)}
Expand All @@ -145,7 +144,7 @@ export const ActionsBox = ({
<input type="text" style={{ display: "none" }} />
<ButtonContainer>
<Button type="submit" disabled={pending} $primary={true}>
🔄 Compile
{compiledCode ? "📜 Prove" : "🔄 Compile"}
</Button>
<Button
onClick={(e: FormEvent) => share(e)}
Expand Down
2 changes: 1 addition & 1 deletion packages/website/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
<title>Noir Playground</title>
</head>
<body class="min-h-screen bg-purple-1 font-nunito flex flex-col">
<div id="root" class="flex-grow flex justify-center"></div>
Expand Down
3 changes: 2 additions & 1 deletion packages/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"devDependencies": {
"@types/react-dom": "^18.2.16",
"eslint": "^8.54.0",
"tailwindcss": "^3.3.5"
"tailwindcss": "^3.3.5",
"vite-plugin-favicons-inject": "^2.2.0"
}
}
247 changes: 247 additions & 0 deletions packages/website/public/noir_logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 3 additions & 8 deletions packages/website/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";

import vitePluginFaviconsInject from "vite-plugin-favicons-inject";

export default defineConfig({
build: {
lib: {
entry: "index.html",
formats: ["cjs", "es"],
fileName: "index",
},
},
plugins: [react()],
plugins: [react(), vitePluginFaviconsInject("./public/noir_logo.svg")],
define: {
"process.env": process.env,
},
Expand Down
Loading

0 comments on commit 8b6305d

Please sign in to comment.