generated from yandex-praktikum/client-server-template-with-vite
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'refs/remotes/origin/develop' into SOK-2…
…7_game-prototype # Conflicts: # packages/client/src/app/App.tsx # packages/client/src/pages/Game/Game.tsx
- Loading branch information
Showing
29 changed files
with
2,947 additions
and
542 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
packages/client/src/components/ui/BreadCrumbs/BreadCrumbs.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
@import '../../../scss/vars'; | ||
|
||
$breadcrumbs-text-color: $c_white; | ||
|
||
.breadcrumbs { | ||
&__item { | ||
color: $breadcrumbs-text-color; | ||
|
||
&:not(:last-child)::after { | ||
content: '>'; | ||
margin: 9px; | ||
|
||
font-size: 14px; | ||
|
||
display: inline-block; | ||
text-decoration: none; | ||
} | ||
|
||
&:last-child { | ||
text-decoration: none; | ||
} | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
packages/client/src/components/ui/BreadCrumbs/BreadCrumbs.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { Link } from 'react-router-dom' | ||
import './BreadCrumbs.scss' | ||
|
||
type BreadCrumb = { | ||
title: string | ||
href: string | ||
} | ||
|
||
interface BreadCrumbsProps { | ||
breadCrumbs: BreadCrumb[] | ||
className?: string | ||
} | ||
|
||
export const BreadCrumbs = (props: BreadCrumbsProps) => { | ||
const { breadCrumbs, className } = props | ||
|
||
return ( | ||
<nav className={`breadcrumbs ${className}`}> | ||
{breadCrumbs.map((crumb, index) => ( | ||
<Link className="breadcrumbs__item" key={index} to={crumb.href}> | ||
{crumb.title} | ||
</Link> | ||
))} | ||
</nav> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
packages/client/src/components/ui/Button/CompactButton.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
@import '../../../scss/vars'; | ||
|
||
$c_compact-button-border-top: $c_white; | ||
$c_compact-button-border-bottom: #999999; | ||
$c_compact-button-background-color: #d2d2d2; | ||
$c_compact-button-text-color: #242424; | ||
|
||
.compact-button { | ||
border-width: 2px; | ||
border-radius: 8px; | ||
padding: 10px; | ||
|
||
span { | ||
text-transform: none; | ||
text-shadow: none; | ||
font-size: 14px; | ||
font-weight: 800; | ||
letter-spacing: 1px; | ||
} | ||
|
||
&_white { | ||
background-color: $c_compact-button-background-color; | ||
border-top: 2px solid $c_compact-button-border-top; | ||
border-bottom: 2px solid $c_compact-button-border-bottom; | ||
padding: 10px; | ||
|
||
&:hover { | ||
border-top: 2x solid $c_compact-button-border-bottom; | ||
border-bottom: 2px solid $c_compact-button-border-top; | ||
} | ||
|
||
span { | ||
text-shadow: none; | ||
color: $c_compact-button-text-color; | ||
text-transform: none; | ||
letter-spacing: 1px; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
@import '../../../scss/vars'; | ||
|
||
$decor-width: 90px; | ||
$decor-height: 7px; | ||
$c_card-background: $c_almost-black; | ||
$c_card-border: #9baf5d; | ||
$c_card-padding: $c_gray; | ||
|
||
@mixin decor($top, $bottom) { | ||
content: ''; | ||
position: absolute; | ||
top: $top; | ||
bottom: $bottom; | ||
left: calc(50% - ($decor-width / 2)); | ||
|
||
display: block; | ||
width: $decor-width; | ||
height: $decor-height; | ||
|
||
background-image: url('@/assets/images/svg/title-decor.svg'); | ||
background-repeat: no-repeat; | ||
background-position: center; | ||
} | ||
|
||
.card { | ||
border: 2px solid $c_card-border; | ||
background-color: $c_card-padding; | ||
border-radius: 16px; | ||
padding: 8px; | ||
position: relative; | ||
|
||
&::before { | ||
@include decor(0, 'auto'); | ||
} | ||
|
||
&::after { | ||
@include decor('auto', 0); | ||
|
||
transform: rotate(180deg); | ||
} | ||
|
||
&__content { | ||
background-color: $c_card-background; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import './Card.scss' | ||
|
||
interface CardProps { | ||
className?: string | ||
children: React.ReactNode | ||
} | ||
|
||
export const Card = (props: CardProps) => { | ||
const { className = '', children } = props | ||
return ( | ||
<div className={'card'}> | ||
<div className={`card__content${className ? ` ${className}` : ''}`}> | ||
{children} | ||
</div> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
@import '../../../scss/vars'; | ||
|
||
.file { | ||
display: flex; | ||
align-items: center; | ||
gap: 9px; | ||
background-color: transparent; | ||
border: none; | ||
color: $c_white; | ||
text-decoration: underline; | ||
align-self: flex-start; | ||
cursor: pointer; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Icon } from '../Icon/Icon' | ||
import './File.scss' | ||
|
||
interface FileProps { | ||
className?: string | ||
} | ||
|
||
export const File = (props: FileProps) => { | ||
const { className = '' } = props | ||
return ( | ||
<> | ||
{/* TODO: Implement the logic of the file upload component */} | ||
{/* <input type="file" /> */} | ||
<button className={`file${className ? ' className' : ''}`}> | ||
<Icon id="attach-icon" width={11} height={13} /> | ||
Прикрепить файл | ||
</button> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
@import './../../../scss/vars.scss'; | ||
|
||
.pagination { | ||
display: flex; | ||
gap: 6px; | ||
} |
42 changes: 42 additions & 0 deletions
42
packages/client/src/components/ui/Pagination/Pagination.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { useNavigate } from 'react-router-dom' | ||
import { Button } from '../Button/Button' | ||
import './Pagination.scss' | ||
|
||
interface PaginationProps { | ||
total: number | ||
className?: string | ||
} | ||
|
||
export const Pagination = (props: PaginationProps) => { | ||
const { total, className = '' } = props | ||
|
||
const navigate = useNavigate() | ||
|
||
const getClassName = (index: number) => { | ||
// TODO: Реализовать эту логику основываясь на query в URL`е. | ||
// Какая страница активна, такая кнопка и подсвечивается. | ||
return `pagination__item compact-button${ | ||
index !== 0 ? ' compact-button_white' : '' | ||
}` | ||
} | ||
|
||
return ( | ||
<div className={`pagination${className ? ` ${className}` : ''}`}> | ||
{Array.from({ length: total }).map((_, index) => { | ||
return ( | ||
<Button | ||
key={index} | ||
className={getClassName(index)} | ||
onClick={() => navigate(`/forum/${index}`)} | ||
text={(++index).toString()} | ||
useFixWidth={false}></Button> | ||
) | ||
})} | ||
<Button | ||
className="compact-button compact-button_white" | ||
onClick={() => navigate('/forum')} | ||
text="Вперед" | ||
useFixWidth={false}></Button> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
@import './../../scss/vars.scss'; | ||
|
||
@mixin input() { | ||
background-color: $c_black; | ||
border-radius: 12px; | ||
border: 2px solid $c_input-default-border; | ||
color: $c_white; | ||
padding: 12px 16px; | ||
|
||
&::placeholder { | ||
color: $c_input-default-placeholder; | ||
} | ||
} | ||
|
||
.create-thread-page { | ||
&::after { | ||
content: ''; | ||
position: absolute; | ||
z-index: -1; | ||
right: 0; | ||
bottom: 0; | ||
width: 360px; | ||
height: 165px; | ||
background-image: url('@/assets/images/destroyed-tanks.png'); | ||
} | ||
|
||
margin-top: 100px; | ||
|
||
.thread-name { | ||
width: 50%; | ||
text-align: start; | ||
} | ||
|
||
.form { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 16px; | ||
|
||
&__textarea { | ||
@include input(); | ||
|
||
max-width: 100%; | ||
min-width: 300px; | ||
min-height: 130px; | ||
} | ||
|
||
&__submit { | ||
align-self: flex-start; | ||
} | ||
} | ||
} |
Oops, something went wrong.