Skip to content

Commit

Permalink
Merge pull request #94 from ChangePlusPlusVandy/feature/change-defaul…
Browse files Browse the repository at this point in the history
…t-event-icon

feature/change-default-event-icon
  • Loading branch information
JiashuHarryHuang committed Apr 27, 2024
2 parents 3591a32 + b7de2dc commit ae45ae0
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 7 deletions.
16 changes: 10 additions & 6 deletions components/shared/EventCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import Link from 'next/link';
import {
AddressContainer,
AddressIcon,
CircularImageContainer,
ClockIcon,
Container,
EventImage,
Expand Down Expand Up @@ -86,12 +87,15 @@ const EventCard = ({
<Container ratio={ratio}>
<Link href={href || ''}>
<EventImage ratio={ratio}>
<Image
src="/eventCard/event-image.png"
alt="Event image icon"
width={`${Math.round(ratio * 138)}`}
height={`${Math.round(ratio * 138)}`}
/>
{/* make the image circular */}
<CircularImageContainer ratio={ratio} size={138}>
<Image
src="/eventCard/book-icon.jpeg"
alt="Event image icon"
width={`${Math.round(ratio * 138)}`}
height={`${Math.round(ratio * 138)}`}
/>
</CircularImageContainer>
</EventImage>

<Name ratio={ratio}>{eventData.name}</Name>
Expand Down
2 changes: 1 addition & 1 deletion components/shared/LongEventCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const LongEventCard = ({
<Container>
<EventImage>
<Image
src="/eventCard/event-image.png"
src="/eventCard/book-icon.jpeg"
alt="Event image icon"
width={`${Math.round((300 / 328) * 53)}`}
height={`${Math.round((300 / 328) * 53)}`}
Expand Down
Binary file added public/eventCard/book-icon.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions styles/components/eventCard.styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,16 @@ export const InfoFlexChild = styled.div<RatioProp>`
line-height: ${props => props.ratio * 22}px;
${Overflow};
`;

// a container that makes the image within it circular
export const CircularImageContainer = styled.div<{
ratio: number;
size: number;
}>`
border-radius: 50%;
// width and height are calculated based on the ratio prop
width: ${props => props.ratio * props.size} px;
height: ${props => props.ratio * props.size} px;
${Overflow};
`;

0 comments on commit ae45ae0

Please sign in to comment.