Connect Schedule to API and

This commit is contained in:
2020-08-22 22:49:03 +02:00
parent 3356c380d7
commit 017f6e3869
6 changed files with 130 additions and 36 deletions

View File

@@ -8,10 +8,9 @@ const PrivateRoute = ({ component: Component, ...rest }) => {
return (
<Route
{...rest}
render={(props) =>
isAuthenticated ? (
<Component {...props} />
<Component {...rest} {...props} />
) : (
<Redirect to='/login' />
)

View File

@@ -1,23 +1,13 @@
import React, { useState } from 'react';
import React from 'react';
import { InputGroup, Icon } from 'rsuite';
import { durations } from '../../assets/data/durations';
export default function DurationSelector() {
const [durationIdx, setDurationIdx] = useState(0);
const handleIncrement = () => {
if (durationIdx <= durations.length - 2) {
setDurationIdx(durationIdx + 1);
}
};
const handleDecrement = () => {
if (durationIdx > 0) {
setDurationIdx(durationIdx - 1);
}
};
export default function DurationSelector({
durationIdx,
handleDecrement,
handleIncrement,
}) {
return (
<InputGroup style={{ background: 'white' }}>
<InputGroup.Button onClick={handleDecrement}>