-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(insights): responsive layouts and components #2285
Open
partyparrotgreg
wants to merge
13
commits into
main
Choose a base branch
from
insights-responsive
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
b952f18
chore(insights): add mobile menu component with styles and update sta…
partyparrotgreg b27e3e4
chore(insights): update .gitignore to include .env*.development files
partyparrotgreg e938fae
chore(insights): improve footer and drawer styles for better responsi…
partyparrotgreg 8b37653
chore(insights): refine header styles for better layout and responsiv…
partyparrotgreg 9ded02d
chore(insights): implement new mobile menu and navigation components …
partyparrotgreg e61dae4
chore(insights): enhance layout and responsiveness of Stats component…
partyparrotgreg f4ca5a1
chore(Drawer): remove unnecessary padding and clean up styles for bet…
partyparrotgreg f4aa420
chore(insights): refactor PriceFeed components with updated styling a…
partyparrotgreg e5f22ef
chore(insights): clean up and standardize component styles across Mob…
partyparrotgreg c307350
feat(insights): add CardTitle component to enhance PriceFeeds layout …
partyparrotgreg 9bf27b6
feat(insights): implement PageTitle component to unify header styling…
partyparrotgreg c6a6c6f
style(insights): update CardTitle and Publishers styles for improved …
partyparrotgreg 60b85d3
feat(insights): refactor Overview & PriceFeeds components to use Page…
partyparrotgreg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DISABLE_ACCESSIBILITY_REPORTING=true | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
.env*.local | ||
.env*.development |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
@use "@pythnetwork/component-library/theme"; | ||
|
||
.cardTitle { | ||
display: flex; | ||
flex-flow: row nowrap; | ||
gap: theme.spacing(3); | ||
align-items: center; | ||
justify-content: flex-start; | ||
.title { | ||
color: theme.color("heading"); | ||
display: flex; | ||
flex-flow: row nowrap; | ||
gap: theme.spacing(3); | ||
align-items: center; | ||
@include theme.text("base", "semibold"); | ||
@include theme.breakpoint("md") { | ||
@include theme.text("lg", "semibold"); | ||
} | ||
} | ||
.icon { | ||
font-size: theme.spacing(6); | ||
height: theme.spacing(6); | ||
color: theme.color("button", "primary", "background", "normal"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import clsx from "clsx"; | ||
import type { ComponentProps, ReactNode } from "react"; | ||
|
||
import styles from "./index.module.scss"; | ||
|
||
type CardTitleProps = { | ||
children: ReactNode; | ||
icon?: ReactNode | undefined; | ||
badge?: ReactNode; | ||
} & ComponentProps<"div">; | ||
|
||
export const CardTitle = ({ children, icon, badge, ...props }: CardTitleProps) => { | ||
return ( | ||
<div className={clsx(styles.cardTitle, props.className)} {...props}> | ||
{icon && <div className={styles.icon}>{icon}</div>} | ||
<h2 className={styles.title}>{children}</h2> | ||
{badge} | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
apps/insights/src/components/MobileMenu/mobile-menu.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
@use "@pythnetwork/component-library/theme"; | ||
|
||
.mobileMenuTrigger { | ||
display: block; | ||
|
||
@include theme.breakpoint("md") { | ||
display: none; | ||
} | ||
} | ||
|
||
.mobileMenuOverlay { | ||
background: rgb(0 0 0 / 40%); | ||
position: fixed; | ||
inset: 0; | ||
z-index: 999; | ||
} | ||
|
||
.mobileMenuContainer { | ||
border-top-left-radius: theme.border-radius("2xl"); | ||
border-top-right-radius: theme.border-radius("2xl"); | ||
background: theme.color("background", "modal"); | ||
position: absolute; | ||
bottom: 0; | ||
left: 0; | ||
right: 0; | ||
padding: 1rem; | ||
display: flex; | ||
flex-flow: column nowrap; | ||
gap: theme.spacing(4); | ||
} | ||
|
||
.mobileMenuHandle { | ||
background: theme.color("background", "secondary"); | ||
width: 33%; | ||
height: 6px; | ||
border-radius: theme.border-radius("full"); | ||
align-self: center; | ||
} | ||
|
||
.mobileThemeSwitcher { | ||
display: flex; | ||
flex-flow: row nowrap; | ||
justify-content: space-between; | ||
align-items: center; | ||
} | ||
|
||
.mobileThemeSwitcherFeedback { | ||
display: flex; | ||
flex-flow: row nowrap; | ||
align-items: center; | ||
gap: theme.spacing(3); | ||
text-transform: capitalize; | ||
font-weight: theme.font-weight("medium"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
"use client"; | ||
import { List } from "@phosphor-icons/react/dist/ssr/List"; | ||
import { Button } from "@pythnetwork/component-library/Button"; | ||
import clsx from "clsx"; | ||
import { useState, type ComponentProps } from "react"; | ||
|
||
import styles from "./mobile-menu.module.scss"; | ||
|
||
export const MobileMenu = ({ className, ...props }: ComponentProps<"div">) => { | ||
const [isOpen, setIsOpen] = useState(false); | ||
|
||
const toggleMenu = () => { | ||
setIsOpen(!isOpen); | ||
}; | ||
|
||
return ( | ||
<div className={clsx(styles.mobileMenuTrigger, className)} {...props}> | ||
<Button | ||
variant="ghost" | ||
size="sm" | ||
afterIcon={List} | ||
rounded | ||
onPress={toggleMenu} | ||
> | ||
Menu | ||
</Button> | ||
</div> | ||
); | ||
}; |
12 changes: 12 additions & 0 deletions
12
apps/insights/src/components/MobileNavigation/mobile-navigation.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
@use "@pythnetwork/component-library/theme"; | ||
|
||
.mobileNavigation { | ||
display: block; | ||
padding: theme.spacing(2); | ||
background: theme.color("background", "primary"); | ||
border-top: 1px solid theme.color("background", "secondary"); | ||
|
||
@include theme.breakpoint("md") { | ||
display: none; | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
apps/insights/src/components/MobileNavigation/mobile-navigation.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import styles from "./mobile-navigation.module.scss"; | ||
import { MainNavTabs } from "../Root/tabs"; | ||
export const MobileNavigation = () => { | ||
return ( | ||
<div className={styles.mobileNavigation}> | ||
<MainNavTabs /> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import styles from "./index.module.scss"; | ||
import { Card } from "@pythnetwork/component-library/Card"; | ||
|
||
import { PageLayout } from "../PageLayout/page-layout"; | ||
|
||
export const Overview = () => ( | ||
<div className={styles.overview}> | ||
<h1 className={styles.header}>Overview</h1> | ||
</div> | ||
<PageLayout title={"Overview"}> | ||
<Card title="Overview"></Card> | ||
</PageLayout> | ||
); |
24 changes: 24 additions & 0 deletions
24
apps/insights/src/components/PageLayout/page-layout.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
@use "@pythnetwork/component-library/theme"; | ||
|
||
.pageLayout { | ||
@include theme.max-width; | ||
display: flex; | ||
gap: theme.spacing(6); | ||
flex-direction: column; | ||
|
||
.pageTitleContainer { | ||
display: flex; | ||
flex-flow: row nowrap; | ||
gap: theme.spacing(3); | ||
width: 100%; | ||
align-items: center; | ||
justify-content: space-between; | ||
|
||
.pageTitle { | ||
@include theme.h3; | ||
color: theme.color("heading"); | ||
font-weight: theme.font-weight("semibold"); | ||
flex-grow: 1; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import type { ReactNode } from "react"; | ||
|
||
import styles from "./page-layout.module.scss"; | ||
|
||
export const PageLayout = ({ children, title, actions }: { children: ReactNode; title: ReactNode, actions?: ReactNode }) => { | ||
return ( | ||
<div className={styles.pageLayout}> | ||
<div className={styles.pageTitleContainer}> | ||
<h1 className={styles.pageTitle}>{title}</h1> | ||
{actions && <div className={styles.actions}>{actions}</div>} | ||
</div> | ||
{children} | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 36 additions & 49 deletions
85
apps/insights/src/components/PriceFeeds/index.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't check this config in; this is a local setting and isn't intended to be checked in. We can gitignore this file instead.