Skip to content
Closed
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
83 changes: 83 additions & 0 deletions packages/component-library/src/Header/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -219,4 +219,87 @@
}
}
}

.communityLinkList {
display: flex;
flex-flow: column nowrap;
gap: theme.spacing(4);

.title {
@include theme.text("lg", "medium");

color: theme.color("heading");
}

.communityGrid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: theme.spacing(3);
width: 100%;

@include theme.breakpoint("sm") {
grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
gap: theme.spacing(2);
}
}

.communityCard {
aspect-ratio: 1;
min-height: 160px;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please stick to theme.spacing for spacing units

padding: theme.spacing(6);
display: flex;
align-items: center;
justify-content: center;
text-align: center;
transition:
transform 0.2s ease,
box-shadow 0.2s ease;

&:hover {
transform: translateY(-2px);
box-shadow: 0 8px 25px rgb(0 0 0 / 15%);
}
Comment on lines +258 to +261
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This hover styling appears nowhere else in the design system; it's inconsistent and we should make this match everything else


@include theme.breakpoint("sm") {
min-height: 140px;
padding: theme.spacing(4);
}
}

.communityCardContent {
display: flex;
flex-direction: column;
align-items: center;
gap: theme.spacing(3);
width: 100%;
height: 100%;
justify-content: center;
}

.communityIcon {
display: flex;
align-items: center;
justify-content: center;
width: theme.spacing(12);
height: theme.spacing(12);
color: theme.color("states", "data", "normal");

svg {
width: 100%;
height: 100%;
}
Comment on lines +287 to +290
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This styling should be unneeded, since you're using phosphor icons the default width and height are set to 1em. This means that the right way to style them is to set font-size: theme.spacing(12) on .communityIcon instead of setting width and height and having the styling here.


@include theme.breakpoint("sm") {
width: theme.spacing(10);
height: theme.spacing(10);
}
}

.communityTitle {
@include theme.text("sm", "medium");

margin: 0;
color: theme.color("heading");
}
}
}
18 changes: 17 additions & 1 deletion packages/component-library/src/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,22 @@ const LinkList = ({ title, links }: LinkListProps) => (
</div>
);

const CommunityLinkList = ({ title, links }: LinkListProps) => (
<div className={styles.communityLinkList}>
<h3 className={styles.title}>{title}</h3>
<div className={styles.communityGrid}>
{links.map(({ title, icon, ...link }, i) => (
<Card key={i} {...link} className={styles.communityCard ?? ""}>
<div className={styles.communityCardContent}>
<div className={styles.communityIcon}>{icon}</div>
<h4 className={styles.communityTitle}>{title}</h4>
</div>
</Card>
))}
</div>
</div>
);

export const SupportDrawer = {
title: "Support",
bodyClassName: styles.supportDrawer,
Expand Down Expand Up @@ -226,7 +242,7 @@ export const SupportDrawer = {
},
]}
/>
<LinkList
<CommunityLinkList
title="Community"
links={socialLinks.map(({ icon, href, name }) => ({
href,
Expand Down
28 changes: 20 additions & 8 deletions packages/component-library/src/social-links.tsx
Original file line number Diff line number Diff line change
@@ -1,33 +1,45 @@
import { Code } from "@phosphor-icons/react/dist/ssr/Code";
import { DiscordLogo } from "@phosphor-icons/react/dist/ssr/DiscordLogo";
import { GithubLogo } from "@phosphor-icons/react/dist/ssr/GithubLogo";
import { TelegramLogo } from "@phosphor-icons/react/dist/ssr/TelegramLogo";
import { UsersThree } from "@phosphor-icons/react/dist/ssr/UsersThree";
import { XLogo } from "@phosphor-icons/react/dist/ssr/XLogo";
import { YoutubeLogo } from "@phosphor-icons/react/dist/ssr/YoutubeLogo";

export const socialLinks = [
{
name: "Discord",
icon: <DiscordLogo />,
href: "https://discord.gg/invite/PythNetwork",
name: "GitHub",
icon: <GithubLogo />,
href: "https://github.com/pyth-network",
},
{
name: "Pyth Dev Forum",
icon: <Code />,
href: "https://dev-forum.pyth.network/",
},
{
name: "X",
icon: <XLogo />,
href: "https://x.com/PythNetwork",
},
{
name: "Discord",
icon: <DiscordLogo />,
href: "https://discord.gg/invite/PythNetwork",
},
{
name: "Telegram",
icon: <TelegramLogo />,
href: "https://t.me/Pyth_Network",
},
{
name: "GitHub",
icon: <GithubLogo />,
href: "https://github.com/pyth-network",
},
{
name: "Youtube",
icon: <YoutubeLogo />,
href: "https://www.youtube.com/channel/UCjCkvPN9ohl0UDvldfn1neg",
},
{
name: "Pyth DAO Forum",
icon: <UsersThree />,
href: "https://forum.pyth.network/",
},
];
Loading