Skip to content

Commit a9fb872

Browse files
authored
Merge pull request #372 from sg00dwin/7332-page-restructure
fix(quickstarts): restructure components to correct spacing and remove divider below toolbar
2 parents e17d31c + e26e2d2 commit a9fb872

File tree

4 files changed

+46
-28
lines changed

4 files changed

+46
-28
lines changed

packages/dev/src/AppCustomDrawer.tsx

+31-18
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import './App.css';
22
import {
33
Page,
4+
PageSection,
45
Button,
56
Drawer,
67
DrawerContent,
@@ -11,6 +12,8 @@ import {
1112
DrawerPanelDescription,
1213
DrawerPanelBody,
1314
DrawerContentBody,
15+
Stack,
16+
StackItem,
1417
} from '@patternfly/react-core';
1518
import {
1619
LoadingBox,
@@ -140,24 +143,34 @@ const App: React.FC<AppProps> = ({ children, showCardFooters }) => {
140143
>
141144
<DrawerContentBody>
142145
<Page masthead={AppHeader} sidebar={AppSidebar} isManagedSidebar>
143-
<Button
144-
variant="secondary"
145-
onClick={() => {
146-
toggleQuickStart('getting-started-with-quick-starts');
147-
setDrawerContent('quickstart');
148-
}}
149-
>
150-
Getting started with quick starts
151-
</Button>
152-
<Button
153-
variant="secondary"
154-
onClick={() => {
155-
setActiveQuickStartID('');
156-
setDrawerContent('custom');
157-
}}
158-
>
159-
Open a different drawer
160-
</Button>
146+
<PageSection>
147+
<Stack hasGutter>
148+
<StackItem>
149+
<Button
150+
variant="secondary"
151+
isBlock
152+
onClick={() => {
153+
toggleQuickStart('getting-started-with-quick-starts');
154+
setDrawerContent('quickstart');
155+
}}
156+
>
157+
Getting started with quick starts
158+
</Button>
159+
</StackItem>
160+
<StackItem>
161+
<Button
162+
variant="secondary"
163+
isBlock
164+
onClick={() => {
165+
setActiveQuickStartID('');
166+
setDrawerContent('custom');
167+
}}
168+
>
169+
Open a different drawer
170+
</Button>
171+
</StackItem>
172+
</Stack>
173+
</PageSection>
161174
{children}
162175
</Page>
163176
</DrawerContentBody>

packages/dev/src/AppProps.tsx

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import './App.css';
2-
import { Page, Button } from '@patternfly/react-core';
2+
import { Page, Button, PageSection } from '@patternfly/react-core';
33
import {
44
LoadingBox,
55
QuickStartContainer,
@@ -80,12 +80,15 @@ const App: React.FC<AppProps> = ({ children, showCardFooters }) => {
8080
<React.Suspense fallback={<LoadingBox />}>
8181
<QuickStartContainer {...drawerProps}>
8282
<Page masthead={AppHeader} sidebar={AppSidebar} isManagedSidebar>
83-
<Button
84-
variant="secondary"
85-
onClick={() => toggleQuickStart('getting-started-with-quick-starts')}
86-
>
87-
Getting started with quick starts
88-
</Button>
83+
<PageSection>
84+
<Button
85+
variant="secondary"
86+
isBlock
87+
onClick={() => toggleQuickStart('getting-started-with-quick-starts')}
88+
>
89+
Getting started with quick starts
90+
</Button>
91+
</PageSection>
8992
{children}
9093
</Page>
9194
</QuickStartContainer>

packages/dev/src/CustomCatalog.tsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -238,17 +238,20 @@ export const CustomCatalog: React.FC = () => {
238238

239239
return (
240240
<>
241-
<PageSection hasBodyWrapper={false}>
241+
<PageSection>
242242
<QuickStartCatalogHeader title="Resources" />
243+
</PageSection>
244+
<PageSection>
243245
<Divider component="div" />
246+
</PageSection>
247+
<PageSection>
244248
<QuickStartCatalogToolbar>
245249
<ToolbarContent>
246250
<QuickStartCatalogFilterSearchWrapper onSearchInputChange={onSearchInputChange} />
247251
<QuickStartCatalogFilterStatusWrapper onStatusChange={onStatusChange} />
248252
<QuickStartCatalogFilterCountWrapper quickStartsCount={filteredQuickStarts.length} />
249253
</ToolbarContent>
250254
</QuickStartCatalogToolbar>
251-
<Divider component="div" />
252255
</PageSection>
253256
<PageSection hasBodyWrapper={false}>{quickStartCatalog()}</PageSection>
254257
</>

packages/module/src/QuickStartCatalogPage.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ export const QuickStartCatalogPage: React.FC<QuickStartCatalogPageProps> = ({
181181
onSearchInputChange={onSearchInputChange}
182182
onStatusChange={onStatusChange}
183183
/>
184-
<Divider component="div" />
185184
</>
186185
)}
187186
</PageSection>

0 commit comments

Comments
 (0)