Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
357 changes: 357 additions & 0 deletions src/pages/LeaderboardPage.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,357 @@
/*
* LeaderboardPage — layout & chrome
*
* Color tokens map directly to Figma's V1/* variables via the PCS
* theme CSS vars emitted by ThemeProvider:
* V1/Fill/Primary → --pcs-colors-text
* V1/Fill/Secondary → --pcs-colors-text-subtle
* V1/Main/Secondary → --pcs-colors-secondary
* V1/Main/Background → --pcs-colors-background
* V1/Main/Card primary → --pcs-colors-card
* V1/Main/Card border → --pcs-colors-card-border
* V1/Main/Input primary → --pcs-colors-input
* V1/Main/Input second. → --pcs-colors-input-secondary
* V1/Main/Tertiary → --pcs-colors-tertiary
* V1/Fill/Disabled → --pcs-colors-text-disabled
*
* Typography: Kanit (loaded globally by design-system.css).
*/

.lb-root {
font-family: 'Kanit', sans-serif;
color: var(--pcs-colors-text);
background: var(--pcs-colors-background);
min-height: 100vh;
width: 100%;
}

.lb-sr {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}

/* ── Navbar ─────────────────────────────────────────────── */
.lb-nav {
display: flex;
align-items: center;
justify-content: space-between;
height: 64px;
padding: 8px 40px;
background: var(--pcs-colors-card);
border-bottom: 1px solid var(--pcs-colors-card-border);
}

.lb-nav-left {
display: flex;
align-items: center;
gap: 24px;
}

.lb-brand {
display: inline-flex;
align-items: center;
gap: 6px;
text-decoration: none;
color: var(--pcs-colors-text);
}

.lb-bunny {
font-size: 24px;
line-height: 1;
}

.lb-brand-text {
font-size: 16px;
font-weight: 600;
letter-spacing: 0.2px;
}

.lb-brand-caret {
color: var(--pcs-colors-text-subtle);
}

.lb-tabs {
display: flex;
align-items: center;
gap: 4px;
}

.lb-tab {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 12px;
border-radius: 16px;
font-size: 16px;
font-weight: 400;
color: var(--pcs-colors-text-subtle);
text-decoration: none;
white-space: nowrap;
}

.lb-tab-active {
color: var(--pcs-colors-secondary);
font-weight: 600;
}

.lb-nav-right {
display: flex;
align-items: center;
gap: 8px;
}

.lb-search {
display: inline-flex;
align-items: center;
gap: 8px;
height: 40px;
padding: 8px 12px;
background: var(--pcs-colors-dropdown);
border: 1px solid var(--pcs-colors-dropdown-deep, var(--pcs-colors-card-border));
border-radius: 999px;
font-family: inherit;
font-size: 16px;
color: var(--pcs-colors-text-subtle);
cursor: pointer;
}

.lb-search-kbd {
display: inline-flex;
align-items: center;
justify-content: center;
width: 24px;
height: 24px;
padding: 0;
background: var(--pcs-colors-input);
border-radius: 8px;
font-family: inherit;
font-size: 16px;
color: var(--pcs-colors-text-subtle);
}

.lb-wallet {
position: relative;
display: inline-flex;
align-items: center;
gap: 6px;
height: 40px;
padding-left: 8px;
padding-right: 8px;
background: var(--pcs-colors-tertiary);
border-bottom: 2px solid rgba(0, 0, 0, 0.2);
border-radius: 999px;
}

.lb-wallet-avatar {
display: inline-flex;
align-items: center;
justify-content: center;
width: 26px;
height: 26px;
background: #fff;
border-radius: 6.5px;
}

.lb-wallet-balance {
font-size: 16px;
font-weight: 600;
color: var(--pcs-colors-text);
}

.lb-wallet-decimals {
color: var(--pcs-colors-text-subtle);
font-weight: 400;
}

/* ── Body ───────────────────────────────────────────────── */
.lb-body {
display: flex;
flex-direction: column;
align-items: center;
padding: 40px;
background: var(--pcs-colors-background);
}

.lb-content {
display: flex;
flex-direction: column;
gap: 48px;
width: 100%;
max-width: 1200px;
min-width: 0;
}

/* ── Section common ─────────────────────────────────────── */
.lb-section {
display: flex;
flex-direction: column;
gap: 16px;
}

.lb-section-title {
font-size: 32px !important;
font-weight: 600;
line-height: 1.2;
letter-spacing: -0.32px;
color: var(--pcs-colors-text);
margin: 0;
}

/* ── Header section ─────────────────────────────────────── */
.lb-section-header {
gap: 16px;
}

.lb-title-row {
display: flex;
flex-direction: column;
gap: 4px;
}

.lb-page-title {
font-size: 40px !important;
font-weight: 600;
line-height: 1.2;
letter-spacing: -0.4px;
color: var(--pcs-colors-text);
margin: 0;
}

.lb-last-updated {
font-size: 16px;
font-weight: 400;
line-height: 1.5;
color: var(--pcs-colors-text-subtle);
}

.lb-filters {
display: flex;
gap: 8px;
width: 100%;
}

.lb-dropdown {
display: inline-flex;
flex: 1 1 0;
min-width: 0;
align-items: center;
justify-content: space-between;
height: 40px;
padding: 8px 16px;
background: var(--pcs-colors-input);
border: 1px solid var(--pcs-colors-input-secondary);
border-radius: 16px;
font-family: 'Kanit', sans-serif;
font-size: 16px;
color: var(--pcs-colors-text);
cursor: pointer;
}

.lb-dropdown-label {
text-align: left;
}

/* ── Cards (tables) ─────────────────────────────────────── */
.lb-card {
background: var(--pcs-colors-card);
border: 1px solid var(--pcs-colors-card-border);
border-bottom-width: 2px;
border-radius: 24px;
overflow: hidden;
}

/* ── Account-privacy bar ────────────────────────────────── */
.lb-privacy-bar {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
padding: 16px;
border-bottom: 1px solid var(--pcs-colors-card-border);
}

.lb-privacy-note {
font-size: 16px;
font-weight: 400;
line-height: 1.5;
color: var(--pcs-colors-text-subtle) !important;
}

.lb-privacy-toggle {
display: inline-flex;
align-items: center;
gap: 8px;
}

/* ── Unit suffix (USD) ──────────────────────────────────── */
.lb-unit {
color: var(--pcs-colors-text);
font-weight: 400;
}

/* ── Medal tints (top 3 rows of the Leaderboard table) ──── */
.lb-card-leaderboard tbody tr.lb-rank-1 td { background: #FFFCF4; }
.lb-card-leaderboard tbody tr.lb-rank-2 td { background: #FCFCFC; }
.lb-card-leaderboard tbody tr.lb-rank-3 td { background: #FBF8F6; }

[data-theme="dark"] .lb-card-leaderboard tbody tr.lb-rank-1 td { background: rgba(255, 215, 0, 0.05); }
[data-theme="dark"] .lb-card-leaderboard tbody tr.lb-rank-2 td { background: rgba(192, 192, 192, 0.05); }
[data-theme="dark"] .lb-card-leaderboard tbody tr.lb-rank-3 td { background: rgba(205, 127, 50, 0.06); }

/* ── Pagination ─────────────────────────────────────────── */
.lb-pagination {
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
padding: 16px;
width: 100%;
}

.lb-page-btn {
display: inline-flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
padding: 4px;
background: transparent;
border: none;
border-radius: 8px;
color: var(--pcs-colors-text-disabled);
cursor: pointer;
}

.lb-page-btn:not(:disabled) {
color: var(--pcs-colors-primary);
}

.lb-page-btn:disabled {
cursor: default;
color: var(--pcs-colors-text-disabled);
}

.lb-page-label {
font-family: 'Kanit', sans-serif;
font-size: 16px;
font-weight: 400;
line-height: 1.2;
color: var(--pcs-colors-text);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
.lb-body { padding: 24px; }
.lb-page-title { font-size: 32px !important; }
.lb-section-title { font-size: 24px !important; }
.lb-nav { padding: 8px 16px; }
.lb-tabs { display: none; }
.lb-search { display: none; }
}
17 changes: 17 additions & 0 deletions src/pages/LeaderboardPage.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type { Meta, StoryObj } from '@storybook/react-vite'
import { LeaderboardPage } from './LeaderboardPage'

const meta = {
title: 'Apps/Leaderboard',
component: LeaderboardPage,
tags: ['autodocs'],
parameters: { layout: 'fullscreen' },
} satisfies Meta<typeof LeaderboardPage>

export default meta
type Story = StoryObj<typeof meta>

export const Default: Story = {
name: 'Default',
args: {},
}
Loading
Loading