From 09012014bea1d5b56bdf2c615c53d906aefb6b0c Mon Sep 17 00:00:00 2001 From: Aymeric Bethencourt Date: Mon, 22 Jun 2020 16:41:00 +0200 Subject: [PATCH] Implement frontend tracking --- .../user/addProgress/addProgress.spec.ts | 1 + src/api/src/router.ts | 3 +- src/api/src/sanitize.ts | 2 +- src/frontend/public/icons/badge.svg | 30 ++++ src/frontend/public/icons/check.svg | 4 + src/frontend/public/images/badge.svg | 18 +-- .../app/App.components/Header/Header.view.tsx | 7 +- src/frontend/src/app/App.routes.tsx | 10 +- .../src/pages/Chapter/Chapter.actions.tsx | 25 +++ .../src/pages/Chapter/Chapter.controller.tsx | 17 ++- .../src/pages/Chapter/Chapter.reducers.tsx | 34 +++++ .../src/pages/Chapter/Chapter.view.tsx | 4 +- .../ChapterAbout/ChapterAbout.constants.tsx | 0 .../ChapterAbout/ChapterAbout.controller.tsx | 17 ++- .../ChapterAbout/ChapterAbout.data.tsx | 4 +- .../ChapterAbout/ChapterAbout.style.tsx | 0 .../ChapterAbout/ChapterAbout.view.tsx | 0 .../Camel/ChapterAbout/ChapterAbout.data.tsx | 34 ----- .../Camel/ChapterAbout/ChapterAbout.style.tsx | 144 ------------------ .../ChapterAbout/ChapterAbout.constants.tsx | 3 - .../ChapterAbout/ChapterAbout.controller.tsx | 23 --- .../Pascal/ChapterAbout/ChapterAbout.view.tsx | 136 ----------------- .../ChapterAbout/ChapterAbout.constants.tsx | 3 - .../ChapterAbout/ChapterAbout.controller.tsx | 23 --- .../Reason/ChapterAbout/ChapterAbout.data.tsx | 34 ----- .../ChapterAbout/ChapterAbout.style.tsx | 144 ------------------ .../Reason/ChapterAbout/ChapterAbout.view.tsx | 136 ----------------- src/frontend/src/pages/Home/Home.view.tsx | 7 +- src/frontend/src/pages/User/User.style.tsx | 57 ++++++- src/frontend/src/pages/User/User.view.tsx | 55 ++++++- src/frontend/src/reducers/index.ts | 5 +- src/frontend/src/styles/components.ts | 5 +- 32 files changed, 256 insertions(+), 729 deletions(-) create mode 100644 src/frontend/public/icons/badge.svg create mode 100644 src/frontend/public/icons/check.svg create mode 100644 src/frontend/src/pages/Chapter/Chapter.actions.tsx create mode 100644 src/frontend/src/pages/Chapter/Chapter.reducers.tsx rename src/frontend/src/pages/{Chapters/Camel => }/ChapterAbout/ChapterAbout.constants.tsx (100%) rename src/frontend/src/pages/{Chapters/Camel => }/ChapterAbout/ChapterAbout.controller.tsx (55%) rename src/frontend/src/pages/{Chapters/Pascal => }/ChapterAbout/ChapterAbout.data.tsx (95%) rename src/frontend/src/pages/{Chapters/Pascal => }/ChapterAbout/ChapterAbout.style.tsx (100%) rename src/frontend/src/pages/{Chapters/Camel => }/ChapterAbout/ChapterAbout.view.tsx (100%) delete mode 100644 src/frontend/src/pages/Chapters/Camel/ChapterAbout/ChapterAbout.data.tsx delete mode 100644 src/frontend/src/pages/Chapters/Camel/ChapterAbout/ChapterAbout.style.tsx delete mode 100644 src/frontend/src/pages/Chapters/Pascal/ChapterAbout/ChapterAbout.constants.tsx delete mode 100644 src/frontend/src/pages/Chapters/Pascal/ChapterAbout/ChapterAbout.controller.tsx delete mode 100644 src/frontend/src/pages/Chapters/Pascal/ChapterAbout/ChapterAbout.view.tsx delete mode 100644 src/frontend/src/pages/Chapters/Reason/ChapterAbout/ChapterAbout.constants.tsx delete mode 100644 src/frontend/src/pages/Chapters/Reason/ChapterAbout/ChapterAbout.controller.tsx delete mode 100644 src/frontend/src/pages/Chapters/Reason/ChapterAbout/ChapterAbout.data.tsx delete mode 100644 src/frontend/src/pages/Chapters/Reason/ChapterAbout/ChapterAbout.style.tsx delete mode 100644 src/frontend/src/pages/Chapters/Reason/ChapterAbout/ChapterAbout.view.tsx diff --git a/src/api/src/resolvers/user/addProgress/addProgress.spec.ts b/src/api/src/resolvers/user/addProgress/addProgress.spec.ts index ab5cc24..c84f4a8 100644 --- a/src/api/src/resolvers/user/addProgress/addProgress.spec.ts +++ b/src/api/src/resolvers/user/addProgress/addProgress.spec.ts @@ -36,6 +36,7 @@ describe('User', () => { expect(ctx.body.user).toBeDefined() expect(ctx.body.user.progress).toContain('/pascal/chapter-polymorphism') + done() }) diff --git a/src/api/src/router.ts b/src/api/src/router.ts index a3599df..e479eb9 100644 --- a/src/api/src/router.ts +++ b/src/api/src/router.ts @@ -21,10 +21,11 @@ router.post('/user/sign-up', signUp) router.post('/user/login', login) router.post('/user/verify-email', verifyEmail) router.post('/user/resend-email-verification', resendEmailVerification) -router.post('/user/get-public-user', getPublicUser) router.post('/user/add-progress', addProgress) router.post('/user/reset-password', resetPassword) router.post('/user/forgot-password', forgotPassword) router.post('/user/change-password', changePassword) +router.post('/page/get-user', getPublicUser) + export { router } diff --git a/src/api/src/sanitize.ts b/src/api/src/sanitize.ts index f693405..8a1f5c8 100644 --- a/src/api/src/sanitize.ts +++ b/src/api/src/sanitize.ts @@ -4,7 +4,7 @@ import { ResponseError } from './shared/mongo/ResponseError' export const sanitize = () => async (ctx: Context, next: Next): Promise => { const body = JSON.stringify(ctx.request.body) - const forbidden = new RegExp('<|/|>', 'i') + const forbidden = new RegExp('<|>', 'i') if (forbidden.test(body)) throw new ResponseError(400, 'Forbidden characters') else await next() } diff --git a/src/frontend/public/icons/badge.svg b/src/frontend/public/icons/badge.svg new file mode 100644 index 0000000..6305af4 --- /dev/null +++ b/src/frontend/public/icons/badge.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/frontend/public/icons/check.svg b/src/frontend/public/icons/check.svg new file mode 100644 index 0000000..6116db2 --- /dev/null +++ b/src/frontend/public/icons/check.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/frontend/public/images/badge.svg b/src/frontend/public/images/badge.svg index ca72ce5..6305af4 100644 --- a/src/frontend/public/images/badge.svg +++ b/src/frontend/public/images/badge.svg @@ -1,6 +1,6 @@ - + @@ -9,24 +9,22 @@ - + - + - + - - + + - - - - + + diff --git a/src/frontend/src/app/App.components/Header/Header.view.tsx b/src/frontend/src/app/App.components/Header/Header.view.tsx index f134603..9b6b788 100644 --- a/src/frontend/src/app/App.components/Header/Header.view.tsx +++ b/src/frontend/src/app/App.components/Header/Header.view.tsx @@ -49,12 +49,7 @@ function loggedOutHeader() { function loggedInHeader({ user, removeAuthUserCallback }: HeaderViewProps) { return ( - { - removeAuthUserCallback() - }} - > + {user?.username} ( - + - + - + diff --git a/src/frontend/src/pages/Chapter/Chapter.actions.tsx b/src/frontend/src/pages/Chapter/Chapter.actions.tsx new file mode 100644 index 0000000..585dc5e --- /dev/null +++ b/src/frontend/src/pages/Chapter/Chapter.actions.tsx @@ -0,0 +1,25 @@ +import { store } from 'index' +import { AddProgressInputs } from 'shared/user/AddProgress' + +export const ADD_PROGRESS_REQUEST = 'ADD_PROGRESS_REQUEST' +export const ADD_PROGRESS_COMMIT = 'ADD_PROGRESS_COMMIT' +export const ADD_PROGRESS_ROLLBACK = 'ADD_PROGRESS_ROLLBACK' + +export const addProgress = ({ chapterDone }: AddProgressInputs) => (dispatch: any) => { + dispatch({ + type: ADD_PROGRESS_REQUEST, + payload: {}, + meta: { + offline: { + effect: { + url: `${process.env.REACT_APP_BACKEND_URL}/user/add-progress`, + method: 'POST', + headers: { Authorization: `Bearer ${store.getState().auth.jwt}` }, + json: { chapterDone }, + }, + commit: { type: ADD_PROGRESS_COMMIT, meta: {} }, + rollback: { type: ADD_PROGRESS_ROLLBACK, meta: {} }, + }, + }, + }) +} diff --git a/src/frontend/src/pages/Chapter/Chapter.controller.tsx b/src/frontend/src/pages/Chapter/Chapter.controller.tsx index 90fe9ad..62fc70f 100644 --- a/src/frontend/src/pages/Chapter/Chapter.controller.tsx +++ b/src/frontend/src/pages/Chapter/Chapter.controller.tsx @@ -1,19 +1,23 @@ import * as React from 'react' import { useEffect } from 'react' import { useState } from 'react' +import { useDispatch, useSelector } from 'react-redux' import { useLocation } from 'react-router-dom' +import { State } from 'reducers' -import { PENDING, RIGHT, WRONG } from '../Chapters/Pascal/ChapterAbout/ChapterAbout.constants' - -import { ChapterView } from './Chapter.view' -import { chapterData } from './Chapter.data' +import { PENDING, RIGHT, WRONG } from '../ChapterAbout/ChapterAbout.constants' +import { addProgress } from './Chapter.actions' import { Footer } from './Chapter.components/Footer/Footer.controller' +import { chapterData } from './Chapter.data' +import { ChapterView } from './Chapter.view' export const Chapter = () => { const [validatorState, setValidatorState] = useState(PENDING) const [showDiff, setShowDiff] = useState(false) const { pathname } = useLocation() const [data, setData] = useState({ course: undefined, exercise: undefined, solution: undefined }) + const dispatch = useDispatch() + const user = useSelector((state: State) => state.auth.user) useEffect(() => { chapterData.forEach((chapter) => { @@ -34,9 +38,10 @@ export const Chapter = () => { data.exercise.replace(/\s+|\/\/ Type your solution below/g, '') === // @ts-ignore data.solution.replace(/\s+|\/\/ Type your solution below/g, '') - ) + ) { setValidatorState(RIGHT) - else setValidatorState(WRONG) + if (user) dispatch(addProgress({ chapterDone: pathname })) + } else setValidatorState(WRONG) } else setValidatorState(WRONG) } } diff --git a/src/frontend/src/pages/Chapter/Chapter.reducers.tsx b/src/frontend/src/pages/Chapter/Chapter.reducers.tsx new file mode 100644 index 0000000..21eaa4b --- /dev/null +++ b/src/frontend/src/pages/Chapter/Chapter.reducers.tsx @@ -0,0 +1,34 @@ +import { ADD_PROGRESS_REQUEST, ADD_PROGRESS_COMMIT, ADD_PROGRESS_ROLLBACK } from './Chapter.actions' + +export interface ProgressState { + loading?: boolean +} + +const progressState: ProgressState = { + loading: false, +} + +export function progress(state = progressState, action: any): ProgressState { + switch (action.type) { + case ADD_PROGRESS_REQUEST: { + return { + ...state, + loading: true, + } + } + case ADD_PROGRESS_COMMIT: { + return { + ...state, + loading: false, + } + } + case ADD_PROGRESS_ROLLBACK: { + return { + ...state, + loading: false, + } + } + default: + return state + } +} diff --git a/src/frontend/src/pages/Chapter/Chapter.view.tsx b/src/frontend/src/pages/Chapter/Chapter.view.tsx index 1135ad0..db84dd3 100644 --- a/src/frontend/src/pages/Chapter/Chapter.view.tsx +++ b/src/frontend/src/pages/Chapter/Chapter.view.tsx @@ -3,9 +3,9 @@ import Markdown from 'markdown-to-jsx' import * as PropTypes from 'prop-types' import * as React from 'react' -import { PENDING, RIGHT, WRONG } from '../Chapters/Pascal/ChapterAbout/ChapterAbout.constants' +import { PENDING, RIGHT, WRONG } from '../ChapterAbout/ChapterAbout.constants' //prettier-ignore -import { Button, ButtonBorder, ButtonText, ChapterCourse, ChapterGrid, ChapterH1, ChapterH2, ChapterItalic, ChapterMonaco, ChapterStyled, ChapterValidator, ChapterValidatorContent, ChapterValidatorContentWrapper, ChapterValidatorInside, ChapterValidatorTitle } from "../Chapters/Pascal/ChapterAbout/ChapterAbout.style"; +import { Button, ButtonBorder, ButtonText, ChapterCourse, ChapterGrid, ChapterH1, ChapterH2, ChapterItalic, ChapterMonaco, ChapterStyled, ChapterValidator, ChapterValidatorContent, ChapterValidatorContentWrapper, ChapterValidatorInside, ChapterValidatorTitle } from "../ChapterAbout/ChapterAbout.style"; import { CardBottomCorners, CardTopCorners } from './Chapter.components/Card/Card.style' import { Dialog } from './Chapter.components/Dialog/Dialog.controller' import { Light } from './Chapter.components/Light/Light.view' diff --git a/src/frontend/src/pages/Chapters/Camel/ChapterAbout/ChapterAbout.constants.tsx b/src/frontend/src/pages/ChapterAbout/ChapterAbout.constants.tsx similarity index 100% rename from src/frontend/src/pages/Chapters/Camel/ChapterAbout/ChapterAbout.constants.tsx rename to src/frontend/src/pages/ChapterAbout/ChapterAbout.constants.tsx diff --git a/src/frontend/src/pages/Chapters/Camel/ChapterAbout/ChapterAbout.controller.tsx b/src/frontend/src/pages/ChapterAbout/ChapterAbout.controller.tsx similarity index 55% rename from src/frontend/src/pages/Chapters/Camel/ChapterAbout/ChapterAbout.controller.tsx rename to src/frontend/src/pages/ChapterAbout/ChapterAbout.controller.tsx index 2d80764..c6dbd74 100644 --- a/src/frontend/src/pages/Chapters/Camel/ChapterAbout/ChapterAbout.controller.tsx +++ b/src/frontend/src/pages/ChapterAbout/ChapterAbout.controller.tsx @@ -1,17 +1,26 @@ +import { addProgress } from 'pages/Chapter/Chapter.actions' +import { Footer } from 'pages/Chapter/Chapter.components/Footer/Footer.controller' import * as React from 'react' import { useState } from 'react' +import { useDispatch, useSelector } from 'react-redux' +import { useLocation } from 'react-router-dom' +import { State } from 'reducers' -import { ChapterAboutView } from './ChapterAbout.view' import { PENDING, RIGHT, WRONG } from './ChapterAbout.constants' -import { Footer } from 'pages/Chapter/Chapter.components/Footer/Footer.controller' +import { ChapterAboutView } from './ChapterAbout.view' export const ChapterAbout = () => { const [validatorState, setValidatorState] = useState(PENDING) + const dispatch = useDispatch() + const user = useSelector((state: State) => state.auth.user) + const { pathname } = useLocation() const validateCallback = () => { const shipId = document.getElementById('ship-id')?.textContent - if (shipId === '020433') setValidatorState(RIGHT) - else setValidatorState(WRONG) + if (shipId === '020433') { + setValidatorState(RIGHT) + if (user) dispatch(addProgress({ chapterDone: pathname })) + } else setValidatorState(WRONG) } return ( diff --git a/src/frontend/src/pages/Chapters/Pascal/ChapterAbout/ChapterAbout.data.tsx b/src/frontend/src/pages/ChapterAbout/ChapterAbout.data.tsx similarity index 95% rename from src/frontend/src/pages/Chapters/Pascal/ChapterAbout/ChapterAbout.data.tsx rename to src/frontend/src/pages/ChapterAbout/ChapterAbout.data.tsx index bca403a..9dfb83d 100644 --- a/src/frontend/src/pages/Chapters/Pascal/ChapterAbout/ChapterAbout.data.tsx +++ b/src/frontend/src/pages/ChapterAbout/ChapterAbout.data.tsx @@ -4,7 +4,7 @@ export const data = `#Chapter 1 : Tezos Academy Tezos Academy is a fun interactive tutorial developed by OCTO Technology on how to code smart contracts for Tezos. You are about to create spaceship battles smart contracts! -By default, Tezos smart contracts are written in Michelson, but it is an hard to learn low level formal language. For this tutorial, we will use PascaLIGO instead. The syntax is high level, close to Pascal and transpiles to Michelson. +By default, Tezos smart contracts are written in Michelson, but it is an hard to learn low level formal language. For this tutorial, we will use LIGO instead. The syntax is high level and transpiles to Michelson. ## Objectives @@ -31,4 +31,4 @@ For our tutorial, we only designed a few parts for each attribute, 3 different c On the top-right panel, go ahead and move the slider of each attribute. Notice the Ship ID above the ship image and how the different numerical values correspond to the different ship appearance. Your mission is to select the ship with ID 020433 and click _Validate Mission_ below. Next, we will start coding some LIGO! -`; +` diff --git a/src/frontend/src/pages/Chapters/Pascal/ChapterAbout/ChapterAbout.style.tsx b/src/frontend/src/pages/ChapterAbout/ChapterAbout.style.tsx similarity index 100% rename from src/frontend/src/pages/Chapters/Pascal/ChapterAbout/ChapterAbout.style.tsx rename to src/frontend/src/pages/ChapterAbout/ChapterAbout.style.tsx diff --git a/src/frontend/src/pages/Chapters/Camel/ChapterAbout/ChapterAbout.view.tsx b/src/frontend/src/pages/ChapterAbout/ChapterAbout.view.tsx similarity index 100% rename from src/frontend/src/pages/Chapters/Camel/ChapterAbout/ChapterAbout.view.tsx rename to src/frontend/src/pages/ChapterAbout/ChapterAbout.view.tsx diff --git a/src/frontend/src/pages/Chapters/Camel/ChapterAbout/ChapterAbout.data.tsx b/src/frontend/src/pages/Chapters/Camel/ChapterAbout/ChapterAbout.data.tsx deleted file mode 100644 index 7a6f04d..0000000 --- a/src/frontend/src/pages/Chapters/Camel/ChapterAbout/ChapterAbout.data.tsx +++ /dev/null @@ -1,34 +0,0 @@ -export const data = `#Chapter 1 : Tezos Academy - -Hello rookie! I'm admiral Adama. I hope you are ready for a fight. The Xenomorphs have been attacking our colonies for days now. We are throwing everything we’ve got at them, that means even you rookie, so you better learn and fast! You have been assigned to ship 020433, go ahead and board your ship. - -Tezos Academy is a fun interactive tutorial developed by OCTO Technology on how to code smart contracts for Tezos. You are about to create spaceship battles smart contracts! - -By default, Tezos smart contracts are written in Michelson, but it is an hard to learn low level formal language. For this tutorial, we will use PascaLIGO instead. The syntax is high level, close to Pascal and transpiles to Michelson. - -## Objectives - -In this tutorial, we will go over each fundamental principles of LIGO while coding the following features : - -* Our own ship -* A ship factory -* Our army of ships -* Battle simulation - -The ship factory will maintain a database of all ships in our army and have a function for creating new ships. Each ship will have a random and unique appearance. For this, we will use _Non-Fungible Tokens_ (i.e. tokens that are unique) with a dedicated ship ID. - -## How Ship ID works - -Ship's appearance is based on its unique ID, a 6 digits integer such as - - -Ship ID is similar to how DNA works. Parts of it correspond to parts of its appearance. The first digit corresponds to the class of the ship, the second to the cabin design, third to the engine design, etc... - -For our tutorial, we only designed a few parts for each attribute, 3 different cabins, 5 different engines, etc... but for a real application we could imagine hundreds of different parts, making it almost impossible to randomly select two identical ships. The most famous game like this is Crypto Kitties. - -## Your mission - -On the top-right panel, go ahead and move the slider of each attribute. Notice the Ship ID above the ship image and how the different numerical values correspond to the different ship appearance. Your mission is to select the ship with ID 020433 and click _Validate Mission_ below. - -Next, we will start coding some LIGO (cameligo)! -`; diff --git a/src/frontend/src/pages/Chapters/Camel/ChapterAbout/ChapterAbout.style.tsx b/src/frontend/src/pages/Chapters/Camel/ChapterAbout/ChapterAbout.style.tsx deleted file mode 100644 index 424d225..0000000 --- a/src/frontend/src/pages/Chapters/Camel/ChapterAbout/ChapterAbout.style.tsx +++ /dev/null @@ -1,144 +0,0 @@ -import styled from 'styled-components/macro' - -export const ChapterStyled = styled.div` - display: grid; - grid-template-columns: 1fr 1fr; - grid-gap: 20px; - height: calc(100vh - 130px); - margin: 74px 20px 0; - - @media (max-width: 900px) { - grid-template-columns: auto; - height: initial; - margin: 70px 10px; - } -` - -export const ChapterGrid = styled.div` - display: grid; - grid-template-rows: 500px auto; - grid-gap: 20px; - overflow-y: scroll; - - @media (max-width: 900px) { - overflow-y: initial; - grid-template-rows: auto auto; - margin-bottom: 20px; - } -` - -export const ChapterCourse = styled.div` - background: rgba(0, 44, 69, 0.6); - border: 1px solid #0a5688; - padding: 20px; - font-size: 14px; - white-space: pre-wrap; - overflow: auto; - position: relative; -` - -export const ChapterH1 = styled.div` - font-size: 32px; - line-height: 38px; - - @media (max-width: 900px) { - font-size: 24px; - line-height: 28px; - text-align: center; - } -` - -export const ChapterH2 = styled.div` - font-size: 24px; - line-height: 28px; - margin-top: 20px; - - @media (max-width: 900px) { - font-size: 20px; - line-height: 24px; - } -` - -export const ChapterValidator = styled.div` - border: 1px solid #0a5688; - position: relative; - - &.ok { - border-color: #12650a; - } -` - -export const ChapterValidatorInside = styled.div` - height: calc(100% - 20px); - padding: 16px; - background: url('/elements/card-bg.png') repeat; - margin: 10px; - border: 1px solid #0e334a; - text-align: center; - display: flex; - align-items: center; - justify-content: space-around; - - &.ok { - border: 1px solid #124e19; - background: url('/elements/card-bg-green.png') repeat; - } -` - -export const ChapterValidatorTitle = styled.div` - font-size: 32px; -` - -export const ChapterValidatorContent = styled.div` - font-size: 12px; -` - -export const ChapterValidatorContentWrapper = styled.div`` - -export const Button = styled.div` - font-size: 14px; - width: 200px; - height: 40px; - position: relative; - display: inline-block; - cursor: pointer; - margin: 20px auto 10px auto; -` - -export const ButtonBorder = styled.div` - position: absolute; - left: 0; - top: 0; - width: 100%; - height: 100%; - pointer-events: none; - border: 1px solid transparent; - border-image-source: url('/elements/button-border.svg'); - border-image-slice: 24 28 fill; - border-image-width: 100px; - content: ''; - z-index: 0; -` - -export const ButtonText = styled.div` - position: absolute; - left: 0; - top: 0; - width: 100%; - height: 100%; - line-height: 40px; - z-index: 1; - color: #fff; - text-align: center; -` - -export const ChapterMonaco = styled.div` - border: 1px solid #0a5688; -` - -export const ChapterItalic = styled.em` - color: #42edf8 !important; - /* text-shadow: 0px 0px 25px rgba(11, 183, 226, 0.65), 0px 0px 15px rgba(0, 112, 202, 0.6); */ - text-transform: none; - font-style: normal; -` diff --git a/src/frontend/src/pages/Chapters/Pascal/ChapterAbout/ChapterAbout.constants.tsx b/src/frontend/src/pages/Chapters/Pascal/ChapterAbout/ChapterAbout.constants.tsx deleted file mode 100644 index 58d002c..0000000 --- a/src/frontend/src/pages/Chapters/Pascal/ChapterAbout/ChapterAbout.constants.tsx +++ /dev/null @@ -1,3 +0,0 @@ -export const PENDING = "PENDING"; -export const RIGHT = "RIGHT"; -export const WRONG = "WRONG"; diff --git a/src/frontend/src/pages/Chapters/Pascal/ChapterAbout/ChapterAbout.controller.tsx b/src/frontend/src/pages/Chapters/Pascal/ChapterAbout/ChapterAbout.controller.tsx deleted file mode 100644 index 2d80764..0000000 --- a/src/frontend/src/pages/Chapters/Pascal/ChapterAbout/ChapterAbout.controller.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import * as React from 'react' -import { useState } from 'react' - -import { ChapterAboutView } from './ChapterAbout.view' -import { PENDING, RIGHT, WRONG } from './ChapterAbout.constants' -import { Footer } from 'pages/Chapter/Chapter.components/Footer/Footer.controller' - -export const ChapterAbout = () => { - const [validatorState, setValidatorState] = useState(PENDING) - - const validateCallback = () => { - const shipId = document.getElementById('ship-id')?.textContent - if (shipId === '020433') setValidatorState(RIGHT) - else setValidatorState(WRONG) - } - - return ( - <> - -