diff --git a/src/componenets/common/EventCard/EventCard.style.ts b/src/componenets/common/EventCard/EventCard.style.ts new file mode 100644 index 00000000..54291057 --- /dev/null +++ b/src/componenets/common/EventCard/EventCard.style.ts @@ -0,0 +1,69 @@ +import styled from '@emotion/styled'; + +const ContainerStyled = styled.div` + display: flex; + width: 25rem; + height: 17rem; + font-family: 'MainThin'; + cursor: pointer; + transition: transform 0.3s ease; + + &:hover { + transform: scale(1.02); + } +`; + +const PosterAreaStyled = styled.div` + display: flex; + justify-content: center; + align-items: center; + width: 12rem; + height: 17rem; +`; + +const EventInfoWrapper = styled.div` + display: flex; + justify-content: space-between; + flex-direction: column; + margin: 3%; +`; + +const TitleStyled = styled.div` + padding-bottom: 3%; + font-family: 'MainBold'; + font-size: 1.5rem; +`; + +const EventDateStyled = styled.div` + font-size: 1rem; +`; + +const EventFooterWrapper = styled.div` + display: flex; + flex-direction: column; + justify-content: space-between; + align-items: end; + height: 20%; + margin-right: 3%; +`; + +const PlaceStyled = styled.div` + color: grey; + font-size: 1rem; +`; + +const ClubNameStyled = styled.div` + font-family: 'MainRegular'; + font-size: 0.8rem; +`; + +export { + ContainerStyled, + PosterAreaStyled, + EventInfoWrapper, + TitleStyled, + EventDateStyled, + EventFooterWrapper, + PlaceStyled, + ClubNameStyled, +}; diff --git a/src/componenets/common/EventCard/EventCard.tsx b/src/componenets/common/EventCard/EventCard.tsx new file mode 100644 index 00000000..80ab50ff --- /dev/null +++ b/src/componenets/common/EventCard/EventCard.tsx @@ -0,0 +1,52 @@ +import { useNavigate } from 'react-router-dom'; + +import { + ClubNameStyled, + ContainerStyled, + EventDateStyled, + EventFooterWrapper, + EventInfoWrapper, + PlaceStyled, + PosterAreaStyled, + TitleStyled, +} from './EventCard.style'; + +interface EventProps { + eventId: number; + eventPoster: string; + eventTitle: string; + eventDate: string; + eventPlace: string; + clubName: string; +} + +const EventCard = ({ + eventId, + eventPoster, + eventTitle, + eventDate, + eventPlace, + clubName, +}: EventProps) => { + const navigate = useNavigate(); + + return ( + navigate(`/event/detail/${eventId}`)}> + + poster image + + +
+ {eventTitle} + {eventDate} +
+ + {eventPlace} + {clubName} + +
+
+ ); +}; + +export default EventCard;