Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bakhirev committed Nov 22, 2024
1 parent 500c7a3 commit 1c59fc0
Show file tree
Hide file tree
Showing 33 changed files with 120 additions and 109 deletions.
Binary file modified build/assets/games/quize/cloud.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified build/assets/games/races/bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed build/assets/games/races/car2.png
Binary file not shown.
Binary file modified build/assets/games/races/greenBottom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified build/assets/games/swimmingPool/bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion build/assets/menu/team_release.svg

This file was deleted.

4 changes: 2 additions & 2 deletions build/static/index.css

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions build/static/index.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
},
"scripts": {
"dev": "set PORT=3006 && react-app-rewired start",
"build": "react-app-rewired build",
"build:website": "react-app-rewired build && cd scripts && node add-analytics.js",
"build:local": "react-app-rewired build && cd scripts && node remove-hash.js && node add-local.js",
"build:docker": "react-app-rewired build",
Expand Down
Binary file modified public/assets/games/quize/cloud.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/assets/games/races/bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/assets/games/races/car2.png
Binary file not shown.
Binary file modified public/assets/games/races/greenBottom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/assets/games/swimmingPool/bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion public/assets/menu/team_release.svg

This file was deleted.

1 change: 1 addition & 0 deletions src/ts/components/GameBanner/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
width: 100%;
padding: var(--space-xxl) var(--space-xxl) 0;

text-align: center;
background-color: rgba(0, 0, 0, 0.7);
}

Expand Down
9 changes: 6 additions & 3 deletions src/ts/components/Quiz/components/Question.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ function Question({
const [disabled, setDisabled] = useState<boolean>(false);
const [mode, setMode] = useState<string[]>([]);
const formattedAnswers = question.answers || [];
const hideClassName = disabled
? stylePage.quiz_question_hide
: '';

useEffect(() => {
setMode([]);
Expand All @@ -41,7 +44,7 @@ function Question({

const answers = formattedAnswers.map((item: IAnswer, index: number) => (
<Answer
key={`${item.id || ''}|${item.title}`}
key={`${item.id || ''}|${item.title}|${index}`}
mode={mode[index]}
answer={item}
onClick={() => {
Expand Down Expand Up @@ -70,15 +73,15 @@ function Question({
<div className={stylePage.quiz_question}>
<div className={stylePage.quiz_question_body}>
<div
className={style.quiz_title}
className={`${style.quiz_title} ${hideClassName}`}
style={{ backgroundImage: 'url(./assets/games/quize/cloud_big.png)' }}
>
{question.title}
</div>
<div className={style.quiz_question_answer}>
{answers}
</div>
<div className={style.quiz_footer}>
<div className={`${style.quiz_footer} ${hideClassName}`}>
<UiKitButton
disabled={disabled}
onClick={() => {
Expand Down
71 changes: 0 additions & 71 deletions src/ts/components/Quiz/helpers/example.ts

This file was deleted.

11 changes: 4 additions & 7 deletions src/ts/components/Quiz/index.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
import React from 'react';

import IQuiz from './interfaces/Quiz';
import QuizPage from './components/index';
import example from './helpers/example';
import getQuizQuestions from './helpers/getQuestions';

interface IQuizProps {
}

function Quiz({}: IQuizProps): React.ReactElement | null {
function Quiz(): React.ReactElement | null {
const questions = getQuizQuestions();
return (
<QuizPage
quiz={example as IQuiz}
quiz={questions}
onEnd={() => {
}}
/>
Expand Down
5 changes: 5 additions & 0 deletions src/ts/components/Quiz/styles/answer.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,13 @@
@keyframes quiz_answer {
from {
top: 0;
opacity: 1;
}
30% {
opacity: 0.3;
}
to {
top: 800px;
opacity: 0.3;
}
}
16 changes: 16 additions & 0 deletions src/ts/components/Quiz/styles/question.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,20 @@
display: block;
text-align: center;
}

&_hide {
animation-duration: 0.5s;
animation-iteration-count: 1;
animation-fill-mode: both;
animation-name: quiz_question_hide;
}
}

@keyframes quiz_question_hide {
from {
opacity: 1;
}
to {
opacity: 0;
}
}
3 changes: 1 addition & 2 deletions src/ts/components/Races/components/Info.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@ function Info({
title,
duration,
}: IInfoProps): React.ReactElement | null {
console.log(title);
return (
<div
className={style.races_track_info}
style={{
animationDelay: `${duration + 1}s`,
}}
>
4
{title}
</div>
);
}
Expand Down
4 changes: 3 additions & 1 deletion src/ts/components/Races/components/Track.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ const DURATION = {

interface ITrackProps {
title: string;
position: string;
speed: number;
type?: string;
canStart?: boolean;
}

function Track({
title,
position,
speed,
type,
canStart,
Expand All @@ -35,7 +37,7 @@ function Track({
>
{canStart && (
<Info
title={title}
title={position}
duration={duration}
/>
)}
Expand Down
3 changes: 2 additions & 1 deletion src/ts/components/Races/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ function Races({
<Track
key={track.title}
title={track.title}
position={track.position}
speed={track.speed}
canStart={showAnimation}
/>
Expand All @@ -47,7 +48,7 @@ function Races({
setShowAnimation(true);
}}
>
{t('uiKit.races.go')}
{t('page.team.building.races.go')}
</UiKitButton>
)}
</GameBanner>
Expand Down
2 changes: 1 addition & 1 deletion src/ts/helpers/DataGrip/components/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default class DataGripByRelease {
}

#addRelease(branch: string, commit: ISystemCommit) {
const index = branch.lastIndexOf('release');
const index = (branch || '').lastIndexOf('release');
if (index === -1) return false;

const title = branch
Expand Down
8 changes: 7 additions & 1 deletion src/ts/pages/PageWrapper/helpers/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export const TEAM = [
id: 'release',
link: '/team/release',
title: 'sidebar.team.release',
icon: './assets/menu/team_release.svg',
icon: './assets/menu/release.svg',
},
{
id: 'tasks',
Expand Down Expand Up @@ -142,6 +142,12 @@ export const TEAM = [
title: 'sidebar.team.words',
icon: './assets/menu/team_words.svg',
},
{
id: 'building',
link: '/team/building',
title: 'sidebar.team.building',
icon: './assets/menu/building.svg',
},
];

export const PERSON = [
Expand Down
5 changes: 4 additions & 1 deletion src/ts/pages/PageWrapper/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ const DesktopView = observer(({ children }: IPageWrapper): React.ReactElement =>
if (fullScreen.isOpen) {
return (
<>
<div className={style.page_wrapper_main_fullscreen}>
<div
className={style.page_wrapper_main_fullscreen}
style={padding}
>
{children}
</div>
<Recommendations/>
Expand Down
41 changes: 35 additions & 6 deletions src/ts/pages/Team/components/Building.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,60 @@ import { observer } from 'mobx-react-lite';

import dataGripStore from 'ts/store/DataGrip';

import Title from 'ts/components/Title';
import Races from 'ts/components/Races';

import SwimmingPool from 'ts/components/SwimmingPool';
import Quiz from 'ts/components/Quiz';
import BillBoard from 'ts/components/BillBoard';
import isMobile from 'ts/helpers/isMobile';
import fullScreen from 'ts/store/FullScreen';

import style from '../styles/quiz.module.scss';

const TeamBuilding = observer((): React.ReactElement => {
const tracksAuth = dataGripStore.dataGrip.author.statistic
.filter((item: any) => !item.isStaff);
const value = tracksAuth.map((statistic: any) => statistic.taskInDay);
const max = Math.max(...value);
const order = tracksAuth.map((statistic: any) => statistic.taskInDay);
order.sort((a:number, b:number) => b - a);
const tracks = tracksAuth.map((statistic: any) => ({
title: statistic.author,
speed: statistic.taskInDay / max,
position: order.indexOf(statistic.taskInDay) + 1,
speed: statistic.taskInDay / order[0],
}));

const maxMessageLength = [...tracksAuth]
.sort((a: any, b: any) => b.maxMessageLength - a.maxMessageLength)
.map((item: any) => ({ title: item.author, value: item.maxMessageLength }));

const className = fullScreen.isOpen
? style.team_building_full_screen_open
: style.team_building_full_screen_close;

return (
<>
<Quiz />
{!isMobile && (
<img
src={fullScreen.isOpen
? './assets/icons/CloseFullscreen.svg'
: './assets/icons/OpenFullscreen.svg'}
className={className}
onClick={() => {
fullScreen.toggle();
}}
/>
)}
{Math.random() > 1 && (
<Quiz />
)}
<BillBoard
title="page.team.building.races.title"
type="cloud"
/>
<Races tracks={tracks} />
<Title title="Максимальная длинна подписи коммита"/>
<BillBoard
title="page.team.building.swimmingPool.title"
type="green"
/>
<SwimmingPool tracks={maxMessageLength}/>
</>
);
Expand Down
6 changes: 5 additions & 1 deletion src/ts/pages/Team/components/Company/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import { observer } from 'mobx-react-lite';
import ISort from 'ts/interfaces/Sort';
import { IPaginationRequest } from 'ts/interfaces/Pagination';
import dataGripStore from 'ts/store/DataGrip';
import fullScreen from 'ts/store/FullScreen';

import ICommonPageProps from 'ts/components/Page/interfaces/CommonPageProps';
import DataLoader from 'ts/components/DataLoader';
import Pagination from 'ts/components/DataLoader/components/Pagination';
import getFakeLoader from 'ts/components/DataLoader/helpers/formatter';
import NothingFound from 'ts/components/NothingFound';
import Title from 'ts/components/Title';

import Companies from './components/Companies';
import CompanyCharts from './components/Charts';

Expand All @@ -25,7 +27,9 @@ const Company = observer(({

return (
<>
<CompanyCharts />
{!fullScreen.isOpen && (
<CompanyCharts />
)}
<Title title="page.team.company.title"/>
<DataLoader
to="response"
Expand Down
Loading

0 comments on commit 1c59fc0

Please sign in to comment.