Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dark theme to web3 modal #316

Merged
merged 18 commits into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 22 additions & 6 deletions ui/components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,10 @@ export default function Layout({ children }: any) {
key={item.href}
>
{item.href.charAt(0) === '/' ? (
<Link href={item.href} className={`py-4 ${router.pathname == item.href ? 'active' : ''} ${router.pathname !== item.href ? 'dark:hover:bg-slate-700' : ''}`}>
<Link
href={item.href}
className={`py-4 ${router.pathname == item.href ? 'active' : ''} ${router.pathname !== item.href ? 'dark:hover:bg-slate-700' : ''}`}
>
{item.icon}
{item.name}
<ChevronRightIcon className="h-5 w-5 absolute right-4 opacity-50" />
Expand Down Expand Up @@ -240,7 +243,10 @@ export default function Layout({ children }: any) {
<input type="checkbox" id="web3-modal" className="modal-toggle" />

<label htmlFor="web3-modal" className="modal cursor-pointer z-10">
<label className="modal-box relative" htmlFor="">
<label
className="modal-box relative dark:bg-slate-800 dark:text-slate-300"
htmlFor=""
>
<label
htmlFor="web3-modal"
className="btn btn-sm btn-circle btn-ghost absolute right-6 top-5"
Expand All @@ -254,8 +260,12 @@ export default function Layout({ children }: any) {

<p className="p-4">Connected to {connectData?.connector?.name}</p>

<ul className="menu bg-base-100 p-2 -m-2 rounded-box">
<li key="address">
<ul className="menu bg-base-100 p-2 -m-2 rounded-box space-y-2 rounded-box dark:bg-slate-800">
amochuko marked this conversation as resolved.
Show resolved Hide resolved
<li
key="address"
className="dark:border-[1px] dark:border-slate-600 my-1 dark:bg-slate-700
amochuko marked this conversation as resolved.
Show resolved Hide resolved
dark:hover:bg-slate-600 rounded-md"
>
<a
href={`${etherscanDomain}/address/${address}`}
rel="noreferrer noopener"
Expand All @@ -271,7 +281,11 @@ export default function Layout({ children }: any) {
</a>
</li>

<li key="logout">
<li
key="logout"
className="dark:border-[1px] dark:border-slate-600 my-1 dark:bg-slate-700
dark:hover:bg-slate-600 rounded-md"
>
<a onClick={() => disconnect()}>
<ArrowRightOnRectangleIcon className="h-5 w-5" />
Log out
Expand All @@ -297,12 +311,14 @@ export default function Layout({ children }: any) {
''
)}

<ul className="menu bg-base-100 p-2 -m-2 rounded-box">
<ul className="menu bg-base-100 p-2 -m-2 rounded-box dark:bg-slate-800">
{connectors.map((connector) => (
<li key={connector.id}>
<button
disabled={!connector.ready}
onClick={() => connect({ connector })}
className="dark:border-[1px] dark:border-slate-600 my-1 dark:bg-slate-700
amochuko marked this conversation as resolved.
Show resolved Hide resolved
dark:hover:bg-slate-600"
>
{(connectorIcons as Indexable)[connector.name] ? (
<div className="h-5 w-5">
Expand Down
Loading
Loading