From 20a36a0a60be718cee62de9970cf5790cf8412f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Geonizeli?= Date: Mon, 17 Oct 2022 22:21:47 -0300 Subject: [PATCH] new assessment test --- .../components/Navegator/Navegator.tsx | 19 +++- .../pages/assessment/AssessmentList.tsx | 22 +++-- .../pages/assessment/NewAssessement.tsx | 97 +++++++++++++++++++ app/javascript/routes/paths.ts | 1 + app/javascript/routes/routes.tsx | 13 +-- 5 files changed, 133 insertions(+), 19 deletions(-) create mode 100644 app/javascript/pages/assessment/NewAssessement.tsx diff --git a/app/javascript/components/Navegator/Navegator.tsx b/app/javascript/components/Navegator/Navegator.tsx index 2904a25..f3904cf 100644 --- a/app/javascript/components/Navegator/Navegator.tsx +++ b/app/javascript/components/Navegator/Navegator.tsx @@ -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 = ({ children, className }) => ( type Props = { home?: boolean newQuestion?: boolean + newAssessment?: boolean children?: any } export const Navigator: FC = ({ - 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 = ({ ) : null } + { + (newAssessment) ? ( + + + + Nova Avaliação + + + ) : null + } {children} diff --git a/app/javascript/pages/assessment/AssessmentList.tsx b/app/javascript/pages/assessment/AssessmentList.tsx index a899fe9..4a46346 100644 --- a/app/javascript/pages/assessment/AssessmentList.tsx +++ b/app/javascript/pages/assessment/AssessmentList.tsx @@ -1,15 +1,19 @@ import React from 'react' +import { Navigator } from '../../components' import { AssessmentListItem } from './components/AssessmentListItem' import { assessmentMocks } from './mock' export const AssessmentList = () => { - return ( -
- {assessmentMocks.map((assessment) => ( - - ))} -
- ) + return ( + <> + +
+ {assessmentMocks.map((assessment) => ( + + ))} +
+ + ) } \ No newline at end of file diff --git a/app/javascript/pages/assessment/NewAssessement.tsx b/app/javascript/pages/assessment/NewAssessement.tsx new file mode 100644 index 0000000..4d78d1b --- /dev/null +++ b/app/javascript/pages/assessment/NewAssessement.tsx @@ -0,0 +1,97 @@ +import React from "react"; +import { Button, Navigator } from '../../components' + +export const NewAssessement = () => { + return ( + <> + +
+
+
+

+ Ano de Criação +

+ +
+

Apenas inéditas?

+ + + + +
+
+ +
+
+
+

+ Habilidade Cognitiva +

+ +
+ +
+
+ +
+
+
+

+ Habilidade Cognitiva +

+ +
+ +
+
+ +
+
+ + + ) +} \ No newline at end of file diff --git a/app/javascript/routes/paths.ts b/app/javascript/routes/paths.ts index 7223f3c..376de37 100644 --- a/app/javascript/routes/paths.ts +++ b/app/javascript/routes/paths.ts @@ -20,4 +20,5 @@ export const DashboardRoutePaths = { export const AssessmentRoutePaths = { index: "/assessments", + new: "/assessments/new", } \ No newline at end of file diff --git a/app/javascript/routes/routes.tsx b/app/javascript/routes/routes.tsx index 7bfc939..dadbf56 100644 --- a/app/javascript/routes/routes.tsx +++ b/app/javascript/routes/routes.tsx @@ -1,12 +1,12 @@ import React from "react"; -import { Switch, Route, Redirect } from "react-router-dom"; +import { Redirect, Route, Switch } from "react-router-dom"; -import { Profile } from "../pages/session"; -import { Dashboard } from '../pages/dashboard' -import { List, New, Show, Review, Edit } from "../pages/question"; import { AssessmentList } from "../pages/assessment"; - -import { QuestionRoutePaths, SessionRoutePaths, DashboardRoutePaths, AssessmentRoutePaths } from './paths' +import { NewAssessement } from "../pages/assessment/NewAssessement"; +import { Dashboard } from '../pages/dashboard'; +import { Edit, List, New, Review, Show } from "../pages/question"; +import { Profile } from "../pages/session"; +import { AssessmentRoutePaths, DashboardRoutePaths, QuestionRoutePaths, SessionRoutePaths } from './paths'; export const PrivateRoutes = () => ( @@ -21,5 +21,6 @@ export const PrivateRoutes = () => ( + );