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/change-default-event-icon #94

Merged
merged 3 commits into from
Apr 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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};
`;
Loading