new assessment test

This commit is contained in:
2022-10-17 22:21:47 -03:00
parent 9d2cce1a4a
commit 20a36a0a60
5 changed files with 133 additions and 19 deletions

View File

@@ -1,13 +1,13 @@
import React, { FC, useState } from "react";
import { FaHome, FaPlus } from "react-icons/fa";
import { useDispatch, useSelector } from "react-redux";
import { Link, useHistory } from "react-router-dom";
import { FaHome, FaPlus } from "react-icons/fa";
import styled from "styled-components";
import { turnOff } from "../../services/store/unsavedChanges";
import { QuestionRoutePaths } from "../../routes";
import { RootState } from "../../services/store";
import { turnOff } from "../../services/store/unsavedChanges";
import { Dialog } from "../Dialog";
import {QuestionRoutePaths} from "../../routes";
const HorizontalMenu = styled.ul`
margin: 0;
@@ -44,11 +44,12 @@ const Item: FC<ItemProps> = ({ children, className }) => (
type Props = {
home?: boolean
newQuestion?: boolean
newAssessment?: boolean
children?: any
}
export const Navigator: FC<Props> = ({
home = false, newQuestion = false, children,
home = false, newQuestion = false, newAssessment = false, children,
}) => {
const [confirmLeaveDialog, setConfirmLeaveDialog] = useState(false);
const unsavedChanges = useSelector((state: RootState) => state.unsavedChanges)
@@ -98,6 +99,16 @@ export const Navigator: FC<Props> = ({
</Item>
) : null
}
{
(newAssessment) ? (
<Item>
<Link to="/assessments/new" className="flex">
<FaPlus className="my-auto" />
<span className="pl-3">Nova Avaliação</span>
</Link>
</Item>
) : null
}
{children}
</HorizontalMenu>
</div>