Skip to content

Commit 86724ba

Browse files
authored
feat: enhance UI/UX with improved mobile responsiveness and visual consistency (#10)
- Add educational messaging for logged-in and not-logged states with key pair generation context - Implement mobile-first responsive design with touch-friendly buttons (48px min height) - Add faucet integration with updated polkadot.io URLs for test token acquisition - Replace transaction hash display with clean explorer buttons showing 5-char previews - Improve balance visibility on small screens with structured grid layout and clear labeling - Apply consistent color scheme: blue for mint actions, orange for burn actions - Add 5-second delay before showing transaction hash buttons for better UX - Implement comprehensive test suite with 9 test cases covering all functionality - Update balance component to use proper Asset Hub decimals from wagmi config - Comment out ETH transactions (code preserved) and add explorer link integration
1 parent eaadce2 commit 86724ba

File tree

13 files changed

+2580
-135
lines changed

13 files changed

+2580
-135
lines changed

quick-starts/react-quick-start/package-lock.json

Lines changed: 1451 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

quick-starts/react-quick-start/package.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
"dev": "vite",
99
"build": "tsc && vite build",
1010
"preview": "vite preview",
11-
"lint": "eslint"
11+
"lint": "eslint",
12+
"test": "vitest",
13+
"test:ui": "vitest --ui",
14+
"test:run": "vitest run"
1215
},
1316
"//IMP START": "IMP START - Web3Auth Installation",
1417
"dependencies": {
@@ -20,12 +23,17 @@
2023
},
2124
"//IMP END": "IMP END - Web3Auth Installation",
2225
"devDependencies": {
26+
"@testing-library/jest-dom": "^6.8.0",
27+
"@testing-library/react": "^16.3.0",
28+
"@testing-library/user-event": "^14.6.1",
2329
"@types/react": "^18.3.3",
2430
"@types/react-dom": "^18.3.0",
2531
"@vitejs/plugin-react": "^4.3.1",
2632
"buffer": "^6.0.3",
33+
"jsdom": "^27.0.0",
2734
"process": "^0.11.10",
2835
"typescript": "^5.5.4",
29-
"vite": "^5.4.0"
36+
"vite": "^5.4.0",
37+
"vitest": "^3.2.4"
3038
}
3139
}

quick-starts/react-quick-start/src/App.css

Lines changed: 256 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@ body {
5555
/* Layout */
5656
.container {
5757
width: 100%;
58-
padding: 0 16px;
58+
padding: 16px;
5959
margin: 0 auto;
60+
max-width: 100vw;
61+
box-sizing: border-box;
6062
}
6163

6264
.main {
@@ -69,11 +71,13 @@ body {
6971

7072
/* Typography */
7173
.title {
72-
font-size: 28px;
74+
font-size: 24px;
7375
text-align: center;
74-
margin: 24px 0;
75-
line-height: 1.2;
76+
margin: 20px 0;
77+
line-height: 1.3;
7678
font-weight: 600;
79+
padding: 0 8px;
80+
word-wrap: break-word;
7781
}
7882

7983
.title a {
@@ -117,6 +121,17 @@ button:hover, .card:hover {
117121
transform: translateY(-1px);
118122
}
119123

124+
/* Faucet button styling */
125+
.faucet-button {
126+
background-color: var(--primary-color);
127+
color: white;
128+
font-weight: 600;
129+
}
130+
131+
.faucet-button:hover {
132+
background-color: var(--primary-hover);
133+
}
134+
120135
.card {
121136
width: 100%;
122137
margin: 8px 0;
@@ -229,21 +244,115 @@ input::placeholder {
229244
color: var(--primary-color);
230245
}
231246

232-
/* Responsive */
247+
/* Mobile-first responsive design */
248+
/* Mobile styles (default) */
249+
body {
250+
font-size: 16px; /* Prevent zoom on mobile */
251+
}
252+
253+
button, .card {
254+
min-height: 48px; /* Touch-friendly button size */
255+
font-size: 16px; /* Prevent zoom on mobile */
256+
}
257+
258+
.flex-container {
259+
display: flex;
260+
flex-direction: column;
261+
gap: 12px;
262+
width: 100%;
263+
align-items: stretch;
264+
}
265+
266+
.educational-message h2 {
267+
font-size: 22px;
268+
text-align: center;
269+
line-height: 1.4;
270+
}
271+
272+
.educational-message p {
273+
font-size: 16px;
274+
text-align: center;
275+
line-height: 1.5;
276+
}
277+
278+
.showcase-message h3 {
279+
font-size: 18px;
280+
text-align: center;
281+
line-height: 1.3;
282+
}
283+
284+
.showcase-message p {
285+
font-size: 15px;
286+
text-align: center;
287+
line-height: 1.4;
288+
}
289+
290+
/* Small mobile (max-width: 480px) */
291+
@media (max-width: 480px) {
292+
.container {
293+
padding: 0 12px;
294+
}
295+
296+
.title {
297+
font-size: 22px;
298+
line-height: 1.3;
299+
}
300+
301+
.educational-message {
302+
padding: 16px;
303+
margin: 12px 0;
304+
}
305+
306+
.educational-message h2 {
307+
font-size: 18px;
308+
margin-bottom: 8px;
309+
}
310+
311+
.showcase-message {
312+
padding: 12px;
313+
margin: 8px 0;
314+
}
315+
316+
.showcase-message h3 {
317+
font-size: 15px;
318+
margin-bottom: 6px;
319+
}
320+
321+
button, .card {
322+
padding: 14px 16px; /* Larger touch targets */
323+
font-size: 16px;
324+
min-height: 48px;
325+
}
326+
}
327+
328+
/* Tablet and up styles */
233329
@media (min-width: 640px) {
234330
.container {
235331
max-width: 640px;
236332
}
237-
333+
238334
.title {
239335
font-size: 32px;
240336
}
241-
337+
338+
.flex-container {
339+
flex-direction: row;
340+
flex-wrap: wrap;
341+
}
342+
343+
.educational-message h2 {
344+
font-size: 24px;
345+
}
346+
347+
.showcase-message h3 {
348+
font-size: 18px;
349+
}
350+
242351
form {
243352
flex-direction: row;
244353
align-items: flex-start;
245354
}
246-
355+
247356
form button {
248357
margin-top: 0;
249358
}
@@ -253,10 +362,19 @@ input::placeholder {
253362
.container {
254363
max-width: 768px;
255364
}
256-
365+
257366
.title {
258367
font-size: 36px;
259368
}
369+
370+
.flex-container {
371+
justify-content: center;
372+
}
373+
374+
.flex-container > div {
375+
flex: 0 1 auto;
376+
max-width: 200px;
377+
}
260378
}
261379

262380
@media (min-width: 1024px) {
@@ -265,6 +383,55 @@ input::placeholder {
265383
}
266384
}
267385

386+
/* Educational message styles */
387+
.educational-message {
388+
text-align: center;
389+
padding: 24px;
390+
margin: 16px 0;
391+
background-color: var(--bg-light);
392+
border: 1px solid var(--border-color);
393+
border-radius: var(--radius);
394+
box-shadow: var(--shadow-sm);
395+
}
396+
397+
.educational-message h2 {
398+
color: var(--primary-color);
399+
font-size: 24px;
400+
margin-bottom: 12px;
401+
line-height: 1.3;
402+
}
403+
404+
.educational-message p {
405+
color: var(--text-muted);
406+
font-size: 16px;
407+
line-height: 1.5;
408+
max-width: 600px;
409+
margin: 0 auto;
410+
}
411+
412+
.showcase-message {
413+
background-color: var(--bg-light);
414+
border: 1px solid var(--border-color);
415+
border-radius: var(--radius);
416+
padding: 16px;
417+
margin: 12px 0;
418+
box-shadow: var(--shadow-sm);
419+
}
420+
421+
.showcase-message h3 {
422+
color: var(--primary-color);
423+
font-size: 18px;
424+
margin: 0 0 8px 0;
425+
font-weight: 500;
426+
}
427+
428+
.showcase-message p {
429+
color: var(--text-muted);
430+
font-size: 14px;
431+
margin: 0;
432+
line-height: 1.4;
433+
}
434+
268435
/* Contract section styles */
269436
.contract-section {
270437
margin-top: 24px;
@@ -384,4 +551,84 @@ input::placeholder {
384551

385552
.focus\:ring-indigo-600:focus {
386553
box-shadow: 0 0 0 2px var(--primary-color);
554+
}
555+
556+
/* Balance display improvements */
557+
.balance-grid {
558+
display: grid;
559+
grid-template-columns: 1fr auto;
560+
gap: 16px 20px;
561+
align-items: center;
562+
}
563+
564+
.balance-address {
565+
display: flex;
566+
flex-direction: column;
567+
gap: 4px;
568+
min-width: 0;
569+
}
570+
571+
.balance-label {
572+
font-size: 12px;
573+
color: var(--text-muted);
574+
font-weight: 500;
575+
text-transform: uppercase;
576+
letter-spacing: 0.5px;
577+
}
578+
579+
.balance-value {
580+
font-family: monospace;
581+
font-size: 13px;
582+
color: var(--text-color);
583+
word-break: break-all;
584+
padding: 6px 10px;
585+
background-color: var(--bg-color);
586+
border: 1px solid var(--border-color);
587+
border-radius: 4px;
588+
}
589+
590+
.balance-amount {
591+
display: flex;
592+
justify-content: flex-end;
593+
}
594+
595+
.balance-amount-value {
596+
font-size: 18px;
597+
font-weight: 600;
598+
color: var(--primary-color);
599+
background-color: var(--bg-color);
600+
padding: 8px 12px;
601+
border: 1px solid var(--border-color);
602+
border-radius: 6px;
603+
min-width: 100px;
604+
text-align: center;
605+
}
606+
607+
/* Mobile responsive balance display */
608+
@media (max-width: 480px) {
609+
.balance-grid {
610+
grid-template-columns: 1fr;
611+
gap: 12px;
612+
}
613+
614+
.balance-address {
615+
order: 1;
616+
}
617+
618+
.balance-amount {
619+
order: 2;
620+
justify-content: center;
621+
margin-bottom: 16px;
622+
}
623+
624+
.balance-amount-value {
625+
font-size: 20px;
626+
padding: 12px 16px;
627+
min-width: 120px;
628+
}
629+
630+
.balance-value {
631+
font-size: 12px;
632+
padding: 8px 12px;
633+
}
387634
}

0 commit comments

Comments
 (0)