Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/BQ-282 into [email protected] 🐒 activity card page #61

Open
wants to merge 30 commits into
base: [email protected]
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
f364c06
feature/BQ-282 🌊 added activity page draft with mock
danax7 May 4, 2024
616148d
feature/BQ-282 🌊 month presentation fix
danax7 May 5, 2024
eaca7cb
feature/BQ-282 🌊 added static breadcrumbs, added two new variants for…
danax7 May 5, 2024
013b2c6
feature/BQ-282 🌊 bruh fix
danax7 May 6, 2024
90e6cf7
feature/BQ-282 🌊 deleted response log
danax7 May 6, 2024
fc5b41c
feature/BQ-282 🌊 some review fixes
danax7 May 19, 2024
e454c02
feature/BQ-282 🐒 Π΄ΠΎΠ±Π°Π²ΠΈΡ‚ΡŒ ΠΌΠ΅Π΄ΠΈΠ°
Melly5 May 23, 2024
fc83a45
feature/BQ-282 🐒 ΡƒΠ±Ρ€Π°Ρ‚ΡŒ ΠΈΠΊΠΎΠ½ΠΊΡƒ
Melly5 May 23, 2024
1f7377f
feature/BQ-282 🐒 add activity info
Melly5 May 23, 2024
506771c
feature/BQ-282 🐒 fix participant layout for desktop
Melly5 May 24, 2024
6157db2
feature/BQ-282 🐒 add carousel media for mobile activity
Melly5 May 24, 2024
29dbd7b
feature/BQ-282 🐒 add activity page mobile styles, add addresses sched…
Melly5 May 24, 2024
03e261c
Merge branch 'release/1.5.0' into feature/BQ-282
Melly5 May 28, 2024
c8db714
feature/BQ-282 🐒 fix after merge
Melly5 May 28, 2024
5a9aff3
feature/BQ-282 🐒 fix activities logic, add generated types
Melly5 May 28, 2024
751a4e2
feature/BQ-282 🐒 add new page for schedule info
Melly5 May 31, 2024
c88c5fd
feature/BQ-282 🐒 fix address schedule routing and styles
Melly5 May 31, 2024
b1560a0
feature/BQ-282 🐒 fix address schedule time info display
Melly5 May 31, 2024
a070aaf
feature/BQ-282 🐒 fix address schedule desktop styles
Melly5 May 31, 2024
165cbd5
feature/BQ-282 🐒 ffx schedule day calendar style
Melly5 Jun 7, 2024
ee10c1c
feature/BQ-282 🐒 add phone logic, time periods, remove cariusel dots …
Melly5 Jun 8, 2024
13121cb
feature/BQ-282 🐒 fix calendar naming
Melly5 Jun 8, 2024
98f9313
feature/BQ-282 🐒 add desktop app activity layout
Melly5 Jun 8, 2024
6454b31
feature/BQ-282 🐒 fix schedule employee number
Melly5 Jun 8, 2024
1221e33
feature/BQ-282 🐒 fix breadcrumbs and styles
Melly5 Jun 16, 2024
3c133f1
feature/BQ-282 🐒 fix styles, remove isMobile, move to layout
Melly5 Jun 16, 2024
5e5f4b6
feature/BQ-282 🐒 fix app activities logic
Melly5 Jun 29, 2024
1764226
feature/BQ-282 🐒 add metadata
Melly5 Jul 27, 2024
500eae2
feature/BQ-282 🐒 add /activities pages with metadata logic
Melly5 Jul 30, 2024
6ab4e5d
feature/BQ-282 🐒 rename translation
Melly5 Jul 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ export const ActivitiesSection = async ({ cityId }: ActivitiesSectionProps) => {
<Typography tag='h2' variant='h1' className='text-2xl md:text-[32px]'>
<I18nText path='landing.activities.title' />
</Typography>

<Link href={ROUTES.APP.ACTIVITIES} className={buttonVariants({ variant: 'link' })}>
<Typography tag='p' variant='h6'>
<I18nText path='button.watchAll' />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import { ChevronRightIcon } from 'lucide-react';

import { I18nText } from '@/components/common';
import { Typography } from '@/components/ui';
import {
Accordion,
AccordionContent,
AccordionItem,
AccordionTrigger
} from '@/components/ui/accordion';

import { FreeTimeItem } from '../FreeTimeItem/FreeTimeItem';

interface AddressItemProps {
schedule: Schedule;
}

export const AddressItem = ({ schedule }: AddressItemProps) => (
<Accordion type='single' collapsible className='rounded-lg border border-border px-3'>
<AccordionItem value='item-1' className='border-none'>
<AccordionTrigger>
{schedule.address.street}, {schedule.address.house}
</AccordionTrigger>
<AccordionContent className='space-y-3'>
<div className='flex gap-2'>
<Typography variant='sub3' tag='h3'>
<I18nText path='field.details.label' />
</Typography>
<Typography variant='body5' tag='p'>
{schedule?.details}
</Typography>
</div>
<div className='flex flex-col gap-3 md:flex-row'>
<div className='w-1/3 min-w-60'>
<Typography variant='sub3' tag='h3' className='flex-1'>
<I18nText path='field.nearestFreeTime.label' />
</Typography>
</div>
<div className='flex flex-wrap gap-3'>
{schedule.nearestFreeTime?.map((time) => <FreeTimeItem time={time} />)}
</div>
</div>
<div className='flex'>
<Typography variant='sub3' tag='h3' className='flex-1'>
<I18nText path='field.chooseAnotherTime.label' />
</Typography>
<ChevronRightIcon className='stroke-muted-foreground' />
</div>
<div className='flex'>
<Typography variant='sub3' tag='h3' className='flex-1'>
<I18nText path='field.goToSupportChat.label' />
</Typography>
<ChevronRightIcon className='stroke-muted-foreground' />
</div>
</AccordionContent>
</AccordionItem>
</Accordion>
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { CalendarIcon } from 'lucide-react';

import { I18nText } from '@/components/common';
import { Typography } from '@/components/ui';

interface FreeTimeItemProps {
time: FreeTime;
}

export const FreeTimeItem = ({ time }: FreeTimeItemProps) => {
const monthNumber = new Date(time.date).getMonth() + 1;
const dayNumber = new Date(time.date).getDay() + 1;

return (
<div className='flex h-10 w-56 items-center justify-evenly rounded-lg border border-secondary '>
<div className='flex items-center gap-2'>
<CalendarIcon className='stroke-taiga' />
<Typography variant='sub6' tag='p'>
{time.time}
</Typography>
</div>
<Typography variant='sub6' tag='p'>
{dayNumber} <I18nText path={`month.${monthNumber}` as LocaleMessageId} />
</Typography>
</div>
);
};
56 changes: 56 additions & 0 deletions app/app/(main)/activities/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { I18nText } from '@/components/common';
import {
Breadcrumb,
BreadcrumbItem,
BreadcrumbLink,
BreadcrumbList,
BreadcrumbPage,
BreadcrumbSeparator,
Typography
} from '@/components/ui';
import { getActivityById } from '@/utils/api';
import { ROUTES } from '@/utils/constants';

import { AddressItem } from './(components)/AddressItem/AddressItem';

interface ActivityPageProps {
params: { activityId: string };
}

const ActivityPage = async ({ params }: ActivityPageProps) => {
const getActivityByIdResponse = await getActivityById({
params: { id: '1' },
config: {
cache: 'no-store'
}
});

console.log(params.activityId);

return (
<section className='container py-[108px]'>
<Breadcrumb>
<BreadcrumbList>
<BreadcrumbItem className='list-none text-base'>
<BreadcrumbLink href={ROUTES.APP.ACTIVITIES}>
<I18nText path='landing.activities.title' />
</BreadcrumbLink>
<BreadcrumbSeparator />
<BreadcrumbPage>{getActivityByIdResponse.name}</BreadcrumbPage>
</BreadcrumbItem>
</BreadcrumbList>
</Breadcrumb>
<div>Π’ΡƒΡ‚ Π±Π»ΠΎΠΊ с ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ°ΠΌΠΈ </div>
<div className='space-y-5'>
<Typography tag='h5' variant='h7'>
<I18nText path='landing.adresses.title' />
</Typography>
{getActivityByIdResponse.schedule?.map((schedule, index) => (
<AddressItem key={index} schedule={schedule} />
))}
</div>
</section>
);
};

export default ActivityPage;
111 changes: 90 additions & 21 deletions mock/requests/activity/id/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,96 @@ export const getActivityById: RestRequestConfig = {
method: 'get',
routes: [
{
data: [
{
id: '1',
cover: '',
content: [],
name: 'РисуСм Тивопись',
description:
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore ',
ageLimit: [7, 13],
price: 700,
duration: 120,
replay: false,
view: 'ONLINE',
status: 'PUBLISHED',
category: 'ΠžΠ±Ρ€Π°Π·ΠΎΠ²Π°Π½ΠΈΠ΅',
participants: 600,
likes: 210,
nutsCount: 0,
schedule: []
}
],
data: {
id: '1',
cover: '',
content: [],
name: 'РисуСм Тивопись',
description:
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore ',
ageLimit: [7, 13],
price: 700,
duration: 120,
replay: false,
view: 'ONLINE',
status: 'PUBLISHED',
category: 'ΠžΠ±Ρ€Π°Π·ΠΎΠ²Π°Π½ΠΈΠ΅',
participants: 600,
likes: 210,
nutsCount: 0,
schedule: [
{
address: {
country: 'Russia',
city: 'Moscow',
street: 'Red Square',
house: '1',
geoLat: 55.7539,
geoLon: 37.6208
},
leadingEmployeeId: 'employee1',
entry: true,
regular: false,
date: new Date('2024-05-05'),
time: {
hours: 10,
minutes: 30
},
maxNumberOfParticipants: 20,
period: [7, 14, 21],
details: '3 этаТ, Π²Ρ…ΠΎΠ΄ с Π’Π¦',
nearestFreeTime: [
{
date: new Date('2024-05-02'),
time: '12:32'
},
{
date: new Date('2024-03-05'),
time: '13:31'
},
{
date: new Date('2024-05-03'),
time: '11:32'
}
]
},
{
address: {
country: 'Russia',
city: 'Saint Petersburg',
street: 'Nevsky Prospect',
house: '2',
geoLat: 59.9343,
geoLon: 30.3351
},
leadingEmployeeId: 'employee2',
entry: true,
regular: false,
date: new Date('2024-05-10'),
time: {
hours: 14,
minutes: 0
},
maxNumberOfParticipants: 15,
period: [7, 14, 21],
details: '3 этаТ, Π²Ρ…ΠΎΠ΄ с Π’Π¦',
nearestFreeTime: [
{
date: new Date('2024-05-02'),
time: '12:32'
},
{
date: new Date('2024-03-05'),
time: '13:31'
},
{
date: new Date('2024-05-03'),
time: '11:32'
}
]
}
]
},
entities: { params: { id: 1 } }
}
]
Expand Down
4 changes: 3 additions & 1 deletion src/components/ui/typography.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ const typographyVariants = cva('text-foreground', {
sub3: 'leading-5 font-medium text-base',
sub4: 'leading-5 font-medium text-sm',
sub5: 'leading-[14px] font-medium text-sm',
sub6: 'leading-[14px] font-normal text-sm text-gray-two',
body1: 'leading-5 font-normal text-lg text-muted-foreground',
body2: 'leading-5 font-normal text-base',
body3: 'leading-4 font-normal text-sm text-muted-foreground',
body4: 'leading-[14px] font-normal text-[12px]'
body4: 'leading-[14px] font-normal text-[12px]',
body5: 'leading-[14px] font-normal text-base text-gray-two'
}
},
defaultVariants: {
Expand Down
7 changes: 7 additions & 0 deletions src/utils/api/api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,11 @@ interface Time {
minutes: number;
}

interface FreeTime {
date: string;
time: string;
}

interface Schedule {
address: {
country?: string;
Expand All @@ -228,6 +233,8 @@ interface Schedule {
settlement?: string;
settlementWithType?: string;
};
nearestFreeTime?: FreeTime[];
details?: string;
leadingEmployeeId: string;
entry: boolean;
regular: boolean;
Expand Down
8 changes: 8 additions & 0 deletions src/utils/api/requests/activity/id/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,11 @@ export type PutActivityByIdRequestConfig = RequestConfig<PutActivityByIdParams>;

export const putActivityById = async ({ params, config }: PutActivityByIdRequestConfig) =>
api.put(`activity/${params.id}`, params, config);

export interface GetActivtiyByIdParams {
id: string;
}
export type GetActivityByIdRequestConfig = RequestConfig<GetActivtiyByIdParams>;

export const getActivityById = async ({ params, config }: GetActivityByIdRequestConfig) =>
api.get<ActivityResponse>(`activity/${params.id}`, config);
17 changes: 17 additions & 0 deletions static/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@
"field.street.label": "Π£Π»ΠΈΡ†Π°",
"field.street.placeholder": "ΡƒΠ».",
"field.details.label": "Π”Π΅Ρ‚Π°Π»ΠΈ",
"field.nearestFreeTime.label": "Π‘Π»ΠΈΠΆΠ°ΠΉΡˆΠ΅Π΅ свободноС врСмя",
"field.chooseAnotherTime.label": "Π’Ρ‹Π±Ρ€Π°Ρ‚ΡŒ Π΄Ρ€ΡƒΠ³ΠΎΠ΅ врСмя",
"field.goToSupportChat.label": "ΠŸΠ΅Ρ€Π΅ΠΉΡ‚ΠΈ Π² Ρ‡Π°Ρ‚ с ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠΎΠΉ",
"field.details.placeholder": "офис, Π²Ρ…ΠΎΠ΄, этаТ",
"field.note.placeholder": "ΠžΡΡ‚Π°Π²ΡŒΡ‚Π΅ Π·Π°ΠΌΠ΅Ρ‚ΠΊΡƒ...",
"field.title.label": "НазваниС",
Expand Down Expand Up @@ -303,6 +306,19 @@
"dayOfWeek.7": "Вс",
"dayOfWeek.dayOff": "Π’Ρ‹Ρ…ΠΎΠ΄Π½ΠΎΠΉ",

"month.1": "Января",
"month.2": "ЀСвраля",
"month.3": "ΠœΠ°Ρ€Ρ‚Π°",
"month.4": "АпрСля",
"month.5": "Мая",
"month.6": "Июня",
"month.7": "Июля",
"month.8": "Августа",
"month.9": "БСнтября",
"month.10": "ΠžΠΊΡ‚ΡΠ±Ρ€Ρ",
"month.11": "Ноября",
"month.12": "ДСкабря",

"addressCard.description.workingTime": "ВрСмя Ρ€Π°Π±ΠΎΡ‚Ρ‹",

"table.column.status": "Бтатус",
Expand Down Expand Up @@ -369,6 +385,7 @@

"landing.info.subtitle": "Π‘ΠΎΠ»Π΅Π΅ <green>4000+ ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»Π΅ΠΉ</green> ΡƒΠΆΠ΅ с Π½Π°ΠΌΠΈ,{br} присоСдиняйся!",
"landing.activities.title": "Активности",
"landing.adresses.title": "АдрСса",
"landing.activities.card.duration": "{duration} ΠΌΠΈΠ½",
"landing.activities.card.minimumAge": "{age}+ Π»Π΅Ρ‚",
"landing.activitiesMap.title": "Поиск активностСй Π½Π° ΠΊΠ°Ρ€Ρ‚Π΅",
Expand Down