-
Notifications
You must be signed in to change notification settings - Fork 281
feat(showcase): new page to display config #201
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
Open
DeadEnglish
wants to merge
19
commits into
ghostty-org:main
Choose a base branch
from
DeadEnglish:feature/showcase-quick-pass
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 4 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
f4178ff
feat(card): update to allow image & only pad content
DeadEnglish 2013683
feat(showcase): initial layout
DeadEnglish 89684f1
chore: use proper image props
DeadEnglish 5dbb444
feat(showcase): mobile layout
DeadEnglish beecd7f
chore(generic-card): move changes to showcase list item
DeadEnglish ba49f6a
chore(generic-card): remove left over props
DeadEnglish 78149d4
feat(modal): very rough WIP
DeadEnglish 00d3be9
Merge branch 'main' into feature/showcase-quick-pass
DeadEnglish b6d1744
feat(showcase): proper code rather than placeholder
DeadEnglish ce2c3a9
feat(showcase): get content from json config
DeadEnglish 738e211
chore: minor UI changes
DeadEnglish 06b02b6
core: typo
DeadEnglish e157991
chore: moving types because next
DeadEnglish 7b5be66
chore: one more type
DeadEnglish 9cd62f4
Merge branch 'main' into feature/showcase-quick-pass
DeadEnglish b6f6579
fix(modal): better close positioning
DeadEnglish 801b46e
feat(tags): component and minor styling changes
DeadEnglish 475f47c
chore(showcase): move components due to pre-rendering
DeadEnglish 4ed9573
chore: remove p;laceholder
DeadEnglish 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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,25 +1,31 @@ | ||
| import { SpacingProp } from "@/types/style"; | ||
| import { H2, P } from "../text"; | ||
| import s from "./GenericCard.module.css"; | ||
| import Image, { ImageProps } from "next/image"; | ||
|
|
||
| interface GenericCardProps { | ||
| title: string; | ||
| image?: ImageProps; | ||
| description: string; | ||
| padding?: SpacingProp; | ||
| children?: React.ReactNode; | ||
| } | ||
|
|
||
| export default function GenericCard({ | ||
| title, | ||
| image, | ||
| padding = "56px", | ||
| description, | ||
| children, | ||
| }: GenericCardProps) { | ||
| return ( | ||
| <div className={s.genericCard} style={{ padding }}> | ||
| <H2 className={s.title}>{title}</H2> | ||
| <P className={s.description}>{description}</P> | ||
| {children ? <div className={s.children}>{children}</div> : null} | ||
| <div className={s.genericCard}> | ||
| {image ? <Image {...image} /> : null} | ||
| <div style={{ padding }}> | ||
| <H2 className={s.title}>{title}</H2> | ||
| <P className={s.description}>{description}</P> | ||
| {children ? <div className={s.children}>{children}</div> : null} | ||
| </div> | ||
| </div> | ||
| ); | ||
| } | ||
This file contains hidden or 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,32 @@ | ||
| .showcasePage { | ||
|
|
||
| & .header { | ||
| padding: 0 0 28px; | ||
| } | ||
|
|
||
| & .list { | ||
| --gap: 24px; | ||
| --cols: 3; | ||
|
|
||
| @media(max-width: 1100px) { | ||
| --cols: 2; | ||
| } | ||
|
|
||
| @media(max-width: 768px) { | ||
| --cols: 1; | ||
| } | ||
|
|
||
| margin: 0; | ||
| padding: 0; | ||
| list-style: none; | ||
| display: flex; | ||
| flex-wrap: wrap; | ||
| gap: var(--gap); | ||
|
|
||
| &>li { | ||
| --flex-basis: calc((100% / var(--cols)) - (var(--gap) * (var(--cols) - 1)) / var(--cols)); | ||
| flex-basis: var(--flex-basis); | ||
| max-width: var(--flex-basis); | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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,6 @@ | ||
| .ListItem { | ||
| & img { | ||
| width: 100%; | ||
| height: auto; | ||
| } | ||
| } |
This file contains hidden or 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,22 @@ | ||
| import GenericCard from "@/components/generic-card"; | ||
| import s from "./ListItem.module.css"; | ||
| import Button from "@/components/button"; | ||
| import { ImageProps } from "next/image"; | ||
|
|
||
| interface ListItemProps { | ||
| image: ImageProps; | ||
| } | ||
| export default function ListItem({ image }: ListItemProps) { | ||
| return ( | ||
| <li className={s.ListItem}> | ||
| <GenericCard | ||
| title="title" | ||
| description="desc" | ||
| padding="12px 12px 24px" | ||
| image={image} | ||
| > | ||
| <Button theme="brand">View config</Button> | ||
| </GenericCard> | ||
| </li> | ||
| ); | ||
| } |
This file contains hidden or 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,68 @@ | ||
| import { NavTreeNode } from "@/components/nav-tree"; | ||
| import { H1, P } from "@/components/text"; | ||
| import NavFooterLayout from "@/layouts/nav-footer-layout"; | ||
| import { DOCS_DIRECTORY } from "../docs/[...path]"; | ||
| import { loadDocsNavTreeData } from "@/lib/fetch-nav"; | ||
| import SectionWrapper from "@/components/section-wrapper"; | ||
| import s from "./ShowcasePage.module.css"; | ||
| import ListItem from "./components/list-item/list-item"; | ||
| import { useRouter } from "next/router"; | ||
| import { useEffect } from "react"; | ||
|
|
||
| interface ShowcasePageProps { | ||
| docsNavTree: NavTreeNode[]; | ||
| isDevelopment: boolean; | ||
| } | ||
|
|
||
| export async function getStaticProps(): Promise<{ props: ShowcasePageProps }> { | ||
| return { | ||
| props: { | ||
| isDevelopment: process.env.NODE_ENV === "development", | ||
| docsNavTree: await loadDocsNavTreeData(DOCS_DIRECTORY, ""), | ||
| }, | ||
| }; | ||
| } | ||
|
|
||
| export default function Showcase({ | ||
| docsNavTree, | ||
| isDevelopment, | ||
| }: ShowcasePageProps) { | ||
| const router = useRouter(); | ||
|
|
||
| //TODO: This is gross, there's probably a better way to hide this route from prod | ||
| useEffect(() => { | ||
| if (!isDevelopment) { | ||
| router.push("/"); | ||
| } | ||
| }); | ||
|
|
||
| return ( | ||
| <NavFooterLayout | ||
| docsNavTree={docsNavTree} | ||
| meta={{ | ||
| title: "Ghostty config showcase", | ||
| description: "A curated list of Ghostty configs from our comminuty", | ||
| }} | ||
| > | ||
| <SectionWrapper className={s.showcasePage}> | ||
| <header className={s.header}> | ||
| <H1>Showcase</H1> | ||
| <P>A curated list of Ghostty configs from our comminuty</P> | ||
| </header> | ||
| <ul className={s.list}> | ||
| {Array.from(Array(12).keys(), (_, index) => ( | ||
| <ListItem | ||
| key={index} | ||
| image={{ | ||
| src: "/placeholder.png", | ||
| alt: "placeholder image", | ||
| width: 500, | ||
| height: 300, | ||
| }} | ||
| /> | ||
| ))} | ||
| </ul> | ||
| </SectionWrapper> | ||
| </NavFooterLayout> | ||
| ); | ||
| } |
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.
Uh oh!
There was an error while loading. Please reload this page.