Skip to content

Commit

Permalink
"standard"ify some pages
Browse files Browse the repository at this point in the history
  • Loading branch information
KaffinPX committed Jan 23, 2024
1 parent a1d57af commit 0dcc735
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
20 changes: 8 additions & 12 deletions src/pages/CreateWallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,23 @@ export enum Tabs {
Success
}

export default function CreateWallet() {
export default function CreateWallet () {
const [tab, setTab] = useState(Tabs.Landing)
const [mnemonics, setMnemonics] = useState<string | undefined>(undefined)

return (
<>
{tab === Tabs.Landing && (
<Landing
forward={tab => {
setTab(tab)
}}
/>
<Landing forward={tab => {
setTab(tab)
}}/>
)}
{tab === Tabs.Intro && (
<Intro
onConfirm={() => {
setMnemonics("wawa") // FIXME generate mnemonics
<Intro onConfirm={() => {
setMnemonics("wawa") // FIXME generate mnemonics

setTab(Tabs.Create)
}}
/>
setTab(Tabs.Create)
}}/>
)}
{typeof mnemonics !== "undefined" && tab === Tabs.Create && (
<Create
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Landing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ export default function Landing() {
const settings = useSettings()
const navigate = useNavigate()

const [loadedSettings] = usePromise(() => {
const [ loadedSettings ] = usePromise(() => {
return settings.load()
}, [])

useEffect(() => {
if (loadedSettings) {
navigate("/wallet")
}
}, [loadedSettings])
}, [ loadedSettings ])

return null
}
8 changes: 6 additions & 2 deletions src/pages/Wallet.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Button } from "@/components/ui/button"
import { Download } from "lucide-react"
import { Download, RefreshCw } from "lucide-react"
import Heading from "@/components/Heading"
import { ThemeToggler } from "@/components/ThemeToggler"
import nf from "@/components/lib/numberFormatter"
Expand All @@ -20,7 +20,11 @@ export default function Landing () {
</div>

<div className={"flex flex-col items-center"}>
<p className={"text-4xl font-extrabold"}>100 KAS</p>
<p className={"text-4xl font-extrabold"}>100 KAS
<Button className={"gap-2"} size={"icon"} variant={"ghost"} onClick={() => {}}>
<RefreshCw />
</Button>
</p>
<p className={"text-xl font-bold"}>{nf.format(11.2)}</p>
</div>
</div>
Expand Down

0 comments on commit 0dcc735

Please # to comment.