Skip to content

Commit

Permalink
auth for game edit
Browse files Browse the repository at this point in the history
  • Loading branch information
johngibbons committed Feb 27, 2016
1 parent f4c2ad6 commit 9d00618
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 11 deletions.
6 changes: 3 additions & 3 deletions build/bundle.js

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion sass/components/answer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
font-weight: 300;
color: $gray-light;
padding: 0.5rem 1.25rem;
background-color: white;
transition: $base-transition;

.right-centered {
position: absolute;
Expand All @@ -38,12 +40,17 @@
width: calc(100% - 1em);
}

&.selected, &:focus, &:visited {
&.selected, &:focus {
color: $brand-primary;
background-color: lighten($brand-primary, 40%);
border-radius: 0;
}

&a:hover {
background-color: $gray-lightest;
color: $gray-dark;
}

&.selected {
font-weight: 500;
font-size: 1rem;;
Expand Down
14 changes: 14 additions & 0 deletions sass/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,17 @@ a {
.is-clickable {
cursor: pointer;
}

.navbar-light .navbar-brand {
font-weight: 300;
text-transform: uppercase;
letter-spacing: 0.1rem;
color: $gray-light;
transition: $base-transition;
}

.action-link {
text-transform: uppercase;
font-weight: 500;
font-size: 0.8rem;
}
5 changes: 2 additions & 3 deletions src/components/Game.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,9 @@ const Game = (props) => {
active={props.context === 'show'}
url={`/games/${props.id}`}
>Leaderboard</NavLink>
{!Object.keys(props.currentUserEntry).length &&
!props.hasGameStarted &&
{!props.hasGameStarted && !props.isOwner &&
<NavLink
active={props.contex === 'preview'}
active={props.context === 'preview'}
url={`/games/${props.id}/preview`}
>Game Preview</NavLink>}
{props.isOwner &&
Expand Down
3 changes: 3 additions & 0 deletions src/components/GameEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const GameEdit = ({
}) => {

return(
isOwner ?
<div className='container game-edit'>
<QuestionList
questions={questions}
Expand All @@ -35,6 +36,8 @@ const GameEdit = ({
isEditable={isOwner}
/>
</div>
:
window.location = '/'
);};

GameEdit.defaultProps = {
Expand Down
4 changes: 2 additions & 2 deletions src/components/GameRun.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ const GameRun = ({
questions,
answersById,
onSelectAnswer,
admin
isOwner
}) => {
return (
currentUser && currentUser.id === admin ?
isOwner ?
<div>
<div className='container game-run'>
<QuestionList questions={questions}
Expand Down
6 changes: 5 additions & 1 deletion src/components/NewestGames.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ const NewestGames = ({games, onCloneGame, onClickGame}) => {
{game.questions ? game.questions.length : 0}
</div>
<div className='table-cell'>
<a href='#' onClick={() => onCloneGame(game)}>clone this game</a>
<a
href='#'
className='action-link'
onClick={() => onCloneGame(game)}
>clone this game</a>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/SmRemoveBtn.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Icon from './Icon';
const SmRemoveBtn = ({id, handleRemove}) => {
return (
<span
className='remove'
className='remove action-link'
onClick={() => handleRemove(id)}
>
delete
Expand Down

0 comments on commit 9d00618

Please sign in to comment.