Skip to content

Commit 6ca1200

Browse files
authored
update landing page styling (#427)
* update landing page styling * lint fix * use compact label variant * update label groups * fix toggle button positioning * lint fix
1 parent 9241970 commit 6ca1200

File tree

5 files changed

+37
-19
lines changed

5 files changed

+37
-19
lines changed

src/app/App.scss

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,25 @@
4747
min-height: 500px;
4848
}
4949

50-
.pf-v5-c-card__body {
51-
display: flex;
52-
flex-direction: column;
53-
.apid-tags__main {
54-
margin-top: auto;
55-
padding-top: var(--pf-v5-global--spacer--sm);
50+
.pf-v5-c-card {
51+
--pf-v5-c-card--m-selectable-raised--hover--before--BackgroundColor: none;
52+
&__header {
53+
background: var(--pf-v5-global--BackgroundColor--150);
5654
}
5755
svg {
58-
width: 38px;
59-
height: 38px;
56+
width: 28px;
57+
}
58+
&__body {
59+
display: flex;
60+
flex-direction: column;
61+
.apid-tags__main {
62+
margin-top: auto;
63+
padding-top: var(--pf-v5-global--spacer--sm);
64+
}
65+
svg {
66+
width: 38px;
67+
height: 38px;
68+
}
6069
}
6170
}
6271
}

src/app/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,14 @@ export default function Home() {
129129

130130
<PageSection variant={PageSectionVariants.light} className="pf-v5-u-p-md">
131131
<Flex direction={{ default: 'rowReverse' }}>
132-
<Split className="apid-split-l-pagination">
132+
<Split className="apid-split-l-pagination pf-v5-u-align-items-center-on-xl">
133133
<SplitItem className="pf-v5-u-pb-md pf-v5-u-pt-md-on-md pf-v5-u-pl-sm-on-md" isFilled>
134134
<Button
135135
className="pf-v5-u-mr-sm pf-v5-u-mb-sm"
136136
component="a"
137137
target="_blank"
138138
href="https://developers.redhat.com/cheat-sheets/red-hat-insights-api-cheat-sheet"
139-
variant="secondary"
139+
variant="primary"
140140
size="sm"
141141
>
142142
API Cheat Sheet

src/components/Card/Card.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { FunctionComponent, PropsWithChildren } from 'react';
2-
import { Card as PFCard, CardBody, Split, SplitItem, Text, TextContent, TextVariants } from '@patternfly/react-core';
2+
import { Card as PFCard, CardBody, CardHeader, CardTitle, Divider, Split, SplitItem, Text, TextContent, TextVariants } from '@patternfly/react-core';
33
import Link from 'next/link';
44
import { APIConfigurationIcons } from '@apidocs/common';
55

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

3333
return (
3434
<Link href={to} style={{ textDecoration: 'none' }} className="pf-v5-u-color-100">
35-
<PFCard role="link" isSelectable isFullHeight ouiaId={apiId}>
36-
<CardBody>
37-
<Split className="pf-v5-u-mb-sm">
35+
<PFCard role="link" isSelectableRaised isFullHeight ouiaId={apiId}>
36+
<CardHeader className="pf-v5-u-p-md pf-v5-u-pt-sm pf-v5-u-pb-0">
37+
<Split className="pf-v5-u-mb-0">
3838
<SplitItem>
3939
<TitleIcon />
4040
</SplitItem>
4141
<SplitItem>
42-
<Text component="p" className="pf-v5-u-font-size-md pf-v5-u-m-sm pf-v5-u-ml-md">
43-
{displayName}
44-
</Text>
42+
<CardTitle className="pf-v5-u-pl-sm pf-v5-u-pt-sm pf-v5-u-align-self-flex-start">{displayName}</CardTitle>
4543
</SplitItem>
4644
</Split>
45+
</CardHeader>
46+
<Divider />
47+
<CardBody className="pf-v5-u-p-md">
4748
<TextContent>
4849
<Text component={TextVariants.small}>{description}</Text>
4950
</TextContent>

src/components/Tags/Tag.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,9 @@ const colorForLabelType = (type: APILabel['type']): LabelProps['color'] => {
2121
};
2222

2323
export const Tag: FunctionComponent<TagProps> = ({ value }) => {
24-
return <Label color={colorForLabelType(value.type)}>{value.name}</Label>;
24+
return (
25+
<Label color={colorForLabelType(value.type)} isCompact>
26+
{value.name}
27+
</Label>
28+
);
2529
};

src/components/Tags/Tags.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,9 @@ import { LabelGroup } from '@patternfly/react-core';
33

44
export const Tags: FunctionComponent<PropsWithChildren> = ({ children }) => {
55
const numLabels = Children.toArray(children).length <= 4 ? 4 : 3;
6-
return <LabelGroup numLabels={numLabels}>{children}</LabelGroup>;
6+
return (
7+
<LabelGroup numLabels={numLabels} isCompact>
8+
{children}
9+
</LabelGroup>
10+
);
711
};

0 commit comments

Comments
 (0)