Skip to content

Commit 193ce54

Browse files
committed
fix: adjustments for different window sizes
1 parent b7837c3 commit 193ce54

3 files changed

Lines changed: 11 additions & 114 deletions

File tree

packages/react-core/src/demos/Animations/AnimationsOverview.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export const AnimationsOverview: FunctionComponent<AnimationsOverviewProps> = ({
9494
// Card 4: Image
9595
<Card isFullHeight isPlain key="card-4">
9696
<CardBody>
97-
<img src={openshiftLogo} alt="OpenShift Logo" />
97+
<img src={openshiftLogo} alt="OpenShift Logo" style={{ width: '200px', height: '200px' }} />
9898
</CardBody>
9999
</Card>
100100
];
@@ -114,7 +114,7 @@ export const AnimationsOverview: FunctionComponent<AnimationsOverviewProps> = ({
114114
)}
115115
<PageSection aria-label="Detail status events">
116116
<Grid hasGutter>
117-
<GridItem span={3} rowSpan={4}>
117+
<GridItem span={12} sm={12} md={6} lg={4} xl={3} rowSpan={4}>
118118
<Card isFullHeight>
119119
<CardTitle>
120120
<Title headingLevel="h4" size="xl">
@@ -153,20 +153,20 @@ export const AnimationsOverview: FunctionComponent<AnimationsOverviewProps> = ({
153153
</CardFooter>
154154
</Card>
155155
</GridItem>
156-
<GridItem span={3} rowSpan={2}>
156+
<GridItem span={12} sm={12} md={6} lg={4} xl={3} rowSpan={2}>
157157
<AnimationsOverviewClusterInventory />
158158
</GridItem>
159-
<GridItem span={2} rowSpan={2}>
159+
<GridItem span={12} sm={12} md={6} lg={4} xl={2} rowSpan={2}>
160160
<AnimationsOverviewStorage />
161161
</GridItem>
162-
<GridItem span={4} rowSpan={2}>
162+
<GridItem span={12} sm={12} md={12} lg={12} xl={4} rowSpan={2}>
163163
<AnimationsOverviewMemoryUtilization />
164164
</GridItem>
165-
<GridItem span={4} rowSpan={2}>
165+
<GridItem span={12} sm={12} md={12} lg={12} xl={4} rowSpan={2}>
166166
<AnimationsOverviewNetworkActivity />
167167
</GridItem>
168168
{recentActivityCard && (
169-
<GridItem span={5} rowSpan={2}>
169+
<GridItem span={12} sm={12} md={12} lg={8} xl={5} rowSpan={2}>
170170
{recentActivityCard}
171171
</GridItem>
172172
)}

packages/react-core/src/demos/Animations/AnimationsOverviewMemoryUtilization.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,15 @@ export const MemoryUtilizationCard: React.FunctionComponent = () => {
7777
{ x: 'Warning at 60%', y: 60 },
7878
{ x: 'Danger at 90%', y: 90 }
7979
]}
80-
height={150}
80+
height={200}
8181
labels={({ datum }) => (datum.x ? datum.x : null)}
8282
padding={{
8383
bottom: 0,
8484
left: 0,
8585
right: 0,
8686
top: 10
8787
}}
88-
width={150}
88+
width={200}
8989
>
9090
<ChartDonutUtilization
9191
data={{ x: 'Memory capacity', y: 95 }}
@@ -105,15 +105,15 @@ export const MemoryUtilizationCard: React.FunctionComponent = () => {
105105
{ x: 'Warning at 60%', y: 60 },
106106
{ x: 'Danger at 90%', y: 90 }
107107
]}
108-
height={150}
108+
height={200}
109109
labels={({ datum }) => (datum.x ? datum.x : null)}
110110
padding={{
111111
bottom: 0,
112112
left: 0,
113113
right: 0,
114114
top: 10
115115
}}
116-
width={150}
116+
width={200}
117117
>
118118
<ChartDonutUtilization
119119
data={{ x: 'GPU capacity', y: 55 }}

packages/react-core/src/demos/Animations/examples/Animations.tsx

Lines changed: 0 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -710,109 +710,6 @@ const AnimationsPage: FunctionComponent = () => {
710710
};
711711

712712
// Can't break this into a separate file, seems we need to stay in the examples dir when using '@patternfly/react-table'
713-
// const AnimationsResourcesTable: FunctionComponent = () => {
714-
// const [areAllExpanded, setAreAllExpanded] = useState(false);
715-
// const [collapseAllAriaLabel, setCollapseAllAriaLabel] = useState('Expand all');
716-
// const [expandedAppNames, setExpandedAppNames] = useState(initialExpandedServerNames);
717-
// const [loading, setLoading] = useState(true);
718-
// const { tourStep, renderTourStepElement } = useGuidedTour();
719-
720-
// useEffect(() => {
721-
// const timer = setTimeout(() => setLoading(false), 2000);
722-
723-
// return () => {
724-
// if (timer) {
725-
// clearTimeout(timer);
726-
// }
727-
// };
728-
// }, [loading, tourStep?.stepId]);
729-
730-
// useEffect(() => {
731-
// const allExpanded = expandedAppNames.length === applicationsData.length;
732-
// setAreAllExpanded(allExpanded);
733-
// setCollapseAllAriaLabel(allExpanded ? 'Collapse all' : 'Expand all');
734-
// }, [expandedAppNames]);
735-
736-
// const setAppExpanded = (app: Application, isExpanding: boolean) => {
737-
// const others = expandedAppNames.filter((n) => n !== app.name);
738-
// setExpandedAppNames(isExpanding ? [...others, app.name] : others);
739-
// };
740-
741-
// const isAppExpanded = (app: Application) => expandedAppNames.includes(app.name);
742-
743-
// const onCollapseAll = (_event: any, _rowIndex: number, isOpen: boolean) => {
744-
// setExpandedAppNames(isOpen ? applicationsData.map((app) => app.name) : []);
745-
// };
746-
747-
// return (
748-
// <Card component="div">
749-
// {loading || tourStep?.stepId === 'skeletonLoader' ? (
750-
// <>
751-
// {renderTourStepElement(
752-
// 'skeletonLoader',
753-
// <SkeletonTable id="skeleton-table" columns={['', ...expandableColumns]} rows={8} />
754-
// )}
755-
// </>
756-
// ) : (
757-
// <Table aria-label="Collapsible table" isExpandable hasAnimations>
758-
// <Thead>
759-
// {renderTourStepElement(
760-
// 'expandableComponents',
761-
// <div content=" " style={{ width: 10, height: 10, position: 'absolute', left: 40, top: 20 }} />
762-
// )}
763-
// <Tr>
764-
// <Th
765-
// expand={{
766-
// areAllExpanded: !areAllExpanded,
767-
// collapseAllAriaLabel,
768-
// onToggle: onCollapseAll
769-
// }}
770-
// aria-label="Row expansion"
771-
// />
772-
// {expandableColumns.map((column) => (
773-
// <Th key={column}>{column}</Th>
774-
// ))}
775-
// </Tr>
776-
// </Thead>
777-
778-
// {applicationsData.map((app, idx) => (
779-
// <Tbody key={app.name} isExpanded={isAppExpanded(app)}>
780-
// <Tr isExpanded={isAppExpanded(app)}>
781-
// <Td
782-
// expand={
783-
// app.details
784-
// ? {
785-
// rowIndex: idx,
786-
// isExpanded: isAppExpanded(app),
787-
// onToggle: () => setAppExpanded(app, !isAppExpanded(app))
788-
// }
789-
// : undefined
790-
// }
791-
// />
792-
// <Td>{app.name}</Td>
793-
// <Td>{app.header}</Td>
794-
// <Td>{app.branch}</Td>
795-
// <Td>
796-
// {app.status === 'Running' && <Label status="success">Running</Label>}
797-
// {app.status === 'Degraded' && <Label status="warning">Degraded</Label>}
798-
// {app.status === 'Stopped' && <Label status="danger">Stopped</Label>}
799-
// {app.status !== 'Running' && app.status !== 'Degraded' && app.status !== 'Stopped' && app.status}
800-
// </Td>
801-
// </Tr>
802-
// <Tr isExpandable isExpanded={isAppExpanded(app)}>
803-
// <Td />
804-
// <Td colSpan={expandableColumns.length}>
805-
// <ExpandableRowContent>{app.details}</ExpandableRowContent>
806-
// </Td>
807-
// </Tr>
808-
// </Tbody>
809-
// ))}
810-
// </Table>
811-
// )}
812-
// </Card>
813-
// );
814-
// };
815-
816713
const AnimationsResourcesTable: FunctionComponent = () => {
817714
const [expandedAppNames, setExpandedAppNames] = useState(initialExpandedServerNames);
818715
const [loading, setLoading] = useState(true);

0 commit comments

Comments
 (0)