Skip to content

Commit

Permalink
added new members + tournament; correcred unknown member's priperties…
Browse files Browse the repository at this point in the history
… shown
  • Loading branch information
M-Farmaha committed Aug 16, 2024
1 parent de2155e commit 685ff9b
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 6 deletions.
26 changes: 26 additions & 0 deletions src/Api/members.json
Original file line number Diff line number Diff line change
Expand Up @@ -1519,5 +1519,31 @@
"forhand": "Справа",
"backhand": "Дворучний",
"joinTennisYear": 1984
},
{
"id": "118",
"name": "Олійник Мар'ян",
"birthDate": "1983-12-28",
"avatar": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/components/MembersList/avatars/118.jpg",
"sex": "male",
"hometown": "Золочів",
"type": "Тренер",
"category": null,
"forhand": "Справа",
"backhand": "Дворучний",
"joinTennisYear": 1997
},
{
"id": "119",
"name": "Паращак Юрій",
"birthDate": null,
"avatar": "https://raw.githubusercontent.com/M-Farmaha/100-club/main/src/components/MembersList/avatars/119.jpg",
"sex": "male",
"hometown": "Львів",
"type": "Аматор",
"category": null,
"forhand": "Справа",
"backhand": "Дворучний",
"joinTennisYear": null
}
]
12 changes: 12 additions & 0 deletions src/Api/tournaments.json
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,18 @@
{ "member_id": "57", "win": 6, "defeat": 4, "position": 3 },
{ "member_id": "1", "win": 7, "defeat": 3, "position": 1 }
]
},
{
"date": "2024-08-04",
"players": [
{ "member_id": "39", "win": 7, "defeat": 0, "position": 1 },
{ "member_id": "42", "win": 4, "defeat": 0, "position": 2 },
{ "member_id": "76", "win": 2, "defeat": 4, "position": 4 },
{ "member_id": "57", "win": 3, "defeat": 4, "position": 3 },
{ "member_id": "1", "win": 2, "defeat": 4, "position": 4 },
{ "member_id": "30", "win": 2, "defeat": 4, "position": 4 },
{ "member_id": "119", "win": 1, "defeat": 5, "position": 7 }
]
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/ContactsSection/ContactsSection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export const ContactsSection = () => {
</PhotoWrap>
<InfoWrap>
<Address>
<Text>Головний координатор клубу:</Text>
<Text>Координатор клубу:</Text>

<LinkA href="tel:+380997877316" aria-label="Подзвонити">
<IconSvg>
Expand Down
2 changes: 1 addition & 1 deletion src/components/LastUpdateSection/LastUpdateSection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const LastUpdateSection = () => {
<use href={sprite + "#icon-loop"}></use>
</IconSvg>
</IconWrap>
Останнє оновлення: 29.07.2024
Останнє оновлення: 17.08.2024
</Text>
</Section>
</>
Expand Down
9 changes: 6 additions & 3 deletions src/components/MembersList/MembersModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ export const MembersModal = () => {
} = currentMember || {};

const age = differenceInYears(new Date(), new Date(birthDate));
const experience = new Date().getFullYear() - joinTennisYear;
const experience = joinTennisYear
? `${new Date().getFullYear() - joinTennisYear} р. тому`
: "Невідомо";

const birth = new Date(birthDate);
const today = new Date();
Expand Down Expand Up @@ -108,7 +110,8 @@ export const MembersModal = () => {
{getUkrLocaleDate(birthDate)}
</Text>
<Text>
<span>Вік:</span> {age} {getAgeSuffix(age)}
<span>Вік:</span>
{birthDate ? ` ${age} ${getAgeSuffix(age)}` : " Heвідомо"}
{isTodayBirthDay && " (виповнилось сьогодні)"}
</Text>
<Text>
Expand All @@ -120,7 +123,7 @@ export const MembersModal = () => {
sex === "male" ? "спробував" : "спробувала"
} теніс: `}
</span>
{experience} р. тому
{experience}
</Text>
<Text>
<span>Форхенд:</span> {forhand}
Expand Down
Binary file added src/components/MembersList/avatars/118.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/helpers/getUkrLocaleDate.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { format } from "date-fns";
import ukLocale from "date-fns/locale/uk";

export const getUkrLocaleDate = (date) => {
if (!date) return " Невідомо";

const newDate = format(new Date(date), " d MMMM yyyy", {
locale: ukLocale,
});
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/isDateHidden.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const isDateHidden = (date) => {
const hiddenDates = ["2024-04-07", "2024-04-21", "2024-04-28", "2024-05-19"];
const hiddenDates = ["2024-04-07", "2024-04-21", "2024-04-28", "2024-05-19", "2024-08-04"];
return hiddenDates.includes(date);
};

0 comments on commit 685ff9b

Please sign in to comment.