Skip to content

Commit

Permalink
Remove places from optional awards (Closes #952)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmeshulam committed Jan 21, 2025
1 parent 75ea825 commit 2d6f3cf
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion apps/frontend/components/deliberations/award-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import AddCircleOutlineIcon from '@mui/icons-material/AddCircleOutline';
import { Team, AwardNames, SUGGESTED_TEAM_COLOR } from '@lems/types';
import { Draggable, Droppable } from 'react-beautiful-dnd';
import { errorAnimation } from '../../lib/utils/animations';
import { getBackgroundColor } from 'apps/frontend/lib/utils/theme';
import { getBackgroundColor } from '../../lib/utils/theme';

interface AwardListItemProps {
droppableId: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ const OptionalAwardsDeliberationLayout: React.FC = () => {
title={localizedAward[award].name}
length={limits[award]!}
withIcons
trophyCount={limits[award]!}
id={award}
pickList={
deliberation.awards[award]?.map(
Expand Down
15 changes: 12 additions & 3 deletions apps/frontend/components/presentations/awards-presentation.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import React, { Fragment, forwardRef, useMemo, useState, useEffect } from 'react';
import { WithId } from 'mongodb';
import { Box, BoxProps } from '@mui/material';
import { Award, Team, DivisionWithEvent } from '@lems/types';
import {
Award,
Team,
DivisionWithEvent,
CoreValuesAwardsTypes,
CoreValuesAwards
} from '@lems/types';
import { localizedAward } from '@lems/season';
import { Deck, DeckView, DeckRef } from '@lems/presentations';
import TitleSlide from './title-slide';
Expand Down Expand Up @@ -58,6 +64,9 @@ const AwardsPresentation = forwardRef<DeckRef, AwardsPresentationProps>(
const { name: awardName } = sortedAwards[0];
const localized = localizedAward[awardName];

const showPlace =
sortedAwards.length > 1 && !CoreValuesAwardsTypes.includes(awardName as CoreValuesAwards);

return (
<Fragment key={awardName}>
<TitleSlide primary={`פרס ${localized.name}`} color={division.color} />
Expand All @@ -72,15 +81,15 @@ const AwardsPresentation = forwardRef<DeckRef, AwardsPresentationProps>(
{['chroma', 'both'].includes(awardWinnerSlideStyle) && (
<AwardWinnerChromaSlide
name={`פרס ${localized.name}`}
place={sortedAwards.length > 1 ? award.place : undefined}
place={showPlace ? award.place : undefined}
winner={award.winner || ''}
color={division.color}
/>
)}
{['full', 'both'].includes(awardWinnerSlideStyle) && (
<AwardWinnerSlide
name={`פרס ${localized.name}`}
place={sortedAwards.length > 1 ? award.place : undefined}
place={showPlace ? award.place : undefined}
winner={award.winner || ''}
color={division.color}
hideWinner={awardWinnerSlideStyle === 'full'}
Expand Down

0 comments on commit 2d6f3cf

Please sign in to comment.