Connect Schedule to API and
This commit is contained in:
@@ -8,10 +8,9 @@ const PrivateRoute = ({ component: Component, ...rest }) => {
|
||||
|
||||
return (
|
||||
<Route
|
||||
{...rest}
|
||||
render={(props) =>
|
||||
isAuthenticated ? (
|
||||
<Component {...props} />
|
||||
<Component {...rest} {...props} />
|
||||
) : (
|
||||
<Redirect to='/login' />
|
||||
)
|
||||
|
||||
@@ -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}>
|
||||
|
||||
Reference in New Issue
Block a user