-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improve splash screen and notification service
- Loading branch information
Showing
20 changed files
with
137 additions
and
185 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,25 +4,22 @@ import { User } from "@/components/user"; | |
import { checkForAppUpdates } from "@lume/utils"; | ||
import { Link } from "@tanstack/react-router"; | ||
import { createFileRoute, redirect } from "@tanstack/react-router"; | ||
import { invoke } from "@tauri-apps/api/core"; | ||
import { useState } from "react"; | ||
import { toast } from "sonner"; | ||
import { NostrAccount } from "@lume/system"; | ||
|
||
export const Route = createFileRoute("/")({ | ||
beforeLoad: async () => { | ||
await checkForAppUpdates(true); // check for app updates | ||
const accounts = await NostrAccount.getAccounts(); | ||
|
||
if (accounts.length < 1) { | ||
throw redirect({ | ||
to: "/landing/", | ||
to: "/landing", | ||
replace: true, | ||
}); | ||
} | ||
|
||
await checkForAppUpdates(true); // check for app updates | ||
await invoke("run_notification", { accounts }); // Run notification service | ||
|
||
return { accounts }; | ||
}, | ||
component: Screen, | ||
|
@@ -65,14 +62,16 @@ function Screen() { | |
return ( | ||
<div className="relative flex h-full w-full items-center justify-center"> | ||
<div className="relative z-20 flex flex-col items-center gap-16"> | ||
<div className="text-center text-white"> | ||
<h2 className="mb-1 text-2xl">{currentDate}</h2> | ||
<div className="text-center"> | ||
<h2 className="text-xl text-neutral-700 dark:text-neutral-300"> | ||
{currentDate} | ||
</h2> | ||
<h2 className="text-2xl font-semibold">Welcome back!</h2> | ||
</div> | ||
<div className="flex flex-wrap px-3 items-center justify-center gap-6"> | ||
{loading ? ( | ||
<div className="inline-flex size-6 items-center justify-center"> | ||
<Spinner className="size-6 text-white" /> | ||
<Spinner className="size-6" /> | ||
</div> | ||
) : ( | ||
<> | ||
|
@@ -83,42 +82,25 @@ function Screen() { | |
onClick={() => select(account)} | ||
> | ||
<User.Provider pubkey={account}> | ||
<User.Root className="flex h-36 w-32 flex-col items-center justify-center gap-4 rounded-2xl p-2 hover:bg-white/10 dark:hover:bg-black/10"> | ||
<User.Root className="flex h-36 w-32 flex-col items-center justify-center gap-3 rounded-2xl p-2 hover:bg-black/10 dark:hover:bg-white/10"> | ||
<User.Avatar className="size-20 rounded-full object-cover" /> | ||
<User.Name className="max-w-[5rem] truncate text-lg font-medium leading-tight text-white" /> | ||
<User.Name className="max-w-[6rem] truncate font-medium leading-tight" /> | ||
</User.Root> | ||
</User.Provider> | ||
</button> | ||
))} | ||
<Link to="/landing/"> | ||
<div className="flex h-36 w-32 flex-col items-center justify-center gap-4 rounded-2xl p-2 text-white hover:bg-white/10 dark:hover:bg-black/10"> | ||
<div className="flex size-20 items-center justify-center rounded-full bg-white/20 dark:bg-black/20"> | ||
<Link to="/landing"> | ||
<div className="flex h-36 w-32 flex-col items-center justify-center gap-3 rounded-2xl p-2 hover:bg-black/10 dark:hover:bg-white/10"> | ||
<div className="flex size-20 items-center justify-center rounded-full bg-black/5 dark:bg-white/5"> | ||
<PlusIcon className="size-8" /> | ||
</div> | ||
<p className="text-lg font-medium leading-tight">Add</p> | ||
<p className="font-medium leading-tight">Add</p> | ||
</div> | ||
</Link> | ||
</> | ||
)} | ||
</div> | ||
</div> | ||
<div className="absolute z-10 h-full w-full bg-white/10 backdrop-blur-lg dark:bg-black/10" /> | ||
<div className="absolute inset-0 h-full w-full"> | ||
<img | ||
src="/lock-screen.jpg" | ||
srcSet="/[email protected] 2x" | ||
alt="Lock Screen Background" | ||
className="h-full w-full object-cover" | ||
/> | ||
<a | ||
href="https://njump.me/nprofile1qqs9tuz9jpn57djg7nxunhyvuvk69g5zqaxdpvpqt9hwqv7395u9rpg6zq5uw" | ||
target="_blank" | ||
className="absolute bottom-3 right-3 z-50 rounded-md bg-white/20 px-2 py-1 text-xs font-medium text-white dark:bg-black/20" | ||
rel="noreferrer" | ||
> | ||
Design by NoGood | ||
</a> | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import { KeyIcon, RemoteIcon } from "@lume/icons"; | ||
import { Link, createLazyFileRoute } from "@tanstack/react-router"; | ||
|
||
export const Route = createLazyFileRoute("/landing")({ | ||
component: Screen, | ||
}); | ||
|
||
function Screen() { | ||
return ( | ||
<div | ||
data-tauri-drag-region | ||
className="flex flex-col justify-center items-center h-screen w-screen" | ||
> | ||
<div className="mx-auto max-w-xs lg:max-w-md w-full"> | ||
<div className="flex w-full flex-col gap-2 bg-white rounded-xl shadow-primary backdrop-blur-lg dark:bg-white/20 dark:ring-1 ring-neutral-800/50 px-2"> | ||
<div className="h-20 flex items-center border-b border-neutral-100 dark:border-white/5"> | ||
<Link | ||
to="/auth/new/profile" | ||
className="h-14 w-full flex items-center justify-center gap-2 hover:bg-neutral-100 dark:hover:bg-white/10 rounded-lg px-2" | ||
> | ||
<div className="size-9 shrink-0 rounded-full inline-flex items-center justify-center"> | ||
<img | ||
src="/icon.jpeg" | ||
alt="App Icon" | ||
className="size-9 object-cover rounded-full" | ||
/> | ||
</div> | ||
<div className="flex-1 inline-flex flex-col"> | ||
<span className="leading-tight font-semibold"> | ||
Create new account | ||
</span> | ||
<span className="leading-tight text-sm text-neutral-500"> | ||
Use everywhere | ||
</span> | ||
</div> | ||
</Link> | ||
</div> | ||
<div className="flex flex-col gap-1 pb-2.5"> | ||
<Link | ||
to="/auth/privkey" | ||
className="inline-flex h-11 w-full items-center gap-2 rounded-lg px-2 hover:bg-neutral-100 dark:hover:bg-white/10" | ||
> | ||
<div className="size-9 inline-flex items-center justify-center"> | ||
<KeyIcon className="size-5 text-neutral-600 dark:text-neutral-400" /> | ||
</div> | ||
Login with Private Key | ||
</Link> | ||
<Link | ||
to="/auth/remote" | ||
className="inline-flex h-11 w-full items-center gap-2 rounded-lg px-2 hover:bg-neutral-100 dark:hover:bg-white/10" | ||
> | ||
<div className="size-9 inline-flex items-center justify-center"> | ||
<RemoteIcon className="size-5 text-neutral-600 dark:text-neutral-400" /> | ||
</div> | ||
Nostr Connect | ||
</Link> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.