-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
256 additions
and
19 deletions.
There are no files selected for viewing
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
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,55 @@ | ||
[ | ||
{ | ||
"id": "2023_1", | ||
"year": 2023, | ||
"name": "Kosyk's Open 2023", | ||
"logo": "logo-KO", | ||
"status": "Завершений", | ||
"stages": [ | ||
{ | ||
"date": "2023-06-25", | ||
"players": [ | ||
{ "member_id": "42", "win": 1, "defeat": 1 }, | ||
{ "member_id": "1", "win": 8, "defeat": 3 }, | ||
{ "member_id": "76", "win": 3, "defeat": 6 }, | ||
{ "member_id": "39", "win": 13, "defeat": 1 }, | ||
{ "member_id": "85", "win": 0, "defeat": 6 }, | ||
{ "member_id": "11", "win": 2, "defeat": 6 }, | ||
{ "member_id": "57", "win": 2, "defeat": 6 } | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"id": "2024_1", | ||
"year": 2024, | ||
"name": "Kosyk's Open 2024", | ||
"logo": "logo-KO", | ||
"status": "Активний", | ||
"stages": [ | ||
{ | ||
"date": "2024-04-7", | ||
"players": [ | ||
{ "member_id": "1", "win": 6, "defeat": 3 }, | ||
{ "member_id": "39", "win": 7, "defeat": 3 }, | ||
{ "member_id": "76", "win": 4, "defeat": 5 }, | ||
{ "member_id": "20", "win": 1, "defeat": 3 }, | ||
{ "member_id": "5", "win": 0, "defeat": 5 }, | ||
{ "member_id": "57", "win": 5, "defeat": 4 } | ||
] | ||
}, | ||
{ | ||
"date": "2024-04-21", | ||
"players": [ | ||
{ "member_id": "1", "win": 13, "defeat": 1 }, | ||
{ "member_id": "39", "win": 10, "defeat": 4 }, | ||
{ "member_id": "76", "win": 1, "defeat": 10 }, | ||
{ "member_id": "20", "win": 0, "defeat": 1 }, | ||
{ "member_id": "11", "win": 8, "defeat": 4 }, | ||
{ "member_id": "5", "win": 0, "defeat": 5 }, | ||
{ "member_id": "31", "win": 0, "defeat": 1 } | ||
] | ||
} | ||
] | ||
} | ||
] |
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
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
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
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 |
---|---|---|
@@ -1,26 +1,38 @@ | ||
import sprite from "../../sprite.svg"; | ||
import { LogoSvg, LogoWWrap, LogoWWrapAlt } from "./Logo-styled"; | ||
import { LogoSvg, LogoWrap } from "./Logo-styled"; | ||
|
||
export const Logo = () => { | ||
return ( | ||
<> | ||
<LogoWWrap> | ||
<LogoWrap> | ||
<LogoSvg> | ||
<use href={sprite + "#logo-full"}></use> | ||
</LogoSvg> | ||
</LogoWWrap> | ||
</LogoWrap> | ||
</> | ||
); | ||
}; | ||
|
||
export const LogoAlt = () => { | ||
return ( | ||
<> | ||
<LogoWWrapAlt> | ||
<LogoWrap> | ||
<LogoSvg> | ||
<use href={sprite + "#logo-alt"}></use> | ||
</LogoSvg> | ||
</LogoWWrapAlt> | ||
</LogoWrap> | ||
</> | ||
); | ||
}; | ||
|
||
export const TournamentLogo = ({ path }) => { | ||
return ( | ||
<> | ||
<LogoWrap style={{ width: "60px", height: "60px" }}> | ||
<LogoSvg> | ||
<use href={sprite + `#${path}`}></use> | ||
</LogoSvg> | ||
</LogoWrap> | ||
</> | ||
); | ||
}; |
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,21 @@ | ||
import { TournamentLogo } from "../Logo/Logo"; | ||
import { | ||
Item, | ||
MembersItemText, | ||
MembersItemWrap, | ||
} from "./TournamentsList-styled"; | ||
|
||
export const TournamentsItem = ({ el, index }) => { | ||
return ( | ||
<> | ||
<Item id={el.id}> | ||
<MembersItemWrap> | ||
<MembersItemText>{index + 1}.</MembersItemText> | ||
<TournamentLogo path={el.logo} /> | ||
<MembersItemText>{el.name}</MembersItemText> | ||
<MembersItemText>{el.status}</MembersItemText> | ||
</MembersItemWrap> | ||
</Item> | ||
</> | ||
); | ||
}; |
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,81 @@ | ||
import styled from "styled-components"; | ||
|
||
export const Section = styled.section` | ||
padding-bottom: 50px; | ||
min-height: 800px; | ||
background-color: var(--secondary-white-color); | ||
`; | ||
|
||
export const List = styled.ul``; | ||
|
||
export const Item = styled.li` | ||
position: relative; | ||
overflow: hidden; | ||
width: 100%; | ||
height: 100px; | ||
&:nth-child(odd) { | ||
background-color: var(--primary-white-color); | ||
} | ||
&:nth-child(even) { | ||
background-color: var(--secondary-white-color); | ||
} | ||
&:hover { | ||
cursor: pointer; | ||
} | ||
@media screen and (min-width: 1200px) { | ||
&:hover { | ||
background-color: var(--primary-black-color); | ||
color: var(--primary-white-color); | ||
} | ||
} | ||
`; | ||
|
||
export const MembersItemWrap = styled.div` | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
padding-left: 24px; | ||
padding-right: 24px; | ||
margin-left: auto; | ||
margin-right: auto; | ||
max-width: 1200px; | ||
width: 100%; | ||
height: 100%; | ||
`; | ||
|
||
export const MembersItemText = styled.p` | ||
overflow: hidden; | ||
display: flex; | ||
justify-content: left; | ||
align-items: center; | ||
height: 100%; | ||
font-size: 16px; | ||
font-weight: 400; | ||
line-height: 1.6; | ||
&:nth-child(1) { | ||
width: 35px; | ||
} | ||
&:nth-child(3) { | ||
padding-left: 10px; | ||
width: 120px; | ||
flex-grow: 1; | ||
} | ||
&:nth-child(4) { | ||
width: 120px; | ||
justify-content: right; | ||
text-align: right; | ||
@media screen and (min-width: 450px) { | ||
width: 150px; | ||
} | ||
} | ||
`; |
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,21 @@ | ||
import { List, Section } from "./TournamentsList-styled"; | ||
import { TournamentsItem } from "./TournamentsItem"; | ||
import { TitleSection } from "../TitleSection/TitleSection"; | ||
|
||
export const TournamentsList = ({ tournamentsArray }) => { | ||
return ( | ||
<> | ||
<Section> | ||
<TitleSection | ||
icon={"#icon-tournament"} | ||
title={"Кількість турнірів: " + tournamentsArray.length} | ||
/> | ||
<List> | ||
{tournamentsArray?.map((el, index) => ( | ||
<TournamentsItem key={el.id} el={el} index={index} /> | ||
))} | ||
</List> | ||
</Section> | ||
</> | ||
); | ||
}; |
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
Empty file.
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 { useEffect, useState } from "react"; | ||
|
||
import { tournamentsApi } from "../../Api/ApiRequest"; | ||
import { TournamentsList } from "../../components/TournamentsList/TournamentsList"; | ||
|
||
const TournamentsPage = () => { | ||
const [tournamentsArray, setTournamentsArray] = useState([]); | ||
|
||
useEffect(() => { | ||
window.scrollTo(0, 0); | ||
const tournaments = tournamentsApi(); | ||
tournaments?.sort((a, b) => a.name.localeCompare(b.name)); | ||
setTournamentsArray(tournaments); | ||
}, []); | ||
|
||
return ( | ||
<> | ||
<TournamentsList tournamentsArray={tournamentsArray} /> | ||
</> | ||
); | ||
}; | ||
|
||
export default TournamentsPage; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.