Skip to content

Commit

Permalink
Merge pull request #572 from Studio-Yandex-Practicum/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
AntonZelinsky authored Sep 3, 2024
2 parents 767e926 + 10c6137 commit fcee41b
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/components/author-page/overview/overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export const AuthorOverview: React.FC<IAuthorOverview> = (props) => {
<Button
size='sm'
border='right-bottom-left'
href={`library/?festival=${item.year}&program=${item.id}`}
href={`library/?year=${item.year}&program=${item.id}`}
animation='invert'
>
{`${item.name} ${item.year}`}
Expand Down
13 changes: 11 additions & 2 deletions src/components/festival-event-card/festival-event-card.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,21 @@

.actions {
display: flex;
align-items: flex-start;
justify-content: flex-end;
flex-direction: row;
align-items: stretch;
justify-content: space-between;
grid-area: actions;

@media (min-width: $tablet-portrait) {
width: fit-content;
flex-direction: column;
justify-content: flex-start;
gap: 16px;
}
}

.button {
justify-content: flex-start;
padding: 0 2px 2px 0;
}

Expand Down
30 changes: 26 additions & 4 deletions src/components/festival-event-card/festival-event-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface FestivalEventCardProps {
title: string
description?: string
credits: CreditsRole[]
aboutUrl?: string
actionUrl?: Url | null
className?: string
}
Expand All @@ -29,6 +30,7 @@ export const FestivalEventCard: React.VFC<FestivalEventCardProps> = (props) => {
title,
description,
credits,
aboutUrl,
actionUrl,
className
} = props;
Expand Down Expand Up @@ -73,8 +75,27 @@ export const FestivalEventCard: React.VFC<FestivalEventCardProps> = (props) => {
className={cx('credits')}
roles={credits}
/>
{actionUrl && (
<div className={cx('actions')}>
<div className={cx('actions')}>
{aboutUrl && (
<Button
size="s"
border="bottom-left"
icon={(
<Icon
glyph="arrow-right"
width="100%"
height="100%"
/>
)}
href={aboutUrl}
className={cx('button')}
target="_blank"
upperCase
>
О спектакле
</Button>
)}
{actionUrl && (
<Button
size="s"
border="bottom-left"
Expand All @@ -92,8 +113,9 @@ export const FestivalEventCard: React.VFC<FestivalEventCardProps> = (props) => {
>
Регистрация
</Button>
</div>
)}
)}
</div>

</article>
);
};
1 change: 1 addition & 0 deletions src/components/festival-schedule/festival-schedule.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export const FestivalSchedule: React.VFC<FestivalScheduleProps> = withSWRFallbac
title={event.title}
image={event.artworkUrl}
description={event.description}
aboutUrl={event.performanceId !== null ? (`/performances/${event.performanceId}`) : undefined}
actionUrl={event.registrationUrl}
credits={event.team}
/>
Expand Down
3 changes: 3 additions & 0 deletions src/components/history-page/title/history-title-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ export const HistoryTitleCard = ({ item }: {item: ICard}) => {
type='button'
size='xxl'
border='none'
className={cn({
[style.buttonDefault]: !item.buttonProps,
})}
{...(item.count && item.buttonProps)}
>
{item.count ? item.count.toString() : '0'}
Expand Down
4 changes: 4 additions & 0 deletions src/components/history-page/title/history-title.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@
display: flex;
}

.buttonDefault {
cursor: default;
}

.button.link.subtitle {
overflow: hidden;
padding: 0;
Expand Down
1 change: 1 addition & 0 deletions src/core/schedule/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ export type FestivalEvent = {
date: DateTimeIsoString
registrationOpeningDate: DateTimeIsoString
registrationUrl?: Url | null
performanceId: number | null
}
1 change: 1 addition & 0 deletions src/services/api/schedule-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ function mapDTOToFestivalEvents(dto: EventsDTO): PaginatedFestivalEvents {
date: event.date_time,
registrationOpeningDate: event.opening_date_time,
registrationUrl: event.action_url,
performanceId: event.performance_id
})),
pagination,
};
Expand Down

0 comments on commit fcee41b

Please sign in to comment.