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 24 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,7 @@ export const ActivitiesSection = async ({ cityId }: ActivitiesSectionProps) => {
<Typography tag='h2' variant='h1' className='text-[21px] lg:text-4xl'>
<I18nText path='landing.activities.title' />
</Typography>
<Link href={ROUTES.APP.ACTIVITIES} className={buttonVariants({ variant: 'link' })}>
<Link href={ROUTES.APP.ACTIVITIES.ROOT} className={buttonVariants({ variant: 'link' })}>
<Typography tag='p' variant='body1' className='py-0 xxsx:text-base'>
<I18nText path='button.watchAll' />
</Typography>
Expand Down
2 changes: 1 addition & 1 deletion app/app/(main)/(constants)/participantLinks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const PARTICIPANT_LINKS = [
{
icon: <ActivitiesIcon />,
text: 'navigation.link.app.activities',
href: ROUTES.APP.ACTIVITIES
href: ROUTES.APP.ACTIVITIES.ROOT
},
{
icon: <RatingIcon />,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
'use client';

import { useI18n } from '@/utils/contexts';

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

export const ActivitiesBreadcrumbs = () => {
const i18n = useI18n();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

я вспомнила Π·Π°Ρ‡Π΅ΠΌ вынСсла Π² Ρ„Π°ΠΉΠ» - ΠΈΠ·-Π·Π° ΠΏΠ΅Ρ€Π΅Π²ΠΎΠ΄ΠΎΠ²

Π³Π΄Π΅ ΡŽΠ·Π°Π΅Ρ‚ΡΡ - Π½Π°Π΄ΠΎ Ρ‡Ρ‚ΠΎΠ±Ρ‹ Π±Ρ‹Π» сСрвСрный ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ‚, ΠΏΡ€ΠΈΡˆΠ»ΠΎΡΡŒ вынСсти ΠΈΠ·-Π·Π° Ρ…ΡƒΠΊΠ° ΠΏΠ΅Ρ€Π΅Π²ΠΎΠ΄ΠΎΠ²


return (
<ActivitiesBreadcrumbsItem
ids={{
app: { hidden: true },
activities: {
value: i18n.formatMessage({ id: 'navigation.link.app.activities' }),
clickable: true
},
id: { value: i18n.formatMessage({ id: 'navigation.link.app.activities.card' }) },
schedule: { hidden: true },
addressId: {
value: i18n.formatMessage({ id: 'navigation.link.app.activities.schedule' }),
clickable: false
}
}}
/>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
'use client';

import { useParams, usePathname } from 'next/navigation';

import { I18nText } from '@/components/common';
import {
Breadcrumb,
BreadcrumbItem,
BreadcrumbLink,
BreadcrumbList,
BreadcrumbPage,
BreadcrumbSeparator
} from '@/components/ui';

interface ActivitiesBreadcrumbsItemProps extends React.ComponentProps<typeof Breadcrumb> {
ids?: Record<string, { value?: string; clickable?: boolean; href?: string; hidden?: boolean }>;
}

export const ActivitiesBreadcrumbsItem = ({
ids = {},
...props
}: ActivitiesBreadcrumbsItemProps) => {
const params = useParams();
const pathname = usePathname();

const paramValues = Object.values(params);
const pathnames = pathname.split('/').filter((path) => path);

const preparedPathnames = pathnames.map((path, index) => {
const href = `/${pathnames.slice(0, index + 1).join('/')}`;
const idParam = Object.entries(params).find((param) => param[1] === path);

const pathname = idParam ? idParam[0] : path;

if (ids[pathname]?.hidden) return null;
return { pathname, href, ...ids[pathname] };
});

const filteredPathnames = preparedPathnames.filter(Boolean) as {
pathname: string;
href: string;
}[];

return (
<Breadcrumb className='pb-4' {...props}>
<BreadcrumbList>
{filteredPathnames.map(({ pathname, href }, index) => {
const hrefWithoutIds = pathnames
.slice(0, index + 1)
.filter(
(currentPath) =>
!~paramValues.findIndex((currentParam) => currentParam === currentPath)
);
const translateHref = `.${hrefWithoutIds.join('.')}`;

const id = ids[pathname];
const clickable = (id?.clickable && id?.href) ?? true;

const item = (
<>
{id?.value && id.value}
{!id?.value && (
<I18nText path={`navigation.link${translateHref}` as LocaleMessageId} />
)}
</>
);

return (
<>
<BreadcrumbItem key={href} className='list-none text-base'>
{clickable && <BreadcrumbLink href={href}>{item}</BreadcrumbLink>}
{!clickable && <BreadcrumbPage>{item}</BreadcrumbPage>}
</BreadcrumbItem>
{index !== filteredPathnames.length - 1 && <BreadcrumbSeparator />}
</>
);
})}
</BreadcrumbList>
</Breadcrumb>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const ActivitiesCategories = () => {
const { categories, onCategoryClick } = useActivitiesPage();

return (
<ScrollArea className='w-full space-y-3 whitespace-nowrap'>
<ScrollArea className='space-y-3 whitespace-nowrap'>
<Tabs defaultValue={searchParams.get('category') ?? ''}>
<TabsList className='flex w-full justify-start gap-1 bg-transparent p-0'>
<TabsTrigger
Expand All @@ -24,16 +24,17 @@ export const ActivitiesCategories = () => {
<I18nText path='organization.activities.category.all' />
</TabsTrigger>

{categories.map((category) => (
<TabsTrigger
key={category.id}
value={category.data.RU}
className='gap-10 rounded-full data-[state=active]:bg-taiga data-[state=active]:text-white'
onClick={() => onCategoryClick(category.data.RU)}
>
{category.data.RU}
</TabsTrigger>
))}
{categories &&
categories.map((category) => (
<TabsTrigger
key={category.id}
value={category.data.RU}
className='gap-10 rounded-full data-[state=active]:bg-taiga data-[state=active]:text-white'
onClick={() => onCategoryClick(category.data.RU)}
>
{category.data.RU}
</TabsTrigger>
))}
</TabsList>
</Tabs>
<ScrollBar orientation='horizontal' />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import React from 'react';
import { Clock4Icon, UserRoundIcon } from 'lucide-react';
import Link from 'next/link';
import { useIntersectionObserver } from 'usehooks-ts';

import { I18nText } from '@/components/common';
Expand All @@ -13,8 +14,10 @@ import {
ActivityCardDivider,
ActivityCardHeader,
ActivityCardImage,
ActivityCardName
ActivityCardName,
Typography
} from '@/components/ui';
import { ROUTES } from '@/utils/constants';

import { useActivitiesPage } from '../../(contexts)/activitiesPage';

Expand All @@ -36,30 +39,44 @@ export const ActivityList = () => {
const activityCover = activity.media.find((item) => item.flag === 'AVATAR')!;

return (
<ActivityCard key={activity.id}>
<ActivityCardImage src={activityCover.url} alt={activity.name} />
<ActivityCardHeader>
<ActivityCardCategory>{activity.category.RU}</ActivityCardCategory>
<ActivityCardName>{activity.name}</ActivityCardName>
</ActivityCardHeader>
<ActivityCardDivider />
<ActivityCardContent>
<ActivityCardContentItem>
<UserRoundIcon className='size-6 stroke-muted-foreground' />
<I18nText
path='landing.activities.card.minimumAge'
values={{ age: activity.ageLimit[0] }}
/>
</ActivityCardContentItem>
<ActivityCardContentItem>
<Clock4Icon className='size-6 stroke-muted-foreground' />
<I18nText
path='landing.activities.card.duration'
values={{ duration: activity.duration }}
/>
</ActivityCardContentItem>
</ActivityCardContent>
</ActivityCard>
<Link href={`${ROUTES.APP.ACTIVITIES.ID(activity.id)}`}>
<ActivityCard key={activity.id}>
<ActivityCardImage src={activityCover.url} alt={activity.name} />
<ActivityCardHeader>
<ActivityCardCategory>{activity.category.RU}</ActivityCardCategory>
<ActivityCardName>{activity.name}</ActivityCardName>
</ActivityCardHeader>
<ActivityCardDivider />
<ActivityCardContent>
<ActivityCardContentItem>
<UserRoundIcon className='size-3 stroke-muted-foreground 2xs:size-5' />
<Typography
tag='p'
variant='body4'
className='text-muted-foreground 2xs:text-base'
>
<I18nText
path='landing.activities.card.minimumAge'
values={{ age: activity.ageLimit[0] }}
/>
</Typography>
</ActivityCardContentItem>
<ActivityCardContentItem>
<Clock4Icon className='size-3 stroke-muted-foreground 2xs:size-5' />
<Typography
tag='p'
variant='body4'
className='text-muted-foreground 2xs:text-base'
>
<I18nText
path='landing.activities.card.duration'
values={{ duration: activity.duration }}
/>
</Typography>
</ActivityCardContentItem>
</ActivityCardContent>
</ActivityCard>
</Link>
);
})}
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import { Clock4Icon, UserRoundIcon } from 'lucide-react';

import type { ActivityResponse } from '@/api-types';
import { I18nText } from '@/components/common';
import {
ActivityCard,
ActivityCardCategory,
ActivityCardContent,
ActivityCardContentItem,
ActivityCardDivider,
ActivityCardHeader,
ActivityCardHeaderTop,
ActivityCardName,
Typography
} from '@/components/ui';

export const ActivityInfoCard = ({ activity }: { activity: ActivityResponse }) => (
<ActivityCard className='mt-3 max-w-[483px]'>
<ActivityCardHeader className='lg:gap-2'>
<ActivityCardHeaderTop className='mb-0 mt-0'>
<ActivityCardCategory>{activity.category.RU}</ActivityCardCategory>
{/* <div className='flex gap-2 lg:gap-4'>
{activity.participants && (
<ActivityCardContentItem>
<UsersRoundIcon className='size-4 stroke-muted-foreground lg:size-5' />
<Typography tag='p' variant='body3' className='xsx:text-xs'>
{activity.participants}
</Typography>
</ActivityCardContentItem>
)}
{activity.likes && (
<ActivityCardContentItem>
<HeartIcon className='size-4 stroke-muted-foreground lg:size-5' />
<Typography tag='p' variant='body3' className='xsx:text-xs'>
{activity.likes}
</Typography>
</ActivityCardContentItem>
)}
</div> */}
</ActivityCardHeaderTop>
<ActivityCardName className='text-lg 2md:text-xl'>{activity.name}</ActivityCardName>
</ActivityCardHeader>
<ActivityCardContent className='mt-[11px]'>
<div className='flex gap-[20px]'>
{activity.ageLimit[0] && (
<ActivityCardContentItem>
<UserRoundIcon className='size-4 stroke-muted-foreground lg:size-5' />
<Typography tag='p' variant='body3' className='text-gray-two'>
<I18nText
path='landing.activities.card.minimumAge'
values={{ age: activity.ageLimit[0] }}
/>
</Typography>
</ActivityCardContentItem>
)}
{activity.duration && (
<ActivityCardContentItem>
<Clock4Icon className='size-4 stroke-muted-foreground lg:size-5' />
<Typography tag='p' variant='body3' className='text-gray-two'>
<I18nText
path='landing.activities.card.duration'
values={{ duration: activity.duration }}
/>
</Typography>
</ActivityCardContentItem>
)}
</div>
</ActivityCardContent>
<ActivityCardDivider className='mt-4' />
</ActivityCard>
);
Loading