Skip to content

Commit

Permalink
Update active class on owned-card-list
Browse files Browse the repository at this point in the history
  • Loading branch information
aweiksnar committed Dec 10, 2015
1 parent efc71ae commit a574807
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
12 changes: 11 additions & 1 deletion app/components/owned-card-list.cjsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ module.exports = React.createClass
'All'

render: ->
{location} = @props

<div className="secondary-page all-resources-page">
<section className={"hero #{@props.heroClass}"}>
<div className="hero-container">
Expand Down Expand Up @@ -65,7 +67,15 @@ module.exports = React.createClass
{if meta
<nav className="pagination">
{for page in [1..meta.page_count]
<Link to={"#{@props.linkTo}?page=#{page}"} activeClassName="active" key={page} className="pill-button" style={border: "2px solid" if page is 1 and window.location.search is ""}>{page}</Link>}
active = (page is +location.query.page) or (page is 1 and not location.search)
<Link
key={page}
to={"#{@props.linkTo}?page=#{page}"}
activeClassName="active"
className="pill-button"
style={border: "2px solid" if active}>
{page}
</Link>}
</nav>}
</nav>
</div>
Expand Down
1 change: 1 addition & 0 deletions app/pages/collections.cjsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ List = React.createClass

render: ->
<OwnedCardList
{...@props}
translationObjectName="collectionsPage"
listPromise={@listCollections()}
linkTo="collections"
Expand Down
1 change: 1 addition & 0 deletions app/pages/projects.cjsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ module.exports = React.createClass

render: ->
<OwnedCardList
{...@props}
translationObjectName="projectsPage"
listPromise={@listProjects()}
linkTo="projects"
Expand Down

0 comments on commit a574807

Please sign in to comment.