-
Notifications
You must be signed in to change notification settings - Fork 0
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 #22 from naseeihity/develop
Develop
- Loading branch information
Showing
9 changed files
with
428 additions
and
62 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from 'react'; | ||
|
||
const BreakView = props => { | ||
const label = props.breakLabel; | ||
const className = props.breakClassName || 'break'; | ||
|
||
return ( | ||
<li className={className} data-index={props.index}> | ||
{React.cloneElement(label, { to: `${props.to}/${props.index + 1}` })} | ||
</li> | ||
); | ||
}; | ||
|
||
export default BreakView; |
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,42 @@ | ||
import React from 'react'; | ||
import { Link } from 'react-router-dom'; | ||
|
||
const PageView = props => { | ||
let cssClassName = props.pageClassName; | ||
const linkClassName = props.pageLinkClassName; | ||
const { onClick, href, to, page } = props; | ||
const url = `${to}/${page}` || href; | ||
|
||
let ariaLabel = `Page ${props.page}${ | ||
props.extraAriaContext ? ` ${props.extraAriaContext}` : '' | ||
}`; | ||
let ariaCurrent = null; | ||
|
||
if (props.selected) { | ||
ariaCurrent = 'page'; | ||
ariaLabel = `Page ${props.page} is your current page`; | ||
if (typeof cssClassName !== 'undefined') { | ||
cssClassName = `${cssClassName} ${props.activeClassName}`; | ||
} else { | ||
cssClassName = props.activeClassName; | ||
} | ||
} | ||
|
||
return ( | ||
<li className={cssClassName}> | ||
<Link | ||
to={url} | ||
onClick={onClick} | ||
className={linkClassName} | ||
tabIndex="0" | ||
aria-label={ariaLabel} | ||
aria-current={ariaCurrent} | ||
onKeyPress={onClick} | ||
> | ||
{props.page} | ||
</Link> | ||
</li> | ||
); | ||
}; | ||
|
||
export default PageView; |
Oops, something went wrong.