Skip to content

Commit

Permalink
feat: add toast to report on success
Browse files Browse the repository at this point in the history
  • Loading branch information
trobonox committed Aug 14, 2023
1 parent aa8d6b0 commit e929126
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 2 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
"@supabase/supabase-js": "^2.32.0",
"@unocss/reset": "^0.54.2",
"solid-js": "^1.7.11",
"solid-start": "^0.2.30"
"solid-start": "^0.2.30",
"solid-toast": "^0.5.0"
},
"engines": {
"node": ">=16"
Expand Down
11 changes: 11 additions & 0 deletions pnpm-lock.yaml

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

2 changes: 2 additions & 0 deletions src/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
import FullscreenLoader, { FullscreenLoaderEntry } from "@/components/FullscreenLoader";
import { getProfileWithSession, supabase } from "@/supabase/client";
import { setAuth } from "@/stores/auth";
import { Toaster } from "solid-toast";

export default function Root() {
onMount(async () => {
Expand Down Expand Up @@ -55,6 +56,7 @@ export default function Root() {
<Meta name="theme-color" content="#ffffff" />
</Head>
<Body class="h-full min-h-screen bg-crust bg-[url(https://source.unsplash.com/collection/175083)] bg-cover bg-center bg-no-repeat font-sans">
<Toaster/>
<FullscreenLoaderEntry />

<Suspense fallback={
Expand Down
2 changes: 2 additions & 0 deletions src/routes/account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { auth, setAuth } from "@/stores/auth";

import Header from "@/components/landing/Header";
import FullscreenLoader from "@/components/FullscreenLoader";
import toast from "solid-toast";

export default function Account() {
const [username, setUsername] = createSignal(auth.profile?.username ?? "");
Expand Down Expand Up @@ -38,6 +39,7 @@ export default function Account() {

const json = await response.json();
setAuth("profile", json.data);
toast.success("Updated your account data.");
};

return (
Expand Down
2 changes: 1 addition & 1 deletion src/routes/dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const Layout: Component = () => {
}}
>
<input type="text"
class="mb-3 rounded-md px-3 py-2 text-text outline-none"
class="mb-3 rounded-md px-3 py-2 text-text bg-base outline-none placeholder-text-subtext1"
placeholder="Enter a name for your folder..."
value={newFolderName()}
onInput={event => setNewFolderName(event.target.value)}
Expand Down

0 comments on commit e929126

Please sign in to comment.