Skip to content

Commit f04151d

Browse files
Merge a918c1c into 72be08b
2 parents 72be08b + a918c1c commit f04151d

File tree

6 files changed

+75
-27
lines changed

6 files changed

+75
-27
lines changed

src/components/AnnouncementCard.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,17 @@ const CardTitle = styled(Text)`
1616
const AnnouncementCardCover = styled(Card)`
1717
cursor: pointer;
1818
height: fit-content;
19-
min-width: 200px;
20-
max-width: 400px;
19+
width: 400px;
2120
margin: 16px 16px;
2221
23-
@media screen and (min-width: 800px) {
24-
min-width: 400px;
25-
}
26-
2722
.cardImg {
2823
height: 250px;
2924
object-fit: cover;
3025
}
26+
27+
@media screen and (max-width: 700px) {
28+
width: 85%;
29+
}
3130
`;
3231

3332
const DateText = styled(Text)`

src/components/EventCard.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ const EventsCard = styled(Card)`
2323
object-fit: cover;
2424
}
2525
margin: 16px 16px;
26+
27+
@media screen and (max-width: 700px) {
28+
width: 85%;
29+
}
2630
`;
2731

2832
const DateText = styled(Text)`

src/components/event-details/EventDetails.tsx

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import styled from 'styled-components';
66
import { PrivilegeLevel } from '../../auth/ducks/types';
77
import { EventAnnouncement } from '../../containers/singleEvent/ducks/types';
88
import { EventInformation } from '../../containers/upcoming-events/ducks/types';
9+
import { PRIMARY_BREAKPOINT } from '../../utils/breakpoints';
910
import { DEFAULT_IMAGE } from '../../utils/copy';
1011
import { AnnouncementCard } from '../AnnouncementCard';
1112
import EventRegistrationModal from '../modals/event-registration-modal/EventRegistrationModal';
@@ -27,7 +28,7 @@ const DescriptionWrapper = styled.div`
2728
margin-bottom: 16px;
2829
height: min-content;
2930
30-
@media screen and (max-width: 900px) {
31+
@media screen and (max-width: ${PRIMARY_BREAKPOINT}) {
3132
width: 100%;
3233
}
3334
`;
@@ -37,7 +38,7 @@ const AnnouncementsWrapper = styled.div`
3738
flex-wrap: wrap;
3839
width: 50%;
3940
40-
@media screen and (max-width: 900px) {
41+
@media screen and (max-width: ${PRIMARY_BREAKPOINT}) {
4142
width: 100%;
4243
}
4344
`;
@@ -49,7 +50,7 @@ const CardContent = styled.div`
4950
border: 1px solid #d9d9d9;
5051
width: 100%;
5152
52-
@media screen and (max-width: 900px) {
53+
@media screen and (max-width: ${PRIMARY_BREAKPOINT}) {
5354
flex-direction: column;
5455
width: 100%;
5556
}
@@ -71,7 +72,7 @@ const SeatsRemaining = styled.div`
7172
const Location = styled.div`
7273
margin-bottom: 120px;
7374
74-
@media screen and (max-width: 900px) {
75+
@media screen and (max-width: ${PRIMARY_BREAKPOINT}) {
7576
margin-bottom: 40px;
7677
}
7778
`;
@@ -109,23 +110,33 @@ const ThumbnailWrapper = styled.div`
109110
justify-content: left;
110111
overflow: hidden;
111112
112-
@media screen and (max-width: 900px) {
113+
@media screen and (max-width: ${PRIMARY_BREAKPOINT}) {
113114
min-width: 100%;
114115
justify-content: center;
115116
margin-bottom: 16px;
117+
min-height: 200px;
118+
max-height: 300px;
116119
}
117120
`;
118121

119122
const InfoWrapper = styled.div`
120123
display: flex;
121124
width: 45%;
122-
margin-left: 40px;
125+
padding: 0px 20px;
123126
124-
@media screen and (max-width: 900px) {
127+
@media screen and (max-width: ${PRIMARY_BREAKPOINT}) {
125128
width: 100%;
126129
}
127130
`;
128131

132+
const DescriptionTitle = styled(Title)`
133+
width: 100%;
134+
`;
135+
136+
const AnnouncementsTitle = styled(Title)`
137+
width: 100%;
138+
`;
139+
129140
const AnnouncementBox = styled.div``;
130141

131142
const AnnouncementNoContent = styled(AnnouncementBox)``;
@@ -208,7 +219,7 @@ const EventDetails: React.FC<EventDetailsProps> = ({
208219
</CardWrapper>
209220
<BottomWrapper>
210221
<DescriptionWrapper>
211-
<Title level={5}>Description</Title>
222+
<DescriptionTitle level={5}>Description</DescriptionTitle>
212223
<Typography>{description}</Typography>
213224
</DescriptionWrapper>
214225
<AnnouncementsWrapper>
@@ -225,7 +236,9 @@ const EventDetails: React.FC<EventDetailsProps> = ({
225236
</AnnouncementBox>
226237
) : (
227238
<>
228-
<Title level={5}>Updates for this Event</Title>
239+
<AnnouncementsTitle level={5}>
240+
Updates for this Event
241+
</AnnouncementsTitle>
229242
<AnnouncementNoContent>
230243
There are no announcements for this event
231244
</AnnouncementNoContent>

src/containers/home/index.tsx

Lines changed: 41 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,46 @@ import {
2525
EventInformation,
2626
EventsReducerState,
2727
} from '../upcoming-events/ducks/types';
28+
import { PRIMARY_BREAKPOINT } from '../../utils/breakpoints';
2829
const { Text, Paragraph } = Typography;
2930

3031
const LandingContainer = styled.div`
32+
width: 100%;
33+
display: flex;
34+
flex-direction: column;
35+
`;
36+
37+
const LandingImage = styled.div`
3138
width: 100%;
3239
height: calc(95vh - 110px);
3340
object-fit: cover;
3441
background-image: url('${HOME_IMAGE}');
3542
background-position: center; /* Center the image */
3643
background-repeat: no-repeat; /* Do not repeat the image */
3744
background-size: cover; /* Resize the background image to cover the entire container */
45+
46+
@media screen and (max-width: ${PRIMARY_BREAKPOINT}) {
47+
height: 35vh;
48+
}
3849
`;
3950

4051
const LandingText = styled(Text)`
4152
font-weight: 800;
4253
color: ${ORANGE};
4354
font-size: 36px;
4455
line-height: 48px;
56+
57+
@media screen and (max-width: ${PRIMARY_BREAKPOINT}) {
58+
font-size: 24px;
59+
}
4560
`;
4661

4762
const LandingBodyText = styled(Paragraph)`
4863
font-size: 16px;
64+
65+
@media screen and (max-width: ${PRIMARY_BREAKPOINT}) {
66+
font-size: 14px;
67+
}
4968
`;
5069

5170
const LandingTextContainer = styled.div`
@@ -79,6 +98,7 @@ const ViewMoreButton = styled(LinkButton)`
7998

8099
const AdminCol = styled(Col)`
81100
margin-right: 10px;
101+
margin-bottom: 16px;
82102
`;
83103

84104
const CARD_ROW_LIMIT = 3;
@@ -104,13 +124,23 @@ const Home: React.FC<HomeContainerProps> = ({ events, announcements }) => {
104124
}, []);
105125

106126
const LandingCard = styled(Card)`
107-
position: relative;
108-
top: 30%;
127+
position: absolute;
128+
top: 40%;
109129
left: 15%;
110130
width: ${privilegeLevel === PrivilegeLevel.ADMIN ? '600px' : '500px'};
111131
height: ${privilegeLevel === PrivilegeLevel.ADMIN ? '220px' : '280px'};
112132
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
113133
border-radius: 5px;
134+
135+
@media screen and (max-width: ${PRIMARY_BREAKPOINT}) {
136+
height: max-content;
137+
position: relative;
138+
width: 100%;
139+
left: 0%;
140+
justify-content: center;
141+
border-radius: 0px;
142+
box-shadow: none;
143+
}
114144
`;
115145
return (
116146
<>
@@ -124,6 +154,7 @@ const Home: React.FC<HomeContainerProps> = ({ events, announcements }) => {
124154

125155
{privilegeLevel === PrivilegeLevel.ADMIN ? (
126156
<LandingContainer>
157+
<LandingImage />
127158
<LandingCard bordered={false}>
128159
<LandingTextContainer>
129160
<LandingText>Welcome Administrator!</LandingText>
@@ -153,6 +184,7 @@ const Home: React.FC<HomeContainerProps> = ({ events, announcements }) => {
153184
</LandingContainer>
154185
) : (
155186
<LandingContainer>
187+
<LandingImage />
156188
<LandingCard bordered={false}>
157189
<LandingTextContainer>
158190
<LandingText>
@@ -185,15 +217,13 @@ const Home: React.FC<HomeContainerProps> = ({ events, announcements }) => {
185217
? events.result.slice(0, CARD_ROW_LIMIT)
186218
: events.result
187219
).map((event: EventInformation, i) => (
188-
<Col key={i}>
189-
<EventCard
190-
imageSrc={event.thumbnail}
191-
title={event.title}
192-
date={event.details.start}
193-
description={event.details.description}
194-
to={`/events/${event.id}`}
195-
/>
196-
</Col>
220+
<EventCard
221+
imageSrc={event.thumbnail}
222+
title={event.title}
223+
date={event.details.start}
224+
description={event.details.description}
225+
to={`/events/${event.id}`}
226+
/>
197227
))}
198228
{asyncRequestIsComplete(events) && events.result.length === 0 && (
199229
<CenterEventsContainer>

src/containers/singleEvent/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ const CenteredContainer = styled.div`
3939
const AdminActionButtonList = styled.div`
4040
display: flex;
4141
flex-wrap: wrap;
42+
margin-bottom: 16px;
4243
`;
4344

4445
const StyledButton = styled(LinkButton)`
@@ -47,7 +48,7 @@ const StyledButton = styled(LinkButton)`
4748
text-align: center;
4849
justify-content: center;
4950
background-color: #2d870d;
50-
margin: 0 16px 32px 0;
51+
margin: 0 16px 16px 0;
5152
padding: 8px 16px;
5253
`;
5354

src/utils/breakpoints.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const PRIMARY_BREAKPOINT = '900px';

0 commit comments

Comments
 (0)