Skip to content

Commit 79757ff

Browse files
authored
Merge pull request #316 from amochuko/add-dark-theme-to-modal
Add dark theme to web3 modal
2 parents cbff3ce + 3994bdf commit 79757ff

File tree

3 files changed

+9577
-13
lines changed

3 files changed

+9577
-13
lines changed

ui/components/Layout.tsx

+27-12
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
11
import {
2+
ArrowRightOnRectangleIcon,
3+
ArrowTopRightOnSquareIcon,
24
BanknotesIcon,
5+
Bars3Icon,
36
ChevronDownIcon,
47
ChevronRightIcon,
58
CurrencyDollarIcon,
6-
ArrowTopRightOnSquareIcon,
79
HomeIcon,
810
KeyIcon,
911
LockClosedIcon,
10-
ArrowRightOnRectangleIcon,
11-
Bars3Icon,
1212
NewspaperIcon,
1313
PlusIcon,
14-
UserPlusIcon,
14+
Squares2X2Icon,
1515
UserIcon,
16+
UserPlusIcon,
1617
UsersIcon,
17-
Squares2X2Icon,
1818
XCircleIcon,
1919
} from '@heroicons/react/24/outline'
2020
import Image from 'next/image'
2121
import Link from 'next/link'
2222
import { useRouter } from 'next/router'
23-
import Script from 'next/script'
2423
import { useState } from 'react'
2524
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module 'reac... Remove this comment to see the full error message
2625
import Blockies from 'react-blockies'
@@ -182,7 +181,10 @@ export default function Layout({ children }: any) {
182181
key={item.href}
183182
>
184183
{item.href.charAt(0) === '/' ? (
185-
<Link href={item.href} className={`py-4 ${router.pathname == item.href ? 'active' : ''} ${router.pathname !== item.href ? 'dark:hover:bg-slate-700' : ''}`}>
184+
<Link
185+
href={item.href}
186+
className={`py-4 ${router.pathname == item.href ? 'active' : ''} ${router.pathname !== item.href ? 'dark:hover:bg-slate-700' : ''}`}
187+
>
186188
{item.icon}
187189
{item.name}
188190
<ChevronRightIcon className="h-5 w-5 absolute right-4 opacity-50" />
@@ -240,7 +242,10 @@ export default function Layout({ children }: any) {
240242
<input type="checkbox" id="web3-modal" className="modal-toggle" />
241243

242244
<label htmlFor="web3-modal" className="modal cursor-pointer z-10">
243-
<label className="modal-box relative" htmlFor="">
245+
<label
246+
className="modal-box relative dark:bg-slate-800 dark:text-slate-300"
247+
htmlFor=""
248+
>
244249
<label
245250
htmlFor="web3-modal"
246251
className="btn btn-sm btn-circle btn-ghost absolute right-6 top-5"
@@ -254,8 +259,12 @@ export default function Layout({ children }: any) {
254259

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

257-
<ul className="menu bg-base-100 p-2 -m-2 rounded-box">
258-
<li key="address">
262+
<ul className="menu bg-base-100 p-2 -m-2 rounded-box dark:bg-slate-800">
263+
<li
264+
key="address"
265+
className="dark:bg-slate-700
266+
dark:hover:bg-slate-600"
267+
>
259268
<a
260269
href={`${etherscanDomain}/address/${address}`}
261270
rel="noreferrer noopener"
@@ -271,7 +280,11 @@ export default function Layout({ children }: any) {
271280
</a>
272281
</li>
273282

274-
<li key="logout">
283+
<li
284+
key="logout"
285+
className="dark:bg-slate-700
286+
dark:hover:bg-slate-600"
287+
>
275288
<a onClick={() => disconnect()}>
276289
<ArrowRightOnRectangleIcon className="h-5 w-5" />
277290
Log out
@@ -297,12 +310,14 @@ export default function Layout({ children }: any) {
297310
''
298311
)}
299312

300-
<ul className="menu bg-base-100 p-2 -m-2 rounded-box">
313+
<ul className="menu bg-base-100 p-2 -m-2 rounded-box dark:bg-slate-800">
301314
{connectors.map((connector) => (
302315
<li key={connector.id}>
303316
<button
304317
disabled={!connector.ready}
305318
onClick={() => connect({ connector })}
319+
className="dark:bg-slate-700
320+
dark:hover:bg-slate-600 mb-0.5"
306321
>
307322
{(connectorIcons as Indexable)[connector.name] ? (
308323
<div className="h-5 w-5">

ui/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
2020
"@types/jest": "^29.5.12",
2121
"@types/node": "^20.12.11",
22-
"@types/react": "18.3.5",
22+
"@types/react": "18.0.1",
2323
"@types/react-dom": "^18.0.4",
2424
"autoprefixer": "^10.4.0",
2525
"cypress": "^13.13.3",

0 commit comments

Comments
 (0)