-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated header documentation. (#1646)
Co-authored-by: Mayank <[email protected]>
- Loading branch information
1 parent
7347dbe
commit 01104ac
Showing
5 changed files
with
180 additions
and
80 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Bentley Systems, Incorporated. All rights reserved. | ||
* See LICENSE.md in the project root for license terms and full copyright notice. | ||
*--------------------------------------------------------------------------------------------*/ | ||
import React from 'react'; | ||
import { | ||
Header, | ||
HeaderBreadcrumbs, | ||
HeaderButton, | ||
HeaderLogo, | ||
IconButton, | ||
MenuItem, | ||
Avatar, | ||
} from '@itwin/itwinui-react'; | ||
import { SvgNotification, SvgPlaceholder } from '@itwin/itwinui-icons-react'; | ||
|
||
export default () => { | ||
const menuItems = (close: () => void) => [ | ||
<MenuItem key={1} value={'Item #1'} onClick={close}> | ||
Item #1 | ||
</MenuItem>, | ||
<MenuItem key={2} value={'Item #2'} onClick={close}> | ||
Item #2 | ||
</MenuItem>, | ||
<MenuItem key={3} value={'Item #3'} onClick={close}> | ||
Item #3 | ||
</MenuItem>, | ||
]; | ||
|
||
return ( | ||
<Header | ||
appLogo={<HeaderLogo logo={<SvgPlaceholder />}>Acme</HeaderLogo>} | ||
breadcrumbs={ | ||
<HeaderBreadcrumbs | ||
items={[ | ||
<HeaderButton | ||
key='project' | ||
name='Project A' | ||
description='YJC-2249' | ||
onClick={() => {}} | ||
menuItems={menuItems} | ||
/>, | ||
<HeaderButton | ||
as='a' | ||
href='' | ||
key='iModel' | ||
name='iModel B' | ||
startIcon={ | ||
<img src='https://itwinplatformcdn.azureedge.net/iTwinUI/stadium.png' /> | ||
} | ||
/>, | ||
<HeaderButton | ||
key='version' | ||
name='Version C' | ||
menuItems={menuItems} | ||
isActive={true} | ||
/>, | ||
]} | ||
/> | ||
} | ||
actions={[ | ||
<IconButton | ||
key='notif' | ||
styleType='borderless' | ||
aria-label='View Notifications' | ||
> | ||
<SvgNotification /> | ||
</IconButton>, | ||
<IconButton styleType='borderless' aria-label='View Profile'> | ||
<Avatar abbreviation='TR' title='Terry Rivers' /> | ||
</IconButton>, | ||
]} | ||
menuItems={menuItems} | ||
/> | ||
); | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Bentley Systems, Incorporated. All rights reserved. | ||
* See LICENSE.md in the project root for license terms and full copyright notice. | ||
*--------------------------------------------------------------------------------------------*/ | ||
import * as React from 'react'; | ||
import { | ||
Avatar, | ||
Header, | ||
HeaderBreadcrumbs, | ||
HeaderButton, | ||
HeaderLogo, | ||
IconButton, | ||
MenuItem, | ||
} from '@itwin/itwinui-react'; | ||
import { SvgPlaceholder } from '@itwin/itwinui-icons-react'; | ||
|
||
export default () => { | ||
const menuItems = (close: () => void) => [ | ||
<MenuItem key={1} value={'Item #1'} onClick={close}> | ||
Item #1 | ||
</MenuItem>, | ||
<MenuItem key={2} value={'Item #2'} onClick={close}> | ||
Item #2 | ||
</MenuItem>, | ||
<MenuItem key={3} value={'Item #3'} onClick={close}> | ||
Item #3 | ||
</MenuItem>, | ||
]; | ||
|
||
return ( | ||
<Header | ||
isSlim | ||
appLogo={<HeaderLogo logo={<SvgPlaceholder />}>Acme</HeaderLogo>} | ||
breadcrumbs={ | ||
<HeaderBreadcrumbs | ||
items={[ | ||
<HeaderButton | ||
key='project' | ||
name='Project A' | ||
description='YJC-2249' | ||
onClick={() => {}} | ||
menuItems={menuItems} | ||
/>, | ||
<HeaderButton | ||
key='iModel' | ||
name='iModel B' | ||
startIcon={ | ||
<img src='https://itwinplatformcdn.azureedge.net/iTwinUI/stadium.png' /> | ||
} | ||
onClick={() => {}} | ||
/>, | ||
<HeaderButton | ||
key='version' | ||
name='Version C' | ||
menuItems={menuItems} | ||
isActive={true} | ||
/>, | ||
]} | ||
/> | ||
} | ||
actions={[ | ||
<IconButton styleType='borderless' aria-label='View profile'> | ||
<Avatar abbreviation='TR' title='Terry Rivers' /> | ||
</IconButton>, | ||
]} | ||
/> | ||
); | ||
}; |
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