-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Sticky offset in nested AppLayout (#3013)
Co-authored-by: Boris Serdiuk <[email protected]>
- Loading branch information
1 parent
a4ba868
commit 40eb1f8
Showing
3 changed files
with
106 additions
and
5 deletions.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
pages/app-layout/multi-layout-with-table-sticky-header.page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import React from 'react'; | ||
|
||
import AppLayout from '~components/app-layout'; | ||
import Button from '~components/button'; | ||
import Header from '~components/header'; | ||
import Table from '~components/table'; | ||
|
||
import { generateItems, Instance } from '../table/generate-data'; | ||
import { columnsConfig } from '../table/shared-configs'; | ||
import ScreenshotArea from '../utils/screenshot-area'; | ||
import { Breadcrumbs, Navigation } from './utils/content-blocks'; | ||
import { Tools } from './utils/content-blocks'; | ||
import labels from './utils/labels'; | ||
import * as toolsContent from './utils/tools-content'; | ||
|
||
const items = generateItems(100); | ||
|
||
export default function () { | ||
return ( | ||
<ScreenshotArea gutters={false}> | ||
<AppLayout | ||
data-testid="main-layout" | ||
ariaLabels={labels} | ||
navigation={<Navigation />} | ||
toolsHide={true} | ||
disableContentPaddings={true} | ||
content={ | ||
<AppLayout | ||
data-testid="secondary-layout" | ||
ariaLabels={labels} | ||
breadcrumbs={<Breadcrumbs />} | ||
navigationHide={true} | ||
content={ | ||
<Table<Instance> | ||
header={ | ||
<Header | ||
variant="awsui-h1-sticky" | ||
description="Demo page with footer" | ||
actions={<Button variant="primary">Create</Button>} | ||
> | ||
Sticky Scrollbar Example | ||
</Header> | ||
} | ||
stickyHeader={true} | ||
variant="full-page" | ||
columnDefinitions={columnsConfig} | ||
items={items} | ||
/> | ||
} | ||
tools={<Tools>{toolsContent.long}</Tools>} | ||
/> | ||
} | ||
/> | ||
</ScreenshotArea> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters