diff --git a/public/assets/games/citybuilder.jpg b/public/assets/games/citybuilder.jpg deleted file mode 100644 index 89d0132..0000000 Binary files a/public/assets/games/citybuilder.jpg and /dev/null differ diff --git a/public/assets/games/home0.png b/public/assets/games/home0.png deleted file mode 100644 index 3c5c897..0000000 Binary files a/public/assets/games/home0.png and /dev/null differ diff --git a/public/assets/games/home1.png b/public/assets/games/home1.png deleted file mode 100644 index e35c63a..0000000 Binary files a/public/assets/games/home1.png and /dev/null differ diff --git a/public/assets/games/home2.png b/public/assets/games/home2.png deleted file mode 100644 index da2c937..0000000 Binary files a/public/assets/games/home2.png and /dev/null differ diff --git a/public/assets/games/road.png b/public/assets/games/road.png deleted file mode 100644 index 63476d4..0000000 Binary files a/public/assets/games/road.png and /dev/null differ diff --git a/src/ts/components/CityBuilder/components/Block.tsx b/src/ts/components/CityBuilder/components/Block.tsx deleted file mode 100644 index 0cb28f5..0000000 --- a/src/ts/components/CityBuilder/components/Block.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import React from 'react'; - -import style from '../style/map.module.scss'; -import { getRandom } from '../helpers/level'; - -interface IBlockProps { - type?: string; -} - -function Block({ - type, -}: IBlockProps): React.ReactElement | null { - - const className = [style.city_builder_block]; - const defaultSprite = './assets/games/road.png'; - const src = { - home: `./assets/games/home${getRandom(2)}.png`, - road: './assets/games/road.png', - }[type || ''] || defaultSprite; - - if (type === 'green') { - return (
); - } - - return ( - - ); -} - -export default Block; diff --git a/src/ts/components/CityBuilder/components/Blocks.tsx b/src/ts/components/CityBuilder/components/Blocks.tsx deleted file mode 100644 index b7fe842..0000000 --- a/src/ts/components/CityBuilder/components/Blocks.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import React from 'react'; - -import Block from './Block'; - -interface IBlocksProps { - level: any; -} - -function Blocks({ - level, -}: IBlocksProps): React.ReactElement | null { - const blocks: any[] = []; - const lastRowIndex = level?.length - 1; - const lastColumnIndex = level?.[0]?.length - 1; - - level?.forEach((row: any, rowIndex: number) => { - row.forEach((cell: any, columnIndex: number) => { - let type = 'home'; - if (cell) type = 'road'; - if ((!rowIndex || !columnIndex || rowIndex === lastRowIndex || columnIndex === lastColumnIndex) - && cell - && Math.random() > 0.5) type = 'green'; - - blocks.push( - ); - }); - }); - - return (<>{blocks}); -} - -export default Blocks; diff --git a/src/ts/components/CityBuilder/components/CityMap.tsx b/src/ts/components/CityBuilder/components/CityMap.tsx deleted file mode 100644 index fed05df..0000000 --- a/src/ts/components/CityBuilder/components/CityMap.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import React, { useEffect, useState } from 'react'; - -import { getRandomLevel } from '../helpers/level'; -import Blocks from './Blocks'; - -import style from '../style/map.module.scss'; - -function getCitySize(percent: number): [number, number] { - if (percent > 70) return [20, 20]; - if (percent > 60) return [18, 18]; - if (percent > 50) return [16, 16]; - if (percent > 40) return [14, 14]; - if (percent > 20) return [12, 12]; - if (percent > 10) return [10, 10]; - return [8, 8]; -} - -interface ICityMapProps { - percent: number; -} - -function CityMap({ - percent, -}: ICityMapProps): React.ReactElement | null { - const size = getCitySize(percent || 5); - const defaultLevel = getRandomLevel(...size); - const [level, setLevel] = useState(defaultLevel); - - useEffect(() => { - const newSize = getCitySize(percent || 5); - const newLevel = getRandomLevel(...newSize); - setLevel(newLevel); - }, [percent]); - - const cellSize = 20; - const paddingTop = (24 - level.length) / 2; - const paddingLeft = (24 - level[0].length) / 2; - - return ( -
-
- -
-
- ); -} - -export default CityMap; diff --git a/src/ts/components/CityBuilder/helpers/level.ts b/src/ts/components/CityBuilder/helpers/level.ts deleted file mode 100644 index ac5572b..0000000 --- a/src/ts/components/CityBuilder/helpers/level.ts +++ /dev/null @@ -1,79 +0,0 @@ -type IMap = number[][]; -type ICell = { - row: number, - column: number, - corridor: [number, number], -}; - -function getMap(height: number, width: number): IMap { - return Array(height).fill(0).map(() => Array(width).fill(0)); -} - -export function getRandom(max: number): number { - return Math.round(Math.random() * max); -} - -function getNeighbor(visited: any, row: number, column: number): ICell | null { - const neighbors: ICell[] = []; - if ((visited[row - 2] || [])[column] === 0) neighbors.push({ - row: row - 2, - column: column, - corridor: [row - 1, column], - }); - - if (visited[row][column + 2] === 0) neighbors.push({ - row: row, - column: column + 2, - corridor: [row, column + 1], - }); - - if (visited[row][column - 2] === 0) neighbors.push({ - row: row, - column: column - 2, - corridor: [row, column - 1], - }); - - if ((visited[row + 2] || [])[column] === 0) neighbors.push({ - row: row + 2, - column: column, - corridor: [row + 1, column], - }); - - if (!neighbors.length) return null; - const index = getRandom(neighbors.length - 1); - return neighbors[index]; -} - -function step(visited: IMap, history: any) { - if (history.length === 0) return false; - const current = history[history.length - 1]; - visited[current.row][current.column] = 1; - const neighbor = getNeighbor(visited, current.row, current.column); - if (neighbor) { - visited[neighbor.corridor[0]][neighbor.corridor[1]] = 1; - history.push(neighbor); - } else { - history.pop(); - } - return true; -} - -export function getRandomLevel( width: number, height: number) { - const visited = getMap(height + 2, width + 2); - const stack = [{ row: 1, column: 1 }]; - while (step(visited, stack)) { - } - visited.shift(); - visited.forEach((row) => { - row.shift(); - }); - return visited; -} - -export function getCopyLevel(level: IMap) { - return level.map(row => [...row]); -} - -export function printLevel(level: IMap) { - console.log(level.map(row => row.map(v => v ? '#' : ' ').join(' ')).join('\n')); -} diff --git a/src/ts/components/CityBuilder/index.tsx b/src/ts/components/CityBuilder/index.tsx deleted file mode 100644 index 5be75b2..0000000 --- a/src/ts/components/CityBuilder/index.tsx +++ /dev/null @@ -1,86 +0,0 @@ -import React, { useEffect, useState } from 'react'; - -import IHashMap from 'ts/interfaces/HashMap'; -import Description from 'ts/components/Description'; -import ShowSymbol from 'ts/components/ShowSymbol'; -import { shuffle } from 'ts/helpers/random'; -import GameBanner from 'ts/components/GameBanner'; -import styleBanner from 'ts/components/GameBanner/index.module.scss'; - -import CityMap from './components/CityMap'; -import style from './style/wrapper.module.scss'; - -interface IValue { - title: string; - value: number; -} - -function getTotal(valuesByKey: IHashMap): number { - return Object.values(valuesByKey || {}) - .reduce((sum: number, value: number) => sum + value, 0); -} - -function getRandomList(valuesByKey: IHashMap): IValue[] { - const list = Object.entries(valuesByKey || {}) - .map(([title, value]: any) => ({ title, value })); - return shuffle(list); -} - -interface ICityBuilderProps { - valuesByTitle: IHashMap; -} - -function CityBuilder({ - valuesByTitle, -}: ICityBuilderProps): React.ReactElement | null { - const [list, setList] = useState([]); - const [selectedIndex, setSelectedIndex] = useState(0); - const [total, setTotal] = useState(100); - const lastIndex = list.length - 1; - - useEffect(() => { - setTotal(getTotal(valuesByTitle)); - setList(getRandomList(valuesByTitle)); - }, [valuesByTitle]); - - if (!list.length) return null; - - const selected = list[selectedIndex]; - const percent = Math.ceil(((selected.value || 0) * 100) / total); - - return ( - <> - - - - -
-
- - ); -} - -export default CityBuilder; diff --git a/src/ts/components/CityBuilder/style/banner.module.scss b/src/ts/components/CityBuilder/style/banner.module.scss deleted file mode 100644 index 7edc6ea..0000000 --- a/src/ts/components/CityBuilder/style/banner.module.scss +++ /dev/null @@ -1,36 +0,0 @@ -@import 'src/styles/variables'; - -.city_builder_banner { - position: relative; - display: block; - width: 100%; - height: 300px; - margin: var(--space-xxl) auto 0; - - user-select: none; - - background-size: auto 100%; - background-repeat: repeat; - background-position: top left; - - &_description { - position: absolute; - left: 0; - right: 0; - - display: block; - width: 100%; - padding: 0 var(--space-xxl); - } - - &_description { - bottom: 0; - padding-top: var(--space-xxl); - background-color: rgba(0, 0, 0, 0.7); - } - - &_text { - margin: var(--space-s) auto; - color: var(--color-white); - } -} diff --git a/src/ts/components/CityBuilder/style/map.module.scss b/src/ts/components/CityBuilder/style/map.module.scss deleted file mode 100644 index 08a59b5..0000000 --- a/src/ts/components/CityBuilder/style/map.module.scss +++ /dev/null @@ -1,40 +0,0 @@ -@import 'src/styles/variables'; - -.city_builder { - --temp-min-size: 20px; - - display: block; - margin: 0; - padding: 0; - vertical-align: top; - - &_wrapper { - max-width: 480px; - padding: 40px; - margin: 0 auto; - - box-sizing: border-box; - } - - &_block { - display: inline-block; - width: var(--temp-min-size); - height: var(--temp-min-size); - margin: 0; - padding: 0; - - vertical-align: top; - text-decoration: none; - box-sizing: border-box; - - border: none; - - background-repeat: repeat; - background-size: auto 100%; - background-position: center center; - - &_home { - background-repeat: repeat; - } - } -} diff --git a/src/ts/components/CityBuilder/style/wrapper.module.scss b/src/ts/components/CityBuilder/style/wrapper.module.scss deleted file mode 100644 index acd88ae..0000000 --- a/src/ts/components/CityBuilder/style/wrapper.module.scss +++ /dev/null @@ -1,50 +0,0 @@ -@import 'src/styles/variables'; - -.city_builder_description { - margin: var(--space-m) auto; -} - -.city_builder_control { - position: relative; - margin: 0 auto var(--space-xxl); - user-select: none; - background-color: var(--color-13); - - background-size: auto; - background-repeat: repeat; - background-position: top left; - - &_prev, - &_next { - position: absolute; - top: 0; - bottom: 0; - - display: flex; - align-items: center; - justify-content: center; - - width: 30%; - height: 100%; - cursor: pointer; - - border-radius: 0; - border: none; - color: transparent; - - background-color: transparent; - background-size: auto 30%; - background-repeat: no-repeat; - background-position: center center; - } - - &_prev { - left: 0; - right: 30%; - } - - &_next { - left: 70%; - right: 100%; - } -} diff --git a/src/ts/components/Quize/components/Answer.tsx b/src/ts/components/Quiz/components/Answer.tsx similarity index 60% rename from src/ts/components/Quize/components/Answer.tsx rename to src/ts/components/Quiz/components/Answer.tsx index f7205a4..cbaaad4 100644 --- a/src/ts/components/Quize/components/Answer.tsx +++ b/src/ts/components/Quiz/components/Answer.tsx @@ -17,25 +17,25 @@ function Answer({ onClick, }: IAnswerProps): React.ReactElement | null { const [iconIndex] = useState(getRandom(5)); - const className = [style.quize_answer_wrapper]; - const textClasName = [style.quize_answer_text]; + const className = [style.quiz_answer_wrapper]; + const textClasName = [style.quiz_answer_text]; - if (mode === 'small' || mode === 'error') className.push(style.quize_answer_wrapper_small); - if (mode === 'selected') textClasName.push(style.quize_answer_text_selected); - if (mode === 'correct') textClasName.push(style.quize_answer_text_correct); - if (mode === 'error') textClasName.push(style.quize_answer_text_error); + if (mode === 'small' || mode === 'error') className.push(style.quiz_answer_wrapper_small); + if (mode === 'selected') textClasName.push(style.quiz_answer_text_selected); + if (mode === 'correct') textClasName.push(style.quiz_answer_text_correct); + if (mode === 'error') textClasName.push(style.quiz_answer_text_error); return (
{ onClick(); }} >
{answer.title} diff --git a/src/ts/components/Quize/components/Progress.tsx b/src/ts/components/Quiz/components/Progress.tsx similarity index 68% rename from src/ts/components/Quize/components/Progress.tsx rename to src/ts/components/Quiz/components/Progress.tsx index 39170fa..3c1c7cb 100644 --- a/src/ts/components/Quize/components/Progress.tsx +++ b/src/ts/components/Quiz/components/Progress.tsx @@ -10,9 +10,9 @@ function Progress({ progress, }: IProgressProps): React.ReactElement | null { return ( -
-
-
+
+
+
{progress}
diff --git a/src/ts/components/Quize/components/Question.tsx b/src/ts/components/Quiz/components/Question.tsx similarity index 88% rename from src/ts/components/Quize/components/Question.tsx rename to src/ts/components/Quiz/components/Question.tsx index 5acb4af..8a47b47 100644 --- a/src/ts/components/Quize/components/Question.tsx +++ b/src/ts/components/Quiz/components/Question.tsx @@ -67,18 +67,18 @@ function Question({ )); return ( -
-
+
+
{question.title}
-
+
{answers}
-
+
{ diff --git a/src/ts/components/Quize/components/Result.tsx b/src/ts/components/Quiz/components/Result.tsx similarity index 79% rename from src/ts/components/Quize/components/Result.tsx rename to src/ts/components/Quiz/components/Result.tsx index 2b08422..af45c20 100644 --- a/src/ts/components/Quize/components/Result.tsx +++ b/src/ts/components/Quiz/components/Result.tsx @@ -17,14 +17,14 @@ function Result({ onClick, }: IResultProps): React.ReactElement | null { return ( -
-

+
+

{result.title}

-

+

{result.description}

-
+
{ onClick(); diff --git a/src/ts/components/Quize/components/Start.tsx b/src/ts/components/Quiz/components/Start.tsx similarity index 61% rename from src/ts/components/Quize/components/Start.tsx rename to src/ts/components/Quiz/components/Start.tsx index c3e11bc..02ce2f4 100644 --- a/src/ts/components/Quize/components/Start.tsx +++ b/src/ts/components/Quiz/components/Start.tsx @@ -2,35 +2,35 @@ import React from 'react'; import UiKitButton from 'ts/components/UiKit/components/Button'; -import IQuize from '../interfaces/Quize'; +import IQuiz from '../interfaces/Quiz'; import stylePage from '../styles/start.module.scss'; import style from '../styles/index.module.scss'; interface IStartProps { - quize: IQuize; + quiz: IQuiz; onClick: Function; } function Start({ - quize, + quiz, onClick, }: IStartProps): React.ReactElement | null { return ( -
-

- {quize.title} +
+

+ {quiz.title}

-

- {quize.description} +

+ {quiz.description}

-
+
{ onClick(); }} > - {quize.button || 'GO'} + {quiz.button || 'GO'}
diff --git a/src/ts/components/Quize/components/index.tsx b/src/ts/components/Quiz/components/index.tsx similarity index 72% rename from src/ts/components/Quize/components/index.tsx rename to src/ts/components/Quiz/components/index.tsx index ef172d8..a06c8e0 100644 --- a/src/ts/components/Quize/components/index.tsx +++ b/src/ts/components/Quiz/components/index.tsx @@ -4,7 +4,7 @@ import Result from './Result'; import Question from './Question'; import Start from './Start'; -import IQuize from '../interfaces/Quize'; +import IQuiz from '../interfaces/Quiz'; import IQuestion from '../interfaces/Question'; import IAnswer from '../interfaces/Answer'; import IResult from '../interfaces/Result'; @@ -25,29 +25,29 @@ function getApplyInAnimation(setShowSlide: Function, delay: number) { }; } -interface IQuizePageProps { - quize: IQuize; +interface IQuizPageProps { + quiz: IQuiz; onEnd: Function; } -function QuizePage({ - quize, +function QuizPage({ + quiz, onEnd, -}: IQuizePageProps): React.ReactElement | null { - const [question, setQuestion] = useState(quize.questions[0]); - const [result, setResult] = useState(quize.results[0]); +}: IQuizPageProps): React.ReactElement | null { + const [question, setQuestion] = useState(quiz.questions[0]); + const [result, setResult] = useState(quiz.results[0]); const [answers, setAnswers] = useState([]); const [view, setView] = useState('start'); const [showSlide, setShowSlide] = useState(false); const applyInAnimation = getApplyInAnimation(setShowSlide, 1500); - const questions = getQuestionByGroups(quize.questions); + const questions = getQuestionByGroups(quiz.questions); let page: any = null; if (view === 'start') { page = ( { applyInAnimation(() => { setView('question'); @@ -64,7 +64,7 @@ function QuizePage({ onClick={(answer: IAnswer) => { const nextById = questions.byId[answer.nextQuestionId || '']; const nextByIndex = questions.byIndex[question.index + 1]; - const newResult = getResult(answers, quize.results); + const newResult = getResult(answers, quiz.results); setAnswers([...answers, answer]); if (answer.isEnd) { @@ -98,7 +98,7 @@ function QuizePage({ onClick={() => { applyInAnimation(() => { onEnd(); - setQuestion(quize.questions[0]); + setQuestion(quiz.questions[0]); setAnswers([]); setView('start'); }); @@ -108,21 +108,21 @@ function QuizePage({ } const className = showSlide - ? `${style.quize_slider} ${style.quize_slider_animation}` - : style.quize_slider; + ? `${style.quiz_slider} ${style.quiz_slider_animation}` + : style.quiz_slider; return (
{page} @@ -131,4 +131,4 @@ function QuizePage({ ); } -export default QuizePage; +export default QuizPage; diff --git a/src/ts/components/Quize/helpers/example.ts b/src/ts/components/Quiz/helpers/example.ts similarity index 100% rename from src/ts/components/Quize/helpers/example.ts rename to src/ts/components/Quiz/helpers/example.ts diff --git a/src/ts/components/Quize/helpers/index.ts b/src/ts/components/Quiz/helpers/index.ts similarity index 100% rename from src/ts/components/Quize/helpers/index.ts rename to src/ts/components/Quiz/helpers/index.ts diff --git a/src/ts/components/Quiz/index.tsx b/src/ts/components/Quiz/index.tsx new file mode 100644 index 0000000..e4c6fbb --- /dev/null +++ b/src/ts/components/Quiz/index.tsx @@ -0,0 +1,20 @@ +import React from 'react'; + +import IQuiz from './interfaces/Quiz'; +import QuizPage from './components/index'; +import example from './helpers/example'; + +interface IQuizProps { +} + +function Quiz({}: IQuizProps): React.ReactElement | null { + return ( + { + }} + /> + ); +} + +export default Quiz; diff --git a/src/ts/components/Quize/interfaces/Answer.ts b/src/ts/components/Quiz/interfaces/Answer.ts similarity index 100% rename from src/ts/components/Quize/interfaces/Answer.ts rename to src/ts/components/Quiz/interfaces/Answer.ts diff --git a/src/ts/components/Quize/interfaces/Question.ts b/src/ts/components/Quiz/interfaces/Question.ts similarity index 100% rename from src/ts/components/Quize/interfaces/Question.ts rename to src/ts/components/Quiz/interfaces/Question.ts diff --git a/src/ts/components/Quize/interfaces/Quize.ts b/src/ts/components/Quiz/interfaces/Quiz.ts similarity index 86% rename from src/ts/components/Quize/interfaces/Quize.ts rename to src/ts/components/Quiz/interfaces/Quiz.ts index 8fed00a..9699d70 100644 --- a/src/ts/components/Quize/interfaces/Quize.ts +++ b/src/ts/components/Quiz/interfaces/Quiz.ts @@ -1,7 +1,7 @@ import IQuestion from './Question'; import IResult from './Result'; -export default interface IQuize { +export default interface IQuiz { id?: number; icon?: string; title?: string; diff --git a/src/ts/components/Quize/interfaces/Result.ts b/src/ts/components/Quiz/interfaces/Result.ts similarity index 100% rename from src/ts/components/Quize/interfaces/Result.ts rename to src/ts/components/Quiz/interfaces/Result.ts diff --git a/src/ts/components/Quize/styles/answer.module.scss b/src/ts/components/Quiz/styles/answer.module.scss similarity index 86% rename from src/ts/components/Quize/styles/answer.module.scss rename to src/ts/components/Quiz/styles/answer.module.scss index 4c807ea..5fc98fb 100644 --- a/src/ts/components/Quize/styles/answer.module.scss +++ b/src/ts/components/Quiz/styles/answer.module.scss @@ -1,6 +1,6 @@ @import 'src/styles/variables'; -.quize_answer { +.quiz_answer { --temp-width: 160px; --temp-small: calc(var(--temp-width) - 32px); @@ -97,30 +97,30 @@ } } -.quize_answer_wrapper + .quize_answer_wrapper { +.quiz_answer_wrapper + .quiz_answer_wrapper { margin-left: 64px; } -.quize_answer_wrapper_small { +.quiz_answer_wrapper_small { padding: var(--space-s) var(--space-l); - & .quize_answer { + & .quiz_answer { width: var(--temp-small); animation-delay: 1s; animation-duration: 2s; animation-iteration-count: infinite; animation-fill-mode: both; - animation-name: quize_answer; + animation-name: quiz_answer; } - & .quize_answer_text { + & .quiz_answer_text { font-size: var(--font-s); } } -@keyframes quize_answer { +@keyframes quiz_answer { from { top: 0; } diff --git a/src/ts/components/Quize/styles/index.module.scss b/src/ts/components/Quiz/styles/index.module.scss similarity index 90% rename from src/ts/components/Quize/styles/index.module.scss rename to src/ts/components/Quiz/styles/index.module.scss index 19aea19..554c073 100644 --- a/src/ts/components/Quize/styles/index.module.scss +++ b/src/ts/components/Quiz/styles/index.module.scss @@ -1,6 +1,6 @@ @import 'src/styles/variables'; -.quize { +.quiz { &_container { position: relative; display: block; @@ -33,7 +33,7 @@ background-size: auto 100%; background-repeat: repeat; - animation-name: quize_cloud; + animation-name: quiz_cloud; animation-iteration-count: infinite; animation-fill-mode: none; } @@ -57,7 +57,7 @@ animation-fill-mode: both; &_animation { - animation-name: quize_slider; + animation-name: quiz_slider; } } @@ -124,7 +124,7 @@ } } -@keyframes quize_slider { +@keyframes quiz_slider { from { bottom: 0; left: auto; @@ -145,7 +145,7 @@ } } -@keyframes quize_cloud { +@keyframes quiz_cloud { from { background-position: 0 0; } diff --git a/src/ts/components/Quize/styles/progress.module.scss b/src/ts/components/Quiz/styles/progress.module.scss similarity index 70% rename from src/ts/components/Quize/styles/progress.module.scss rename to src/ts/components/Quiz/styles/progress.module.scss index 538eeca..27b1b3b 100644 --- a/src/ts/components/Quize/styles/progress.module.scss +++ b/src/ts/components/Quiz/styles/progress.module.scss @@ -1,6 +1,6 @@ @import 'src/styles/variables'; -.quize_progress { +.quiz_progress { &_description { } } diff --git a/src/ts/components/Quize/styles/question.module.scss b/src/ts/components/Quiz/styles/question.module.scss similarity index 89% rename from src/ts/components/Quize/styles/question.module.scss rename to src/ts/components/Quiz/styles/question.module.scss index 82f0469..13bfd75 100644 --- a/src/ts/components/Quize/styles/question.module.scss +++ b/src/ts/components/Quiz/styles/question.module.scss @@ -1,6 +1,6 @@ @import 'src/styles/variables'; -.quize_question { +.quiz_question { &_title { font-size: var(--font-l); font-weight: 100; diff --git a/src/ts/components/Quize/styles/result.module.scss b/src/ts/components/Quiz/styles/result.module.scss similarity index 89% rename from src/ts/components/Quize/styles/result.module.scss rename to src/ts/components/Quiz/styles/result.module.scss index 013b49e..fb2b4ae 100644 --- a/src/ts/components/Quize/styles/result.module.scss +++ b/src/ts/components/Quiz/styles/result.module.scss @@ -1,6 +1,6 @@ @import 'src/styles/variables'; -.quize_result { +.quiz_result { &_title, &_description { font-weight: 100; diff --git a/src/ts/components/Quize/styles/start.module.scss b/src/ts/components/Quiz/styles/start.module.scss similarity index 64% rename from src/ts/components/Quize/styles/start.module.scss rename to src/ts/components/Quiz/styles/start.module.scss index bd7db12..1a03296 100644 --- a/src/ts/components/Quize/styles/start.module.scss +++ b/src/ts/components/Quiz/styles/start.module.scss @@ -1,4 +1,4 @@ @import 'src/styles/variables'; -.quize_start { +.quiz_start { } diff --git a/src/ts/components/Quize/index.tsx b/src/ts/components/Quize/index.tsx deleted file mode 100644 index dec4fd3..0000000 --- a/src/ts/components/Quize/index.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import React from 'react'; - -import IQuize from './interfaces/Quize'; -import QuizePage from './components/index'; -import example from './helpers/example'; - -interface IQuizeProps { -} - -function Quize({}: IQuizeProps): React.ReactElement | null { - return ( - { - }} - /> - ); -} - -export default Quize; diff --git a/src/ts/pages/Team/components/Top.tsx b/src/ts/pages/Team/components/Building.tsx similarity index 59% rename from src/ts/pages/Team/components/Top.tsx rename to src/ts/pages/Team/components/Building.tsx index 854d4e8..455b99d 100644 --- a/src/ts/pages/Team/components/Top.tsx +++ b/src/ts/pages/Team/components/Building.tsx @@ -5,19 +5,11 @@ import dataGripStore from 'ts/store/DataGrip'; import Title from 'ts/components/Title'; import Races from 'ts/components/Races'; -import CityBuilder from 'ts/components/CityBuilder'; import SwimmingPool from 'ts/components/SwimmingPool'; -import Quize from 'ts/components/Quize'; +import Quiz from 'ts/components/Quiz'; const TeamBuilding = observer((): React.ReactElement => { - const filesByAuthor = dataGripStore.fileGrip.author?.statisticByName || {}; - const addedFilesByAuthor = Object.entries(filesByAuthor) - .reduce((acc: any, item: any) => { - acc[item[0]] = item[1].addedFiles; - return acc; - }, {}); - const tracksAuth = dataGripStore.dataGrip.author.statistic .filter((item: any) => !item.isStaff); const value = tracksAuth.map((statistic: any) => statistic.taskInDay); @@ -33,16 +25,10 @@ const TeamBuilding = observer((): React.ReactElement => { return ( <> - - {/**/} + <Quiz /> <Races tracks={tracks} /> <Title title="Максимальная длинна подписи коммита"/> <SwimmingPool tracks={maxMessageLength}/> - - <Title title="Количество созданных файлов, если бы это был город"/> - <CityBuilder valuesByTitle={addedFilesByAuthor} /> - <Title title="Скорость коммитов в день"/> - {'Небоскребы вверх ввиде графика'} </> ); }); diff --git a/src/ts/pages/Team/index.tsx b/src/ts/pages/Team/index.tsx index b61e354..fa8b6d7 100644 --- a/src/ts/pages/Team/index.tsx +++ b/src/ts/pages/Team/index.tsx @@ -18,7 +18,7 @@ import Type from './components/Type'; import Week from './components/Week'; import Month from './components/Month'; import Tasks from './components/Tasks'; -import TeamBuilding from './components/Top'; +import Building from './components/Building'; import Pr from './components/PR'; import Print from './components/Print'; import Release from './components/Release'; @@ -41,7 +41,7 @@ function getViewById(page?: string) { if (page === 'commits') return <Commits/>; if (page === 'changes') return <Changes/>; if (page === 'words') return <PopularWords mode={mode}/>; - if (page === 'building') return <TeamBuilding/>; + if (page === 'building') return <Building/>; if (page === 'print') return <Print/>; if (page === 'tasks') return <Tasks/>; return <Total/>;