Skip to content
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

Show Package name when displaying PackageCard #38

Merged
merged 4 commits into from
Apr 7, 2024
Merged
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
10 changes: 8 additions & 2 deletions components/PackageCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import { isFeatured } from "../api/packageFeatured";
import { TagBadgeGroup } from "./Tags/TagBadgeGroup";
import { FeaturedBadge } from "./featured";
import { Stack } from "./layout";
import { PackageNamer } from "./PackageNamer";
import { record } from "fp-ts";
import { pipe } from "fp-ts/function";
import { NextjsLink } from "./NextjsLink";


type Props = {
package: Package;
onTagClick: (tag: string) => unknown;
Expand Down Expand Up @@ -40,8 +42,12 @@ export const PackageCard = (
<Stack units={1} direction="column">
<Pane display="flex">
<Heading flex={1}>{props.package.title}</Heading>
{props.hideFeaturedBadge ||
(isFeatured(props.package) && <FeaturedBadge />)}

<Card display="flex" alignItems="center">
<PackageNamer package={props.package} />
{props.hideFeaturedBadge ||
(isFeatured(props.package) && <FeaturedBadge />)}
</Card>
</Pane>
<Text>{props.package.description}</Text>
</Stack>
Expand Down
17 changes: 17 additions & 0 deletions components/PackageNamer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Code, majorScale } from "evergreen-ui";
import { Package } from "../api/domain";
import { espansoTheme } from "./EspansoThemeProvider";

type Props = {
package: Package;
};

export const PackageNamer = (props: Props) => (
<Code
paddingRight={majorScale(1)}
appearance="minimal"
color={espansoTheme.colors.green600}
>
{props.package.name}
</Code>
);
1 change: 1 addition & 0 deletions components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export * from "./layout";
export * from "./MDXRenderer";
export * from "./Navbar";
export * from "./PackageCard";
export * from "./PackageNamer"
export * from "./Tags/TagBadgeGroup";
export * from "./BetaBanner";
export * from "./Footer";
Expand Down
21 changes: 16 additions & 5 deletions pages/[packageName]/v/[version].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ import {
MDXRenderer,
Navbar,
NextjsLink,
PackageNamer,
Stack,
TabProps,
TagBadgeGroup,
Expand Down Expand Up @@ -262,7 +263,7 @@ const VersionedPackagePage = (props: Props) => {
mobile: () => 600,
})}
>
{currentRepo.package.name}
{currentRepo.package.title}
</Heading>
{isFeatured(currentRepo.package) && <FeaturedBadge />}
</Stack>
Expand Down Expand Up @@ -325,17 +326,27 @@ const VersionedPackagePage = (props: Props) => {
)}
</Stack>
</Pane>

<Text
size={foldDevices({
desktop: () => 400,
tablet: () => 300,
mobile: () => 300,
})}
color={espansoTheme.colors.muted}
>
By {currentRepo.manifest.author}
</Text>
>
<PackageNamer package={currentRepo.package} />
</Text>
<Text
size={foldDevices({
desktop: () => 400,
tablet: () => 300,
mobile: () => 300,
})}
color={espansoTheme.colors.muted}
>
By {currentRepo.manifest.author}
</Text>
</Stack>
<Paragraph
size={foldDevices({
Expand Down
Loading