Skip to content

Commit c37edc5

Browse files
committed
chore(dev-hub) Design Fixes for Product Cards
1 parent 7b35d10 commit c37edc5

File tree

4 files changed

+71
-62
lines changed

4 files changed

+71
-62
lines changed

apps/developer-hub/src/components/Pages/Homepage/index.module.scss

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
@use "@pythnetwork/component-library/theme";
22

33
.landing {
4-
@include theme.max-width;
4+
padding: theme.spacing(4) theme.spacing(2);
55

6-
padding: 2rem 1rem;
6+
@include theme.max-width;
77

8-
@media (width >= 768px) {
9-
padding: 3rem 1.5rem;
8+
@include theme.breakpoint("md") {
9+
padding: theme.spacing(6) theme.spacing(3);
1010
}
1111
}
1212

1313
.cards {
1414
display: flex;
1515
gap: theme.spacing(10);
1616
flex-direction: column;
17+
1718
@include theme.breakpoint("md") {
1819
flex-direction: row;
1920
}

apps/developer-hub/src/components/Pages/Homepage/index.tsx

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,35 @@ export const Homepage = () => {
88
<div className={styles.landing}>
99
<h2>Homepage Landing Page</h2>
1010
<div className={styles.cards}>
11+
<ProductCard
12+
title="Pyth Core"
13+
description="Stable, secure, and decentralized price data source for DeFi and TradFi applications."
14+
features={[
15+
{ label: "400ms frequency", icon: <Lightning size={12.5} /> },
16+
{
17+
label: "100+ blockchains",
18+
icon: <Lightning size={12.5} />,
19+
},
20+
{
21+
label: "Confidence intervals",
22+
icon: <Lightning size={12.5} />,
23+
},
24+
{ label: "2500+ price feeds", icon: <Lightning size={12.5} /> },
25+
]}
26+
quickLinks={[
27+
{
28+
label: "Getting Started",
29+
href: "/price-feeds/v1/getting-started",
30+
},
31+
{ label: "API Reference", href: "/openapi/hermes" },
32+
{
33+
label: "Contract Addresses",
34+
href: "/price-feeds/v1/contract-addresses",
35+
},
36+
]}
37+
buttonLabel="Get started"
38+
buttonHref="/price-feeds/v1"
39+
/>
1140
<ProductCard
1241
title="Pyth Pro"
1342
description="Subscription-based price data for institutions and advanced use cases."
@@ -26,13 +55,13 @@ export const Homepage = () => {
2655
quickLinks={[
2756
{
2857
label: "Get Pyth Pro Access Token",
29-
href: "/docs/price-feeds/v2/acquire-an-access-token",
58+
href: "/price-feeds/v2/acquire-an-access-token",
3059
},
31-
{ label: "Browse Supported Feeds", href: "/docs/price-feeds" },
32-
{ label: "Error Codes", href: "/docs/price-feeds" },
60+
{ label: "Browse Supported Feeds", href: "/price-feeds" },
61+
{ label: "Error Codes", href: "/price-feeds" },
3362
]}
3463
buttonLabel="Get started"
35-
buttonHref="/docs/price-feeds"
64+
buttonHref="/price-feeds"
3665
/>
3766
<ProductCard
3867
title="Entropy"
@@ -45,13 +74,13 @@ export const Homepage = () => {
4574
quickLinks={[
4675
{
4776
label: "Getting Started",
48-
href: "/docs/entropy/create-your-first-entropy-app",
77+
href: "/entropy/create-your-first-entropy-app",
4978
},
50-
{ label: "Protocol Design", href: "/docs/entropy/protocol-design" },
51-
{ label: "Examples", href: "/docs/entropy/examples" },
79+
{ label: "Protocol Design", href: "/entropy/protocol-design" },
80+
{ label: "Examples", href: "/entropy/examples" },
5281
]}
5382
buttonLabel="Get started"
54-
buttonHref="/docs/entropy"
83+
buttonHref="/entropy"
5584
/>
5685
</div>
5786
</div>

apps/developer-hub/src/components/ProductCard/index.module.scss

Lines changed: 20 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -12,50 +12,26 @@
1212
.content {
1313
display: flex;
1414
flex-direction: column;
15-
gap: 2rem; // 32px
15+
gap: theme.spacing(8);
1616
height: 100%;
1717
flex: 1;
18-
overflow: visible;
1918
}
2019

2120
.mainContent {
2221
display: flex;
2322
flex-direction: column;
24-
gap: 3rem;
25-
padding-top: 0;
26-
padding-bottom: 0;
23+
gap: theme.spacing(12);
2724
flex: 1;
28-
overflow: visible;
2925
}
3026

3127
.header {
3228
display: flex;
3329
flex-direction: column;
34-
gap: 0.75rem; // 12px
30+
gap: theme.spacing(3);
3531
min-height: 7rem; // 88px - fixed height to keep FEATURES at consistent position
3632
height: 7rem; // 88px - fixed height
3733
}
3834

39-
.decorativeIcon {
40-
position: absolute;
41-
right: 1.5rem; // 24px from right
42-
top: 1.5rem;
43-
pointer-events: none;
44-
z-index: 0;
45-
}
46-
47-
.barChart {
48-
position: relative;
49-
width: 30px; // Space for all bars
50-
height: 32px;
51-
}
52-
53-
.bar {
54-
position: absolute;
55-
width: 3px;
56-
border-radius: 1.5px;
57-
}
58-
5935
.title {
6036
margin: 0;
6137
font-size: 1.875rem; // 30px
@@ -64,7 +40,6 @@
6440
letter-spacing: -0.03em; // -0.9px
6541
color: var(--color-fd-foreground);
6642
white-space: nowrap;
67-
overflow: visble;
6843
text-overflow: ellipsis;
6944
flex-shrink: 0;
7045
}
@@ -77,7 +52,6 @@
7752
letter-spacing: -0.01em; // -0.16px
7853
color: var(--color-fd-foreground);
7954
opacity: 0.9;
80-
overflow: visible;
8155
display: -webkit-box;
8256
-webkit-line-clamp: 3;
8357
line-clamp: 3;
@@ -88,16 +62,15 @@
8862
.featuresSection {
8963
display: flex;
9064
flex-direction: column;
91-
gap: 1.5rem; // 24px
65+
gap: theme.spacing(6);
9266
min-height: 12rem;
9367
max-height: 12rem;
94-
overflow: visible;
9568
}
9669

9770
.quickLinksSection {
9871
display: flex;
9972
flex-direction: column;
100-
gap: 1.5rem;
73+
gap: theme.spacing(6);
10174
}
10275

10376
.sectionLabel {
@@ -115,19 +88,19 @@
11588
.features {
11689
display: flex;
11790
flex-direction: column;
118-
gap: 0.5rem; // 8px
91+
gap: theme.spacing(2);
11992
}
12093

12194
.featureItem {
12295
position: relative;
12396
display: flex;
12497
align-items: center;
125-
gap: 0.5rem; // 8px
98+
gap: theme.spacing(2);
12699
padding: 0.3125rem 0.8125rem 0.3125rem 0.5rem;
127-
border: 1px solid var(--color-fd-border, #ddd4d4);
100+
border: 1px solid var(--color-fd-border);
128101
border-radius: 1.3125rem; // 21px
129102
background-color: var(--color-fd-card);
130-
justify-content: left;
103+
justify-content: flex-start;
131104
box-shadow: 0 0 4px 0 rgb(255 255 255 / 25%) inset;
132105
}
133106

@@ -161,7 +134,7 @@
161134
.quickLinks {
162135
display: flex;
163136
flex-direction: column;
164-
gap: 1rem; // 16px
137+
gap: theme.spacing(4);
165138
}
166139

167140
.quickLink {
@@ -187,17 +160,15 @@
187160
display: flex;
188161
align-items: center;
189162
justify-content: flex-start;
163+
}
190164

191-
:global(button) {
192-
padding: 0.625rem; // 10px
193-
border-radius: 0.5rem; // 8px
194-
background-color: #27253d;
195-
color: #f8f9fc;
196-
font-size: 1rem; // 16px
197-
font-weight: 500;
198-
line-height: 1.25; // 20px
199-
letter-spacing: -0.01em; // -0.16px
200-
width: auto;
201-
min-width: auto;
202-
}
165+
.button {
166+
padding: 0.625rem; // 10px
167+
border-radius: 0.5rem; // 8px
168+
background-color: #27253d;
169+
color: #f8f9fc;
170+
font-size: 1rem; // 16px
171+
font-weight: 500;
172+
line-height: 1.25; // 20px
173+
letter-spacing: -0.01em; // -0.16px
203174
}

apps/developer-hub/src/components/ProductCard/index.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,15 @@ export function ProductCard({
101101

102102
{buttonLabel && (
103103
<div className={styles.buttonWrapper}>
104-
<Button onPress={handleButtonClick} size="md" variant="primary">
104+
<Button
105+
onClick={(e) => {
106+
e.preventDefault();
107+
handleButtonClick();
108+
}}
109+
size="md"
110+
variant="primary"
111+
className={clsx(styles.button, className)}
112+
>
105113
{buttonLabel}
106114
</Button>
107115
</div>

0 commit comments

Comments
 (0)