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

update landing page styling #427

Merged
merged 6 commits into from
Nov 27, 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
25 changes: 17 additions & 8 deletions src/app/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,25 @@
min-height: 500px;
}

.pf-v5-c-card__body {
display: flex;
flex-direction: column;
.apid-tags__main {
margin-top: auto;
padding-top: var(--pf-v5-global--spacer--sm);
.pf-v5-c-card {
--pf-v5-c-card--m-selectable-raised--hover--before--BackgroundColor: none;
&__header {
background: var(--pf-v5-global--BackgroundColor--150);
}
svg {
width: 38px;
height: 38px;
width: 28px;
}
&__body {
display: flex;
flex-direction: column;
.apid-tags__main {
margin-top: auto;
padding-top: var(--pf-v5-global--spacer--sm);
}
svg {
width: 38px;
height: 38px;
}
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,14 @@ export default function Home() {

<PageSection variant={PageSectionVariants.light} className="pf-v5-u-p-md">
<Flex direction={{ default: 'rowReverse' }}>
<Split className="apid-split-l-pagination">
<Split className="apid-split-l-pagination pf-v5-u-align-items-center-on-xl">
<SplitItem className="pf-v5-u-pb-md pf-v5-u-pt-md-on-md pf-v5-u-pl-sm-on-md" isFilled>
<Button
className="pf-v5-u-mr-sm pf-v5-u-mb-sm"
component="a"
target="_blank"
href="https://developers.redhat.com/cheat-sheets/red-hat-insights-api-cheat-sheet"
variant="secondary"
variant="primary"
size="sm"
>
API Cheat Sheet
Expand Down
15 changes: 8 additions & 7 deletions src/components/Card/Card.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FunctionComponent, PropsWithChildren } from 'react';
import { Card as PFCard, CardBody, Split, SplitItem, Text, TextContent, TextVariants } from '@patternfly/react-core';
import { Card as PFCard, CardBody, CardHeader, CardTitle, Divider, Split, SplitItem, Text, TextContent, TextVariants } from '@patternfly/react-core';
import Link from 'next/link';
import { APIConfigurationIcons } from '@apidocs/common';

Expand Down Expand Up @@ -32,18 +32,19 @@ export const Card: FunctionComponent<PropsWithChildren<CardProps>> = ({ apiId, d

return (
<Link href={to} style={{ textDecoration: 'none' }} className="pf-v5-u-color-100">
<PFCard role="link" isSelectable isFullHeight ouiaId={apiId}>
<CardBody>
<Split className="pf-v5-u-mb-sm">
<PFCard role="link" isSelectableRaised isFullHeight ouiaId={apiId}>
<CardHeader className="pf-v5-u-p-md pf-v5-u-pt-sm pf-v5-u-pb-0">
<Split className="pf-v5-u-mb-0">
<SplitItem>
<TitleIcon />
</SplitItem>
<SplitItem>
<Text component="p" className="pf-v5-u-font-size-md pf-v5-u-m-sm pf-v5-u-ml-md">
{displayName}
</Text>
<CardTitle className="pf-v5-u-pl-sm pf-v5-u-pt-sm pf-v5-u-align-self-flex-start">{displayName}</CardTitle>
</SplitItem>
</Split>
</CardHeader>
<Divider />
<CardBody className="pf-v5-u-p-md">
<TextContent>
<Text component={TextVariants.small}>{description}</Text>
</TextContent>
Expand Down
6 changes: 5 additions & 1 deletion src/components/Tags/Tag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,9 @@ const colorForLabelType = (type: APILabel['type']): LabelProps['color'] => {
};

export const Tag: FunctionComponent<TagProps> = ({ value }) => {
return <Label color={colorForLabelType(value.type)}>{value.name}</Label>;
return (
<Label color={colorForLabelType(value.type)} isCompact>
{value.name}
</Label>
);
};
6 changes: 5 additions & 1 deletion src/components/Tags/Tags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,9 @@ import { LabelGroup } from '@patternfly/react-core';

export const Tags: FunctionComponent<PropsWithChildren> = ({ children }) => {
const numLabels = Children.toArray(children).length <= 4 ? 4 : 3;
return <LabelGroup numLabels={numLabels}>{children}</LabelGroup>;
return (
<LabelGroup numLabels={numLabels} isCompact>
{children}
</LabelGroup>
);
};
Loading