Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
1,695 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/* eslint react/no-multi-comp: 0, react/prop-types: 0 */ | ||
import React from 'react'; | ||
import { PrismCode } from 'react-prism'; | ||
import PageTitle from '../UI/PageTitle'; | ||
import SectionTitle from '../UI/SectionTitle'; | ||
|
||
import OffcanvasExample from '../examples/Offcanvas'; | ||
const OffcanvasExampleSource = require('!!raw-loader!../examples/Offcanvas'); | ||
|
||
export default class OffcanvasPage extends React.Component { | ||
render() { | ||
return ( | ||
<div> | ||
<PageTitle title="Offcanvas" /> | ||
<div className="docs-example"> | ||
<OffcanvasExample /> | ||
</div> | ||
<pre> | ||
<PrismCode className="language-jsx"> | ||
{OffcanvasExampleSource} | ||
</PrismCode> | ||
</pre> | ||
<SectionTitle>Properties</SectionTitle> | ||
<pre> | ||
<PrismCode className="language-jsx"> | ||
{` | ||
Offcanvas.propTypes = { | ||
autoFocus: PropTypes.bool, | ||
backdrop: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['static'])]), | ||
backdropClassName: PropTypes.string, | ||
backdropTransition: FadePropTypes, | ||
children: PropTypes.node, | ||
className: PropTypes.string, | ||
container: targetPropType, | ||
cssModule: PropTypes.object, | ||
direction: PropTypes.oneOf(['start', 'end', 'bottom', 'left', 'right']), | ||
fade: PropTypes.bool, | ||
innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.string, PropTypes.func,]), | ||
isOpen: PropTypes.bool, | ||
keyboard: PropTypes.bool, | ||
labelledBy: PropTypes.string, | ||
offcanvasClassName: PropTypes.string, | ||
offcanvasTransition: FadePropTypes, | ||
onClosed: PropTypes.func, | ||
onEnter: PropTypes.func, | ||
onExit: PropTypes.func, | ||
onOpened: PropTypes.func, | ||
returnFocusAfterClose: PropTypes.bool, | ||
role: PropTypes.string, | ||
scrollable: PropTypes.bool, | ||
toggle: PropTypes.func, | ||
trapFocus: PropTypes.bool, | ||
unmountOnClose: PropTypes.bool, | ||
wrapClassName: PropTypes.string, | ||
zIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string,]) | ||
} | ||
OffcanvasBody.propTypes = { | ||
tag: tagPropType, | ||
className: PropTypes.string, | ||
cssModule: PropTypes.object, | ||
} | ||
OffcanvasHeader.propTypes = { | ||
children: PropTypes.node, | ||
className: PropTypes.string, | ||
close: PropTypes.object, | ||
closeAriaLabel: PropTypes.string, | ||
cssModule: PropTypes.object, | ||
tag: tagPropType, | ||
toggle: PropTypes.func, | ||
wrapTag: tagPropType | ||
} | ||
`} | ||
</PrismCode> | ||
</pre> | ||
</div> | ||
); | ||
} | ||
} |
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,60 @@ | ||
import React, { useState } from 'react'; | ||
import { Button, ButtonToolbar, Offcanvas, OffcanvasBody, OffcanvasHeader } from 'reactstrap'; | ||
|
||
const Example = () => { | ||
const [direction, setDirection] = useState(); | ||
const [open, setOpen] = useState(); | ||
const toggle = () => setOpen(!open); | ||
|
||
return ( | ||
<div> | ||
<ButtonToolbar> | ||
<Button | ||
color="primary" | ||
onClick={() => { | ||
setDirection('start'); | ||
setOpen(true); | ||
}} | ||
> | ||
Open Start (default) | ||
</Button> | ||
<Button | ||
onClick={() => { | ||
setDirection('end'); | ||
setOpen(true); | ||
}} | ||
> | ||
Open End | ||
</Button> | ||
<Button | ||
color="success" | ||
onClick={() => { | ||
setDirection('top'); | ||
setOpen(true); | ||
}} | ||
> | ||
Open Top | ||
</Button> | ||
<Button | ||
color="danger" | ||
onClick={() => { | ||
setDirection('bottom'); | ||
setOpen(true); | ||
}} | ||
> | ||
Open Bottom | ||
</Button> | ||
</ButtonToolbar> | ||
<Offcanvas isOpen={open} direction={direction} toggle={toggle}> | ||
<OffcanvasHeader toggle={toggle}> | ||
Offcanvas {direction} | ||
</OffcanvasHeader> | ||
<OffcanvasBody> | ||
<strong>This is the Offcanvas body.</strong> | ||
</OffcanvasBody> | ||
</Offcanvas> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Example; |
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
Oops, something went wrong.