Skip to content

Commit 6904712

Browse files
committed
ui: move streak stats out of wallet button, add share
1 parent f4e5c48 commit 6904712

2 files changed

Lines changed: 128 additions & 8 deletions

File tree

app/ClientPage.tsx

Lines changed: 58 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,25 @@ export default function ClientPage() {
9999
? `${address.slice(0, 6)}...${address.slice(-4)}`
100100
: "Not connected";
101101

102+
const shareApp = async () => {
103+
try {
104+
const url = window.location.href;
105+
const title = "StackUp";
106+
const text = "Daily streaks on Stacks.";
107+
108+
if (navigator.share) {
109+
await navigator.share({ title, text, url });
110+
setStatus("Share sheet opened");
111+
return;
112+
}
113+
114+
await navigator.clipboard.writeText(url);
115+
setStatus("Link copied");
116+
} catch {
117+
setStatus("Share failed");
118+
}
119+
};
120+
102121
const stacksApiBase =
103122
STACKS_NETWORK === "mainnet"
104123
? "https://api.mainnet.hiro.so"
@@ -630,9 +649,7 @@ export default function ClientPage() {
630649
type="button"
631650
>
632651
<span className={styles.walletMain}>{shortAddress}</span>
633-
<span className={styles.walletSub}>
634-
Streak {streak ?? "-"} {" | "}Day {lastClaimDay ?? "-"}
635-
</span>
652+
<span className={styles.walletSub}>View on-chain</span>
636653
</button>
637654
<button
638655
className={`${styles.button} ${styles.ghostButton}`}
@@ -657,8 +674,8 @@ export default function ClientPage() {
657674
<span> Claim daily.</span>
658675
</div>
659676
<p className={styles.lede}>
660-
StackUp tracks your daily claim on Stacks {STACKS_NETWORK}. Claim
661-
once per day to build momentum and unlock NFT badges.
677+
Track one claim per day on Stacks {STACKS_NETWORK}. Earn streak badges
678+
automatically as you hit milestones.
662679
</p>
663680
<div className={styles.heroMeta}>
664681
<div className={styles.metaItem}>
@@ -681,6 +698,27 @@ export default function ClientPage() {
681698
{isLoading ? "Refreshing..." : "Refresh On-Chain"}
682699
</button>
683700
</div>
701+
<div className={styles.statsRow}>
702+
<div className={styles.statChip}>
703+
<div className={styles.statLabel}>Streak</div>
704+
<div className={styles.statValue}>
705+
{streak === null ? "—" : streak}
706+
</div>
707+
</div>
708+
<div className={styles.statChip}>
709+
<div className={styles.statLabel}>Last claim day</div>
710+
<div className={styles.statValue}>
711+
{lastClaimDay === null ? "—" : lastClaimDay}
712+
</div>
713+
</div>
714+
<button
715+
className={`${styles.button} ${styles.ghostButton} ${styles.shareButton}`}
716+
onClick={shareApp}
717+
type="button"
718+
>
719+
Share
720+
</button>
721+
</div>
684722
<div className={styles.statusLine}>
685723
Status: <span>{status}</span>
686724
</div>
@@ -815,6 +853,21 @@ export default function ClientPage() {
815853
</div>
816854
</section>
817855

856+
<footer className={styles.footer}>
857+
<div className={styles.footerInner}>
858+
<div className={styles.footerText}>
859+
StackUp is a lightweight streak tracker on Stacks.
860+
</div>
861+
<button
862+
className={`${styles.button} ${styles.ghostButton} ${styles.shareButton}`}
863+
onClick={shareApp}
864+
type="button"
865+
>
866+
Share
867+
</button>
868+
</div>
869+
</footer>
870+
818871
{adminUnlocked && adminOpen ? (
819872
<div
820873
className={styles.modalBackdrop}

app/page.module.css

Lines changed: 70 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
}
5151

5252
.headline {
53-
font-size: clamp(36px, 4.2vw, 56px);
53+
font-size: clamp(30px, 3.2vw, 46px);
5454
font-weight: 700;
5555
line-height: 1.05;
5656
letter-spacing: -0.02em;
@@ -63,9 +63,9 @@
6363
.lede {
6464
margin-top: 16px;
6565
color: var(--muted);
66-
font-size: 16px;
66+
font-size: 15px;
6767
line-height: 1.6;
68-
max-width: 520px;
68+
max-width: 56ch;
6969
}
7070

7171
.heroMeta {
@@ -104,6 +104,45 @@
104104
margin-top: 20px;
105105
}
106106

107+
.statsRow {
108+
margin-top: 14px;
109+
display: flex;
110+
gap: 10px;
111+
flex-wrap: wrap;
112+
align-items: center;
113+
}
114+
115+
.statChip {
116+
padding: 10px 12px;
117+
border-radius: 16px;
118+
border: 1px solid rgba(255, 255, 255, 0.12);
119+
background: rgba(255, 255, 255, 0.06);
120+
min-width: 128px;
121+
}
122+
123+
[data-theme="light"] .statChip {
124+
border-color: rgba(0, 0, 0, 0.12);
125+
background: rgba(255, 255, 255, 0.6);
126+
}
127+
128+
.statLabel {
129+
font-size: 11px;
130+
letter-spacing: 0.12em;
131+
text-transform: uppercase;
132+
color: var(--muted);
133+
}
134+
135+
.statValue {
136+
margin-top: 4px;
137+
font-size: 16px;
138+
font-weight: 800;
139+
color: var(--text);
140+
}
141+
142+
.shareButton {
143+
white-space: nowrap;
144+
}
145+
107146
.panelGrid {
108147
display: grid;
109148
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
@@ -511,6 +550,29 @@
511550
color: var(--muted);
512551
}
513552

553+
.footer {
554+
margin-top: 8px;
555+
padding-top: 10px;
556+
border-top: 1px solid rgba(255, 255, 255, 0.12);
557+
}
558+
559+
[data-theme="light"] .footer {
560+
border-top-color: rgba(0, 0, 0, 0.12);
561+
}
562+
563+
.footerInner {
564+
display: flex;
565+
gap: 12px;
566+
align-items: center;
567+
justify-content: space-between;
568+
flex-wrap: wrap;
569+
}
570+
571+
.footerText {
572+
font-size: 12px;
573+
color: var(--muted);
574+
}
575+
514576
@media (max-width: 720px) {
515577
.header {
516578
align-items: flex-start;
@@ -519,4 +581,9 @@
519581
.badgeGrid {
520582
grid-template-columns: 1fr;
521583
}
584+
585+
.statChip {
586+
min-width: 0;
587+
flex: 1 1 140px;
588+
}
522589
}

0 commit comments

Comments
 (0)