-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3799 from mbrookes/leftnav-rename-to-drawer
[LeftNav] Rename to Drawer
- Loading branch information
Showing
19 changed files
with
159 additions
and
165 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
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
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
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,55 @@ | ||
import React from 'react'; | ||
import Title from 'react-title-component'; | ||
|
||
import CodeExample from '../../../CodeExample'; | ||
import PropTypeDescription from '../../../PropTypeDescription'; | ||
import MarkdownElement from '../../../MarkdownElement'; | ||
|
||
import drawerReadmeText from './README'; | ||
import DrawerSimpleExample from './ExampleSimple'; | ||
import drawerSimpleExampleCode from '!raw!./ExampleSimple'; | ||
import DrawerUndockedExample from './ExampleUndocked'; | ||
import drawerUndockedExampleCode from '!raw!./ExampleUndocked'; | ||
import DrawerOpenSecondaryExample from './ExampleOpenSecondary'; | ||
import drawerOpenSecondaryExampleCode from '!raw!./ExampleOpenSecondary'; | ||
import drawerCode from '!raw!material-ui/lib/Drawer/Drawer'; | ||
|
||
const descriptions = { | ||
simple: 'A simple controlled `Drawer`. The Drawer is `docked` by default, ' + | ||
'remaining open unless closed through the `open` prop.', | ||
undocked: 'An undocked controlled `Drawer` with custom width. ' + | ||
'The Drawer can be cancelled by clicking the overlay or pressing the Esc key. ' + | ||
'It closes when an item is selected, handled by controlling the `open` prop.', | ||
right: 'The `openSecondary` prop allows the Drawer to open on the opposite side.', | ||
}; | ||
|
||
const DrawerPage = () => ( | ||
<div> | ||
<Title render={(previousTitle) => `Drawer - ${previousTitle}`} /> | ||
<MarkdownElement text={drawerReadmeText} /> | ||
<CodeExample | ||
title="Docked example" | ||
description={descriptions.simple} | ||
code={drawerSimpleExampleCode} | ||
> | ||
<DrawerSimpleExample /> | ||
</CodeExample> | ||
<CodeExample | ||
title="Undocked example" | ||
description={descriptions.undocked} | ||
code={drawerUndockedExampleCode} | ||
> | ||
<DrawerUndockedExample /> | ||
</CodeExample> | ||
<CodeExample | ||
title="Open secondary example" | ||
description={descriptions.right} | ||
code={drawerOpenSecondaryExampleCode} | ||
> | ||
<DrawerOpenSecondaryExample /> | ||
</CodeExample> | ||
<PropTypeDescription code={drawerCode} /> | ||
</div> | ||
); | ||
|
||
export default DrawerPage; |
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,9 @@ | ||
## Drawer | ||
|
||
The [Drawer](https://www.google.com/design/spec/patterns/navigation-drawer.html) slides in from the side. | ||
It is a common pattern found in Google apps and follows the keylines and metrics for lists. | ||
|
||
There are no examples for uncontrolled mode because an uncontrolled `Drawer` can only be opened with a swipe. | ||
The doc site has an uncontrolled `Drawer`. Swipe from the left on a touch device to see it. | ||
|
||
### Examples |
Oops, something went wrong.