Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Fix https://github.com/felicity-iiith/contest-portal-frontend/issues/1 #4

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions src/Navbar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,21 @@ export default () => (
<nav className="navigation">
<section className="container">
<Link className="navigation-title" to="/"><h1 className="title">Contest Portal</h1></Link>
<ul className="navigation-list float-right">
{!window.email ?
{
!window.email ?
<ul className="navigation-list float-right">
<li className="navigation-item"><Link to='/login' className="navigation-link">Login</Link></li>
</ul>
:
<li className="navigation-item"><Link to='/logout' className="navigation-link">Logout</Link></li>
<ul className="navigation-list float-right">
<li className="navigation-item">
<Link to='/' className="navigation-link">Hello {window.email}</Link>
</li>
<li className="navigation-item">
<Link to='/logout' className="navigation-link">Logout</Link>
</li>
</ul>
}
</ul>
</section>
</nav>
)
6 changes: 5 additions & 1 deletion src/QuestionViewer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@ class QuestionViewer extends Component {
<div>
{loading && <div>Loading...</div>}
<h1>Q{question.qno}: {question.title}</h1>
{error && <div className="error">ERROR: {error}</div>}
<p>
{question.body}
</p>
{error && <div className="error">ERROR: {error}</div>}
<ul class="Nav">
<li><a rel="prev" href="question/1" id="prv">&lt; Prev</a></li>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I wanted is that you use props.params.qno and find the previous and the next question number. Note that this would be a string so parseInt it at the start of the render function and use that with template strings in the url routes.

<li><a rel="next" href="/question/2" id="nxt">Next &gt;</a></li>
</ul>
</div>
)
}
Expand Down
44 changes: 44 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,47 @@
.error {
color: red;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use milligram CSS and want to keep additional styling as minimal as possible. Please use buttons. This is because we want to later easily change this styling (the lower the classes, the easier it is to change) for each year's theme

ul.Nav {
padding:0;
list-style-type:none;
}
ul.Nav li {
display: inline;
}

ul.Nav li a {
/*background-color: #6E6E6E;*/
background-color:#9b4dca;
color: #FFF;
border: 1.5px solid #333;
font-size: 16px;
font-weight: 600;
padding: 1.5px 12px;
margin: 0 4px;
text-decoration: none;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
box-shadow: 0 0 5px 0 gray;
-moz-box-shadow: 0 0 5px 0 gray;
-webkit-box-shadow: 0 0 5px 0 gray;
}


ul.Nav li a#prv{
float: left;
}

ul.Nav li a#nxt{
float: right;
}


ul.Nav a:hover, ul.Nav a:focus {
background-color: #FFF;
color: #9b4dca;
box-shadow: none;
-moz-box-shadow: none;
-webkit-box-shadow: none;
}