summaryrefslogtreecommitdiff
path: root/src/components/top-nav
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/top-nav')
-rw-r--r--src/components/top-nav/index.js51
-rw-r--r--src/components/top-nav/styles.css1
2 files changed, 49 insertions, 3 deletions
diff --git a/src/components/top-nav/index.js b/src/components/top-nav/index.js
index 24f0747..7f36321 100644
--- a/src/components/top-nav/index.js
+++ b/src/components/top-nav/index.js
@@ -1,4 +1,7 @@
import React from 'react';
+import PropTypes from 'prop-types';
+import classNames from 'classnames';
+
import './styles.css';
const TopNav = (props) => (
@@ -12,12 +15,54 @@ const TopNav = (props) => (
</div>
</a>
<div className="float-right duration-btns">
- <a href="#" className="btn btn-primary">Weekly</a>
- <a href="#" className="btn btn-light">Monthly</a>
- <a href="#" className="btn btn-light">Daily</a>
+ <a href="javascript:void(0)"
+ onClick={ () => props.updateDateType('yearly') }
+ className={
+ classNames('btn', {
+ 'btn-primary': props.selectedDateType === 'yearly',
+ 'btn-light': props.selectedDateType !== 'yearly',
+ })
+ }>
+ Yearly
+ </a>
+ <a href="javascript:void(0)"
+ onClick={ () => props.updateDateType('monthly') }
+ className={
+ classNames('btn', {
+ 'btn-primary': props.selectedDateType === 'monthly',
+ 'btn-light': props.selectedDateType !== 'monthly',
+ })
+ }>
+ Monthly
+ </a>
+ <a href="javascript:void(0)"
+ onClick={ () => props.updateDateType('weekly') }
+ className={
+ classNames('btn', {
+ 'btn-primary': props.selectedDateType === 'weekly',
+ 'btn-light': props.selectedDateType !== 'weekly',
+ })
+ }>
+ Weekly
+ </a>
+ <a href="javascript:void(0)"
+ onClick={ () => props.updateDateType('daily') }
+ className={
+ classNames('btn', {
+ 'btn-primary': props.selectedDateType === 'daily',
+ 'btn-light': props.selectedDateType !== 'daily',
+ })
+ }>
+ Daily
+ </a>
</div>
</div>
</div>
);
+TopNav.propTypes = {
+ updateDateType: PropTypes.func.isRequired,
+ selectedDateType: PropTypes.string
+};
+
export default TopNav;
diff --git a/src/components/top-nav/styles.css b/src/components/top-nav/styles.css
index c91d753..15230f8 100644
--- a/src/components/top-nav/styles.css
+++ b/src/components/top-nav/styles.css
@@ -34,5 +34,6 @@
.duration-btns a.btn {
margin-left: 10px;
margin-top: 24px;
+ box-shadow: none;
}