Skip to content

Commit

Permalink
Added /trainers page, filled it with data
Browse files Browse the repository at this point in the history
  • Loading branch information
arlagonix committed Jul 5, 2024
1 parent 7240bf7 commit 6dd8598
Show file tree
Hide file tree
Showing 15 changed files with 209 additions and 0 deletions.
Binary file added public/trainers/alexander_nosov.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/trainers/anna_stramilova.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/trainers/anna_vasilieva.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/trainers/daria_koshevaya.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/trainers/daria_samohvalova.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/trainers/leonid_leonov.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/trainers/maxim_yaremchuk.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/trainers/roman_samohvalov.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/trainers/tatiana_parol.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/trainers/victoria_balganova.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/trainers/vyacheslav_vyazov.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
58 changes: 58 additions & 0 deletions src/app/trainers/TrainerCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import Image from 'next/image'
import { Fragment } from 'react'
import { TrainerType } from './trainersData'
import Link from 'next/link'

const RankBadge = ({ rank }: { rank: string }) => {
return (
<div className="rounded-lg border border-neutral-900 px-3 py-[0.375rem]">
{rank}
</div>
)
}

const TrainerCard = ({
name,
imgSrc,
description,
ranks,
link,
}: TrainerType) => {
return (
<Link
href={link}
className="group flex flex-col no-underline transition active:scale-[0.98]"
>
<Image
src={imgSrc}
width={2000}
height={2000}
alt={name}
className="block aspect-square w-full rounded-2xl border border-neutral-200 object-cover shadow transition-shadow group-hover:shadow-xl"
draggable={false}
/>
<h2 className="mt-4 text-xl font-semibold group-hover:underline mobile:underline">
{name}
</h2>
{description !== undefined && description.length !== 0 && (
<p className="mt-2 flex-grow leading-[170%] text-slate-500">
{description.map((item, index, arr) => (
<Fragment key={index}>
{item}
{index !== arr.length - 1 && <br />}
</Fragment>
))}
</p>
)}
{ranks !== undefined && ranks.length !== 0 && (
<div className="mt-4 flex flex-wrap gap-2">
{ranks.map((item) => (
<RankBadge key={item} rank={item} />
))}
</div>
)}
</Link>
)
}

export default TrainerCard
40 changes: 40 additions & 0 deletions src/app/trainers/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import Breadcrumbs, { BreadcrumbType } from '@/components/Breadcrumbs'
import H1 from '@/components/H1'
import Main from '@/components/Main'
import { trainersData } from './trainersData'
import TrainerCard from './TrainerCard'

const breadCrumbsData: BreadcrumbType[] = [
{
id: 1,
title: 'Главная',
link: '/',
},
{
id: 2,
title: 'Преподаватели',
},
]

const TrainersPage = () => {
return (
<Main>
<H1>Преподаватели</H1>
<Breadcrumbs breadcrumbsData={breadCrumbsData} />
<div className="mt-16 grid grid-cols-[repeat(auto-fit,minmax(min(320px,100%),1fr))] gap-16">
{trainersData.map((trainer) => (
<TrainerCard
key={trainer.name}
name={trainer.name}
description={trainer.description}
ranks={trainer.ranks}
imgSrc={trainer.imgSrc}
link={trainer.link}
/>
))}
</div>
</Main>
)
}

export default TrainersPage
110 changes: 110 additions & 0 deletions src/app/trainers/trainersData.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
const defaultPath = '/trainers'

export const trainersData: TrainerType[] = [
{
name: 'Роман Самохвалов',
description: [
'Руководитель Школы',
'Судья 1-й категории АСХ',
'Танцует 19 лет',
'Преподает 10 лет',
],
ranks: ['Champion', 'A'],
imgSrc: '/trainers/roman_samohvalov.jpg',
link: `${defaultPath}/roman_samohvalov`,
},
{
name: 'Дарья Кошевая',
description: [
'Судья 3-й категории АСХ',
'Танцует 25 лет',
'Преподает 14 лет',
],
ranks: ['Champion', 'A'],
imgSrc: '/trainers/daria_koshevaya.jpg',
link: `${defaultPath}/daria_koshevaya`,
},
{
name: 'Леонид Леонов',
description: ['Танцует 10 лет', 'Преподает 6 лет'],
ranks: ['Star', 'B'],
imgSrc: '/trainers/leonid_leonov.jpg',
link: `${defaultPath}/leonid_leonov`,
},
{
name: 'Дария Самохвалова',
description: [
'Дипломированный хореограф',
'Танцует 19 лет',
'Преподает 8 лет',
],
ranks: ['Main', 'D'],
imgSrc: '/trainers/daria_samohvalova.jpg',
link: `${defaultPath}/daria_samohvalova`,
},
{
name: 'Александр Носов',
description: ['Танцует 4 года', 'Преподает 2 года'],
ranks: ['Star', 'C'],
imgSrc: '/trainers/alexander_nosov.jpg',
link: `${defaultPath}/alexander_nosov`,
},
{
name: 'Анна Страмилова',
description: ['Танцует 4 года', 'Преподает 2 года'],
ranks: ['Main', 'D'],
imgSrc: '/trainers/anna_stramilova.jpg',
link: `${defaultPath}/anna_stramilova`,
},
{
name: 'Максим Яремчук',
description: ['Танцует 7 лет', 'Преподает 2 года'],
ranks: ['Main', 'C'],
imgSrc: '/trainers/maxim_yaremchuk.jpg',
link: `${defaultPath}/maxim_yaremchuk`,
},
{
name: 'Вячеслав Вязов',
description: ['Танцует 11 лет', 'Преподает 9 лет'],
ranks: ['Main', 'C'],
imgSrc: '/trainers/vyacheslav_vyazov.jpg',
link: `${defaultPath}/vyacheslav_vyazov`,
},
{
name: 'Виктория Балганова',
description: ['Танцует 16 лет', 'Преподает 2 года'],
ranks: ['Star', 'C'],
imgSrc: '/trainers/victoria_balganova.jpg',
link: `${defaultPath}/victoria_balganova`,
},
{
name: 'Анна Васильева',
description: ['Танцует 15 лет', 'Преподает 3 года'],
ranks: ['Star', 'D'],
imgSrc: '/trainers/anna_vasilieva.jpg',
link: `${defaultPath}/anna_vasilieva`,
},
{
name: 'Татьяна Пароль',
description: [
'Специалист с высшим хореографическим образованием',
'Танцует 25 лет',
'Преподает 20 лет',
],
imgSrc: '/trainers/tatiana_parol.jpg',
link: `${defaultPath}/tatiana_parol`,
},
]

export type TrainerType = {
/** Trainer name */
name: string
/** Trainer description */
description?: string[]
/** Trainer ranks (DnD, classic, etc.) */
ranks?: string[]
/** Source of the trainer avatar image */
imgSrc: string
/** Link to trainer's page */
link: string
}
1 change: 1 addition & 0 deletions src/components/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const linksData: HeaderType[] = [
id: 4,
name: 'Преподаватели',
icon: <UsersIcon {...menuIconProps} />,
link: '/trainers',
},
{
id: 5,
Expand Down

0 comments on commit 6dd8598

Please sign in to comment.