diff --git a/src/index.tsx b/src/index.tsx index 64b805a..7b49ba7 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -14,7 +14,7 @@ import zh from 'ts/translations/zh'; import initializationI18n from './ts/helpers/i18n'; -import Authorization from 'ts/pages/Authorization'; +import Main from 'ts/pages/index'; import userSettings from 'ts/store/UserSettings'; import themeSettings from 'ts/store/ThemeSettings'; import Notifications from 'ts/components/Notifications'; @@ -48,7 +48,7 @@ function renderReactApplication() { render( - +
, diff --git a/src/ts/components/DropZone/index.module.scss b/src/ts/components/DropZone/index.module.scss index 7d521d3..cb79ea9 100644 --- a/src/ts/components/DropZone/index.module.scss +++ b/src/ts/components/DropZone/index.module.scss @@ -4,14 +4,17 @@ position: fixed; top: 0; left: 0; + z-index: 3; + display: flex; flex-direction: column; justify-content: center; align-items: center; width: 100vw; height: 100vh; - z-index: 3; - background-color: var(--color-white); + + border: 8px dashed var(--color-black); + background-color: rgba(255, 255, 255, 0.7); &_icon { display: block; @@ -22,13 +25,16 @@ } &_title { - font-weight: 100; - font-size: 24px; - text-align: center; + font-size: 32px; + font-weight: bold; + display: block; width: 100%; - color: black; + + text-align: center; vertical-align: top; + + color: var(--color-black); } } diff --git a/src/ts/components/DropZone/index.tsx b/src/ts/components/DropZone/index.tsx index 6ccb88f..2dda30e 100644 --- a/src/ts/components/DropZone/index.tsx +++ b/src/ts/components/DropZone/index.tsx @@ -29,7 +29,7 @@ function DropZone({
{/**/}

- Ловлю! + Drop file here

); diff --git a/src/ts/components/GameConsole/components/marquee.tsx b/src/ts/components/GameConsole/components/marquee.tsx deleted file mode 100644 index 4376b39..0000000 --- a/src/ts/components/GameConsole/components/marquee.tsx +++ /dev/null @@ -1,53 +0,0 @@ -import React, { useEffect, useState } from 'react'; - -import style from '../styles/index.module.scss'; - -const SOURCE_CODE = `JIRA-1227 fix(profile): change validation -Counting objects: 100% (22/22), done. -Delta compression using up to 8 threads -JIRA-323 fix: change validation -Writing objects: 100% (12/12), 1.88 KiB | 1.88 MiB/s, done. -Total 12 (delta 9), reused 0 (delta 0), pack-reused 0 -`.split('\n'); - -function getRandomText(index: number, messages?: string[]) { - const source = messages || SOURCE_CODE; - const splitIndex = index % source.length; - const start = source.slice(0, splitIndex); - const end = source.slice(splitIndex); - return [...end, ...start] - .slice(0, 13) - .map((text: string) => (

{text}

)); -} - -interface IMarqueeProps { - commitsInDay: number; - messages?: string[]; -} - -function Marquee({ - commitsInDay, - messages, -}: IMarqueeProps) { - const [index, setIndex] = useState(0); - const text = getRandomText(index, messages); - - useEffect(() => { - const delay = 3000 * 6; - const speed = Math.ceil(delay / (commitsInDay || 1)); - const timer = setInterval(() => { - setIndex((value: number) => value + 1); - }, speed); - return () => { - clearInterval(timer); - }; - }, [commitsInDay]); - - return ( -
-

{text}

-
- ); -} - -export default Marquee; diff --git a/src/ts/components/GameConsole/index.tsx b/src/ts/components/GameConsole/index.tsx deleted file mode 100644 index e16da89..0000000 --- a/src/ts/components/GameConsole/index.tsx +++ /dev/null @@ -1,57 +0,0 @@ -import React, { useState } from 'react'; -import { observer } from 'mobx-react-lite'; - -import dataGripStore from 'ts/store/DataGrip'; -import SelectWithButtons from 'ts/components/UiKit/components/SelectWithButtons'; - -import Marquee from './components/marquee'; - -import style from './styles/index.module.scss'; - - -function getSpeedAndMessages(user: string) { - const byTimestamp = dataGripStore.dataGrip.timestamp.statisticByAuthor[user]; - const commitsInDay = byTimestamp.commitsByTimestampCounter.max; - - const startIndex = byTimestamp.allCommitsByTimestamp.length - 20; - const messages = byTimestamp.allCommitsByTimestamp.slice(startIndex) - .reduce((acc: string[], commit: any) => acc.concat(commit.messages), []); - - return { - speed: commitsInDay, - messages: Array.from(new Set(messages)) as string[], - }; -} - -const GameConsole = observer((): React.ReactElement => { - const employment = dataGripStore.dataGrip.author.employment; - const authors = [ - ...employment.active, - ...employment.dismissed, - ].map((title: string) => ({ id: title, title })); - - const [user, setUser] = useState(authors[0].id); - - const { speed, messages } = getSpeedAndMessages(user); - - return ( -
- - { - setUser(newUser?.id || newUser); - }} - /> - - ); -}); - -export default GameConsole; diff --git a/src/ts/components/GameConsole/styles/index.module.scss b/src/ts/components/GameConsole/styles/index.module.scss deleted file mode 100644 index b7d3efa..0000000 --- a/src/ts/components/GameConsole/styles/index.module.scss +++ /dev/null @@ -1,39 +0,0 @@ -.game_console { - position: relative; - display: inline-block; - width: 100%; - margin: 0 auto var(--space-xxl); - - text-align: left; - background-repeat: no-repeat; - background-size: auto 100%; - background-position: top left; - - &_select { - display: block; - width: 500px; - } - - &_monitor { - font-size: var(--font-s); - font-weight: 100; - - display: block; - width: 500px; - height: 250px; - padding: 8px; - margin: 0 0 var(--space-xxl); - - overflow: hidden; - box-sizing: border-box; - line-height: 1.3; - text-align: left; - white-space: nowrap; - border-radius: var(--border-radius-s); - - border: 4px solid var(--color-32); - box-shadow: 0 0 10px var(--color-black); - color: #00B200; - background-color: var(--color-black); - } -} diff --git a/src/ts/helpers/DataGrip/components/author.ts b/src/ts/helpers/DataGrip/components/author.ts index 92ad9a4..74e13f5 100644 --- a/src/ts/helpers/DataGrip/components/author.ts +++ b/src/ts/helpers/DataGrip/components/author.ts @@ -2,6 +2,7 @@ import ICommit from 'ts/interfaces/Commit'; import IHashMap from 'ts/interfaces/HashMap'; import { ONE_DAY } from 'ts/helpers/formatter'; +import { increment } from 'ts/helpers/Math'; import settingsStore from 'ts/store/Settings'; import userSettings from 'ts/store/UserSettings'; @@ -40,8 +41,8 @@ export default class DataGripByAuthor { statistic.days[commit.timestamp] = true; statistic.tasks[commit.task] = commit.added + commit.changes + commit.removed + (statistic.tasks[commit.task] ? statistic.tasks[commit.task] : 0); - statistic.types[commit.type] = statistic.types[commit.type] ? (statistic.types[commit.type] + 1) : 1; - statistic.scopes[commit.scope] = statistic.scopes[commit.scope] ? (statistic.scopes[commit.scope] + 1) : 1; + increment(statistic.types, commit.type); + increment(statistic.scopes, commit.scope); statistic.hours.push(commit.hours); statistic.messageLength.push(commit.text.length); statistic.totalMessageLength += commit.text.length || 0; @@ -130,9 +131,7 @@ export default class DataGripByAuthor { commit.text.toLowerCase().split(' ').forEach(word => { if (word.length <= LIMIT_WORD_LENGTH || disabledWords[word]) return; - total[word] = total[word] - ? (total[word] + 1) - : 1; + increment(total, word); }); return total; diff --git a/src/ts/helpers/DataGrip/components/pr.ts b/src/ts/helpers/DataGrip/components/pr.ts index a6e863b..3b65885 100644 --- a/src/ts/helpers/DataGrip/components/pr.ts +++ b/src/ts/helpers/DataGrip/components/pr.ts @@ -1,6 +1,6 @@ import { COMMIT_TYPE, ISystemCommit } from 'ts/interfaces/Commit'; import IHashMap from 'ts/interfaces/HashMap'; -import { WeightedAverage } from 'ts/helpers/Math'; +import { increment, WeightedAverage } from 'ts/helpers/Math'; export default class DataGripByPR { pr: IHashMap = {}; @@ -49,9 +49,7 @@ export default class DataGripByPR { const statistic = this.lastCommitByTaskNumber[commit.task]; statistic.endTaskTime = commit.milliseconds; statistic.commits += 1; - statistic.commitsByAuthors[commit.author] = statistic.commitsByAuthors[commit.author] - ? (statistic.commitsByAuthors[commit.author] + 1) - : 1; + increment(statistic.commitsByAuthors, commit.author); } #addCommitByPR(commit: ISystemCommit) { diff --git a/src/ts/helpers/DataGrip/components/scope.ts b/src/ts/helpers/DataGrip/components/scope.ts index 4f7f069..9c58905 100644 --- a/src/ts/helpers/DataGrip/components/scope.ts +++ b/src/ts/helpers/DataGrip/components/scope.ts @@ -1,13 +1,29 @@ import ICommit from 'ts/interfaces/Commit'; import IHashMap from 'ts/interfaces/HashMap'; import settingsStore from 'ts/store/Settings'; +import { increment } from 'ts/helpers/Math'; + +interface IStatByAuthor { + commits: number; // number of commits by author in this scope + days: IHashMap; // commit timestamp + types: IHashMap; // commit type by author in this scope (fix, feat) +} + +interface IStatByScope { + scope: string; // scope name + commits: number; // number of commits in this scope + days: IHashMap; // commit timestamp + tasks: IHashMap; // task name in this scope (JIRA-123) + types: IHashMap; // commit type in this scope (fix, feat) + authors: IHashMap; // stat by author for this scope +} export default class DataGripByScope { - list: string[] = []; + list: string[] = []; // scope names - commits: IHashMap = {}; + commits: IHashMap = {}; - statistic: any = []; + statistic: IStatByScope[] = []; clear() { this.list = []; @@ -24,16 +40,17 @@ export default class DataGripByScope { } #updateCommitByScope(commit: ICommit) { - const statistic = this.commits[commit.scope]; + const statistic = this.commits[commit.scope] as IStatByScope; statistic.commits += 1; statistic.days[commit.timestamp] = true; statistic.tasks[commit.task] = true; - statistic.types[commit.type] = statistic.types[commit.type] ? (statistic.types[commit.type] + 1) : 1; + increment(statistic.types, commit.type); + const author = statistic.authors[commit.author]; if (author) { author.commits += 1; author.days[commit.timestamp] = true; - author.types[commit.type] = author.types[commit.type] ? (author.types[commit.type] + 1) : 1; + increment(author.types, commit.type); } else { statistic.authors[commit.author] = this.#getDefaultAuthorForScope(commit); } @@ -50,7 +67,7 @@ export default class DataGripByScope { }; } - #getDefaultAuthorForScope(commit: ICommit) { + #getDefaultAuthorForScope(commit: ICommit): IStatByAuthor { return { commits: 1, days: { [commit.timestamp]: true }, diff --git a/src/ts/helpers/DataGrip/components/tasks.ts b/src/ts/helpers/DataGrip/components/tasks.ts index 96bda33..91bcd32 100644 --- a/src/ts/helpers/DataGrip/components/tasks.ts +++ b/src/ts/helpers/DataGrip/components/tasks.ts @@ -33,6 +33,7 @@ export default class DataGripByTasks { this.commits[commit.task] = [commit]; } + // TODO: тут двойной пробег получился. А должен был частями собрать инфу updateTotalInfo(PRs: any) { this.statistic = Object.entries(this.commits) .map(([task, commits]: [string, ICommit[]]) => { diff --git a/src/ts/helpers/DataGrip/components/timestamp.ts b/src/ts/helpers/DataGrip/components/timestamp.ts index 9089a59..6f418a2 100644 --- a/src/ts/helpers/DataGrip/components/timestamp.ts +++ b/src/ts/helpers/DataGrip/components/timestamp.ts @@ -1,6 +1,7 @@ import ICommit from 'ts/interfaces/Commit'; import IHashMap from 'ts/interfaces/HashMap'; import settingsStore from 'ts/store/Settings'; +import { increment } from 'ts/helpers/Math'; import MinMaxCounter from './counter'; @@ -43,9 +44,7 @@ export default class DataGripByTimestamp { #updateCommitByTimestamp(commit: ICommit, statistic: any) { statistic.commits += 1; statistic.addedAndChanges += commit.added + commit.changes; - statistic.tasks[commit.task] = statistic.tasks[commit.task] - ? (statistic.tasks[commit.task] + 1) - : 1; + increment(statistic.tasks, commit.task); if (!statistic.tasksByAuthor[commit.author]) { statistic.tasksByAuthor[commit.author] = {}; } diff --git a/src/ts/helpers/DataGrip/components/type.ts b/src/ts/helpers/DataGrip/components/type.ts index a9d1d4c..330e7ea 100644 --- a/src/ts/helpers/DataGrip/components/type.ts +++ b/src/ts/helpers/DataGrip/components/type.ts @@ -1,11 +1,12 @@ import ICommit from 'ts/interfaces/Commit'; import IHashMap from 'ts/interfaces/HashMap'; +import { increment } from 'ts/helpers/Math'; export default class DataGripByType { list: string[] = []; - + commits: IHashMap = {}; - + statistic: any = []; clear() { @@ -28,14 +29,9 @@ export default class DataGripByType { statistic.days[commit.timestamp] = true; statistic.tasks[commit.task] = true; - const getIncrement = (v?: number) => v ? (v + 1) : 1; - const setDefault = (s: any, v: string) => { - if (!s[v]) s[v] = {}; - return s[v]; - }; - - statistic.commitsByAuthors[commit.author] = getIncrement(statistic.commitsByAuthors[commit.author]); - setDefault(statistic.daysByAuthors, commit.author)[commit.timestamp] = getIncrement(statistic.daysByAuthors[commit.author][commit.timestamp]); + increment(statistic.commitsByAuthors, commit.author); + if (!statistic.daysByAuthors[commit.author]) statistic.daysByAuthors[commit.author] = {}; + increment(statistic.daysByAuthors[commit.author], commit.timestamp); } #addCommitByType(commit: ICommit) { diff --git a/src/ts/helpers/DataGrip/components/week.ts b/src/ts/helpers/DataGrip/components/week.ts index e383775..a964d5f 100644 --- a/src/ts/helpers/DataGrip/components/week.ts +++ b/src/ts/helpers/DataGrip/components/week.ts @@ -1,12 +1,13 @@ import ICommit from 'ts/interfaces/Commit'; import IHashMap from 'ts/interfaces/HashMap'; import settingsStore from 'ts/store/Settings'; +import { increment } from 'ts/helpers/Math'; export default class DataGripByWeek { commits: IHashMap = {}; - + statistic: any = []; - + constructor() { this.clear(); } @@ -30,7 +31,6 @@ export default class DataGripByWeek { statistic.tasks[commit.task] = true; statistic.timestamp.to = commit.timestamp; - const getIncrement = (v?: number) => v ? (v + 1) : 1; const setDefault = (s: any, v: string) => { if (!s[v]) s[v] = {}; return s[v]; @@ -40,9 +40,10 @@ export default class DataGripByWeek { setDefault(statistic.authors, commit.author)[commit.task] = true; setDefault(statistic.workDays, commit.author)[commit.day] = true; - setDefault(statistic.typeByAuthor, commit.author)[commit.type] = getIncrement(statistic.typeByAuthor[commit.author][commit.type]); - statistic.types[commit.type] = getIncrement(statistic.types[commit.type]); + if (!statistic.typeByAuthor[commit.author]) statistic.typeByAuthor[commit.author] = {}; + increment(statistic.typeByAuthor[commit.author], commit.type); + increment(statistic.types, commit.type); } #addCommitByWeek(commit: ICommit) { @@ -108,4 +109,4 @@ export default class DataGripByWeek { }; }).reverse(); } -} \ No newline at end of file +} diff --git a/src/ts/helpers/FileGrip/components/author.ts b/src/ts/helpers/FileGrip/components/author.ts index a3d5077..f82fe36 100644 --- a/src/ts/helpers/FileGrip/components/author.ts +++ b/src/ts/helpers/FileGrip/components/author.ts @@ -1,8 +1,14 @@ import IHashMap from 'ts/interfaces/HashMap'; import { IDirtyFile } from 'ts/interfaces/FileInfo'; +interface IStatByAuthor { + addedFiles: number; + removedFiles: number; + addedWithoutRemoveFiles: number; +} + export default class FileGripByAuthor { - statisticByName: IHashMap = {}; + statisticByName: IHashMap = {}; totalAddedFiles: number = 0; diff --git a/src/ts/helpers/FileGrip/components/extension.ts b/src/ts/helpers/FileGrip/components/extension.ts index 08d2ed6..da38cc0 100644 --- a/src/ts/helpers/FileGrip/components/extension.ts +++ b/src/ts/helpers/FileGrip/components/extension.ts @@ -1,6 +1,16 @@ import IHashMap from 'ts/interfaces/HashMap'; import { IDirtyFile } from 'ts/interfaces/FileInfo'; +interface IStatByExtension { + extension: string; // extension name + task?: string; // first file with this type was created in task + path: string; // first file with this type has path, + files: IDirtyFile[], // all files with this type + count: number, // TODO: remove? + removedFiles: IDirtyFile[], // all removed files with this type + removedCount: number, // TODO: remove? +} + const IGNORE_LIST = [ '.eslintrc', '.gitignore', @@ -10,9 +20,9 @@ const IGNORE_LIST = [ ]; export default class FileGripByExtension { - statistic: any = []; + statistic: IStatByExtension[] = []; - statisticByName: IHashMap = {}; + statisticByName: IHashMap = {}; property: string = ''; @@ -44,7 +54,7 @@ export default class FileGripByExtension { } } - #getNewExtension(file: IDirtyFile) { + #getNewExtension(file: IDirtyFile): IStatByExtension { return { extension: file?.extension, task: file?.firstCommit?.task, diff --git a/src/ts/helpers/FileGrip/components/type.ts b/src/ts/helpers/FileGrip/components/type.ts index df871f9..150ff36 100644 --- a/src/ts/helpers/FileGrip/components/type.ts +++ b/src/ts/helpers/FileGrip/components/type.ts @@ -1,10 +1,21 @@ import IHashMap from 'ts/interfaces/HashMap'; import { IDirtyFile } from 'ts/interfaces/FileInfo'; -export default class FileGripByType { - statistic: any = []; +interface IStatByType { + type: string; // type name + task?: string; // first file with this type was created in task + path: string; // first file with this type has path, + extension: IHashMap; // the number of extensions with this type + files: IDirtyFile[], // all files with this type + count: number, // TODO: remove? + removedFiles: IDirtyFile[], // all removed files with this type + removedCount: number, // TODO: remove? +} - statisticByName: IHashMap = {}; +export default class FileGripByType { + statistic: IStatByType[] = []; + + statisticByName: IHashMap = {}; clear() { this.statistic = []; @@ -34,7 +45,7 @@ export default class FileGripByType { } } - #getNewType(file: IDirtyFile) { + #getNewType(file: IDirtyFile): IStatByType { return { type: file?.type, task: file?.firstCommit?.task, diff --git a/src/ts/helpers/Math.ts b/src/ts/helpers/Math.ts index 9229117..c70bcd5 100644 --- a/src/ts/helpers/Math.ts +++ b/src/ts/helpers/Math.ts @@ -35,3 +35,7 @@ export class WeightedAverage { return value / count; } } + +export function increment(object: Object, path: string) { + object[path] = (object[path] || 0) + 1; +} diff --git a/src/ts/helpers/Parser/index.ts b/src/ts/helpers/Parser/index.ts index ffad7dc..9b6441d 100644 --- a/src/ts/helpers/Parser/index.ts +++ b/src/ts/helpers/Parser/index.ts @@ -26,7 +26,9 @@ export default function Parser(report: string[]) { if (!message) continue; const index = message.indexOf('\t'); - if (index > 0 && index < 10) { // парсинг файлов формата --num-stat + if (index > 0 && index < 10) { + // парсинг файлов формата --num-stat + // "1 0 .browserlistrc" const line = getNumStatInfo(message); if (!files[line.path]) { files[line.path] = getInfoFromPath(line.path); @@ -37,7 +39,9 @@ export default function Parser(report: string[]) { fileChanges.changedLines = line.changedLines; updateLineTotal(commit, line); - } else if (message[0] === ':') { // парсинг файлов формата --raw + } else if (message[0] === ':') { + // парсинг файлов формата --raw + // ":000000 100644 0000000 496d1ef A .browserlistrc" const line = getRawInfo(message); if (!files[line.path]) { files[line.path] = getInfoFromPath(line.path); @@ -45,7 +49,9 @@ export default function Parser(report: string[]) { fileChanges = files[line.path]; fileChanges.action = line.action; - } else { // парсинг коммита + } else { + // парсинг коммита + // "2021-02-09T16:08:15+03:00>Albert>instein@mail.de>feat(init): added the speed of light" if (commit) commit.fileChanges = Object.values(files); files = {}; commit = getCommitInfo(message); diff --git a/src/ts/pages/Authorization/components/Loading.tsx b/src/ts/pages/Authorization/components/Loading.tsx deleted file mode 100644 index 15c594d..0000000 --- a/src/ts/pages/Authorization/components/Loading.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react'; -import { observer } from 'mobx-react-lite'; - -const Loading = observer(() => { - return ( -

- получение токенов... -

- ); -}); - -export default Loading; diff --git a/src/ts/pages/Authorization/components/Login.tsx b/src/ts/pages/Authorization/components/Login.tsx deleted file mode 100644 index 0642cee..0000000 --- a/src/ts/pages/Authorization/components/Login.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react'; -import { observer } from 'mobx-react-lite'; - -const Login = observer(() => { - return ( - <> - Login - - ); -}); - -export default Login; diff --git a/src/ts/pages/Authorization/components/Success.tsx b/src/ts/pages/Authorization/components/Success.tsx deleted file mode 100644 index 7d0bf92..0000000 --- a/src/ts/pages/Authorization/components/Success.tsx +++ /dev/null @@ -1,128 +0,0 @@ -import React, { useEffect, useState } from 'react'; -import { Route, Routes } from 'react-router-dom'; -import { observer } from 'mobx-react-lite'; - -import dataGripStore, { DataParseStatusEnum } from 'ts/store/DataGrip'; -import DropZone from 'ts/components/DropZone'; -import Sponsor from 'ts/components/Sponsor'; -import SplashScreen from 'ts/components/SplashScreen'; -import Confirm from 'ts/components/ModalWindow/Confirm'; - -import PageWrapper from '../../PageWrapper'; -import Team from '../../Team/index'; -import Person from '../../Person/index'; -import PrintAll from '../../PrintAll/index'; -import Welcome from '../../Welcome/index'; -import Settings from '../../Settings/index'; -import DebugPage from '../../Debug/index'; - -interface IViewWithChartsProps { - showSplashScreen: boolean; -} - -function ViewWithCharts({ showSplashScreen }: IViewWithChartsProps) { - return ( - <> - - - - - - - )} - /> - - - - )} - /> - - - - )} - /> - - - - )} - /> - - - - )} - /> - - - - )} - /> - - {showSplashScreen && } - - ); -} - -function ViewWithWelcome() { - return ( - - - )} - /> - - ); -} - -const Success = observer(() => { - const [showSplashScreen, setShowSplashScreen] = useState(true); - const status = dataGripStore.status; - - useEffect(() => { - // @ts-ignore - dataGripStore.setCommits(window?.report || []); - }, []); - - if (status === DataParseStatusEnum.PROCESSING) return null; - - return ( - <> - {status === DataParseStatusEnum.DONE && ( - - )} - {status === DataParseStatusEnum.WAITING && ( - - )} - { - setShowSplashScreen(false); - if (type === 'dump') dataGripStore.setCommits(data); - setTimeout(() => { - setShowSplashScreen(true); - }); - }} - /> - - ); -}); - -export default Success; diff --git a/src/ts/pages/Authorization/components/Wrapper.tsx b/src/ts/pages/Authorization/components/Wrapper.tsx deleted file mode 100644 index 910786a..0000000 --- a/src/ts/pages/Authorization/components/Wrapper.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import React, { ReactNode } from 'react'; - -interface IWrapperProps { - children: ReactNode -} - -function Wrapper({ children }: IWrapperProps) { - const className = 'authorization-sidebar'; - return ( -
-
-
- {children} -
-
- ); -} - -export default Wrapper; diff --git a/src/ts/pages/Authorization/index.tsx b/src/ts/pages/Authorization/index.tsx deleted file mode 100644 index 6dadfe0..0000000 --- a/src/ts/pages/Authorization/index.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import React from 'react'; -import { observer } from 'mobx-react-lite'; - -import authorizationStore from './store/AuthorizationStore'; -import Success from './components/Success'; - -const Authorization = observer(() => { - const { state, isInitialization } = authorizationStore; - - if (true || state === 'SUCCESS') return (); - if (isInitialization) return null; - - const content = state === 'LOGIN' - ? (

login

) - : (

loading

); - - return ( -
- {content} -
- ); -}); - -export default Authorization; diff --git a/src/ts/pages/Authorization/store/AuthorizationStore.ts b/src/ts/pages/Authorization/store/AuthorizationStore.ts deleted file mode 100644 index 2a5c66c..0000000 --- a/src/ts/pages/Authorization/store/AuthorizationStore.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { - makeAutoObservable, - observable, -} from 'mobx'; - -class AuthorizationStore { - state: string = 'WAITING'; - - isInitialization: boolean = true; - - constructor() { - makeAutoObservable(this, { - state: observable, - isInitialization: observable, - }); - } -} - -const authorizationStore = new AuthorizationStore(); - -export default authorizationStore; diff --git a/src/ts/pages/Team/components/Top.tsx b/src/ts/pages/Team/components/Top.tsx index 3355072..9064046 100644 --- a/src/ts/pages/Team/components/Top.tsx +++ b/src/ts/pages/Team/components/Top.tsx @@ -7,7 +7,6 @@ import Title from 'ts/components/Title'; import Races from 'ts/components/Races'; import CityBuilder from 'ts/components/CityBuilder'; -import GameConsole from 'ts/components/GameConsole'; import SwimmingPool from 'ts/components/SwimmingPool'; import Quize from 'ts/components/Quize'; @@ -45,7 +44,6 @@ const TeamBuilding = observer((): React.ReactElement => { <CityBuilder valuesByTitle={addedFilesByAuthor} /> <Title title="Скорость коммитов в день"/> - <GameConsole /> {'Небоскребы вверх ввиде графика'} </> );