-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More pages are done, styling improved
- Loading branch information
Showing
10 changed files
with
102 additions
and
24 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { useState } from "react" | ||
import { useNavigate } from "react-router-dom" | ||
import useKaspa from "@/hooks/useKaspa" | ||
import Summary from "./Wallet/Summary" | ||
|
||
export enum Tabs { | ||
Summary | ||
} | ||
|
||
export default function Creation () { | ||
const navigate = useNavigate() | ||
const { kaspa, request } = useKaspa() | ||
|
||
const [ tab, setTab ] = useState(Tabs.Summary) | ||
|
||
return ( | ||
{ | ||
[ Tabs.Summary ]: <Summary forward={tab => { | ||
setTab(tab) | ||
}} />, | ||
}[ tab ] | ||
) | ||
} |
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,52 @@ | ||
import useKaspa from "@/hooks/useKaspa" | ||
import { Tabs } from "../Wallet" | ||
import { currencies } from "@/contexts/Settings" | ||
import useSettings from "@/hooks/useSettings" | ||
import useCoingecko from "@/hooks/useCoingecko" | ||
import { SendToBack, ReceiptIcon, LogOutIcon } from "lucide-react" | ||
|
||
export default function Summary ({ forward }: { | ||
forward: (tab: Tabs) => void | ||
}) { | ||
const { kaspa } = useKaspa() | ||
const { settings } = useSettings() | ||
const price = useCoingecko(settings.currency) | ||
|
||
return ( | ||
<main className="flex flex-col justify-between min-h-screen px-3 py-4"> | ||
<div className="flex flex-col gap-1"> | ||
<div className="navbar"> | ||
<div className="navbar-start"> | ||
<button className="btn btn-outline text-4xl">Kaspian</button> | ||
</div> | ||
<div className="navbar-end"> | ||
<button className="btn btn-circle"> | ||
<LogOutIcon /> | ||
</button> | ||
</div> | ||
</div> | ||
<div className="card bg-primary text-primary-contents"> | ||
<div className="card-body items-center text-center gap-3"> | ||
<div> | ||
<h2 className="card-title font-extrabold gap-0 h-8"> | ||
<img className="h-11" src="https://kaspa.org/wp-content/uploads/2023/06/Kaspa-Icon-White.svg" /> | ||
{kaspa.balance.toFixed(4)} KAS | ||
</h2> | ||
<p className="font-bold font-mono">{currencies[settings.currency]} {(kaspa.balance * price).toFixed(2)}</p> | ||
</div> | ||
<div className="card-actions"> | ||
<button className="btn"> | ||
<SendToBack /> | ||
Send | ||
</button> | ||
<button className="btn"> | ||
<ReceiptIcon /> | ||
Receive | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</main> | ||
) | ||
} |