Skip to content

Commit 384d8e7

Browse files
committed
Removed non-working props
Rearranged modal event preview closing button Removed unused package
1 parent 9caf879 commit 384d8e7

5 files changed

Lines changed: 49 additions & 79 deletions

File tree

frontend/src/components/events/EventHeroImage/index.js

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ export default ({
8383
onBack,
8484
backgroundColor,
8585
alignRight,
86-
isPreview = false,
8786
}) => {
8887
const dispatch = useDispatch()
8988
const classes = useStyles({ backgroundColor })
@@ -111,42 +110,11 @@ export default ({
111110
</Grid>
112111
</Container>
113112

114-
{/* <Box className={classes.logoWrapper}>
115-
<FadeInWrapper enterDelay={0.3} verticalOffset={50}>
116-
<Box
117-
p={3}
118-
display="flex"
119-
flexDirection="column"
120-
alignItems="center"
121-
justifyContent="center"
122-
>
123-
<Typography
124-
className={classes.overline}
125-
variant="button"
126-
>
127-
{event?._eventTimeFormatted}
128-
</Typography>
129-
<Typography className={classes.title} variant="h3">
130-
{title ?? event?.name}
131-
</Typography>
132-
<Typography className={classes.title} variant="h4">
133-
{subheading}
134-
</Typography>
135-
136-
<Typography
137-
className={classes.overline}
138-
variant="button"
139-
>
140-
{event?._eventLocationFormatted}
141-
</Typography>
142-
</Box>
143-
</FadeInWrapper>
144-
</Box> */}
145113
<Container
146114
wrapperClass={classes.backButtonWrapper}
147115
className={classes.buttonInner}
148116
>
149-
{!isPreview && (<Button
117+
<Button
150118
onClick={
151119
typeof onBack === 'function'
152120
? onBack
@@ -158,8 +126,7 @@ export default ({
158126
Back
159127
</Typography>
160128
</Button>
161-
)}
162129
</Container>
163-
</Box >
130+
</Box>
164131
)
165132
}
Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import React from 'react'
2-
import { Dialog, DialogTitle, DialogContent, DialogActions } from '@material-ui/core'
2+
import {
3+
Dialog,
4+
DialogTitle,
5+
DialogContent,
6+
DialogActions,
7+
} from '@material-ui/core'
38
import Button from 'components/generic/Button'
49

510
export default ({ open, onClose, eventSlug }) => {
@@ -12,18 +17,20 @@ export default ({ open, onClose, eventSlug }) => {
1217
aria-labelledby="preview-modal-title"
1318
>
1419
<DialogTitle id="preview-modal-title">Event Preview</DialogTitle>
20+
<DialogActions
21+
style={{ display: 'flex', justifyContent: 'center' }}
22+
>
23+
<Button onClick={onClose} color="primary" variant="contained">
24+
Close
25+
</Button>
26+
</DialogActions>
1527
<DialogContent>
1628
<iframe
1729
src={`/events/${eventSlug}?preview=true`}
1830
style={{ width: '100%', height: '80vh', border: 'none' }}
1931
title="Event Preview"
2032
/>
2133
</DialogContent>
22-
<DialogActions style={{ display: 'flex', justifyContent: 'center' }}>
23-
<Button onClick={onClose} color="primary" variant="contained">
24-
Close
25-
</Button>
26-
</DialogActions>
2734
</Dialog>
2835
)
29-
}
36+
}

frontend/src/pages/_events/slug/default/EventButtons/index.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Button from 'components/generic/Button'
1010
import * as AuthSelectors from 'redux/auth/selectors'
1111
import { useTranslation } from 'react-i18next'
1212

13-
export default ({ event, registration, isPreview = false }) => {
13+
export default ({ event, registration }) => {
1414
const { t } = useTranslation()
1515
const dispatch = useDispatch()
1616
const match = useRouteMatch()
@@ -37,7 +37,6 @@ export default ({ event, registration, isPreview = false }) => {
3737
<Grid container spacing={1}>
3838
<Grid item xs={12}>
3939
<Button
40-
disabled={isPreview}
4140
onClick={() =>
4241
dispatch(push(`${match.url}/register`))
4342
}
@@ -49,10 +48,11 @@ export default ({ event, registration, isPreview = false }) => {
4948
</Grid>
5049
<Grid item xs={12}>
5150
<Button
52-
disabled={isPreview}
5351
onClick={() =>
5452
dispatch(
55-
push(`/dashboard/event/${event.slug}`),
53+
push(
54+
`/dashboard/event/${event.slug}`,
55+
),
5656
)
5757
}
5858
variant="applicationsClosed"
@@ -66,7 +66,6 @@ export default ({ event, registration, isPreview = false }) => {
6666
} else {
6767
return (
6868
<Button
69-
disabled={isPreview}
7069
onClick={() =>
7170
dispatch(push(`${match.url}/register`))
7271
}
@@ -80,7 +79,6 @@ export default ({ event, registration, isPreview = false }) => {
8079
} else {
8180
return (
8281
<Button
83-
disabled={isPreview}
8482
onClick={() =>
8583
dispatch(
8684
push(`/login`, {
@@ -101,7 +99,6 @@ export default ({ event, registration, isPreview = false }) => {
10199
if (hasRegistration) {
102100
return (
103101
<Button
104-
disabled={isPreview}
105102
onClick={() =>
106103
dispatch(push(`/dashboard/event/${event.slug}`))
107104
}
@@ -121,7 +118,6 @@ export default ({ event, registration, isPreview = false }) => {
121118
} else {
122119
return (
123120
<Button
124-
disabled={isPreview}
125121
onClick={() =>
126122
dispatch(push('/login', { nextRoute: match.url }))
127123
}

frontend/src/pages/_events/slug/default/EventTimeline/index.js

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
} from '@material-ui/core'
1111
import { sortBy } from 'lodash-es'
1212
import moment from 'moment'
13-
import MiscUtils from 'utils/misc'
1413
import TimelineDot from 'components/generic/TimelineDot'
1514
import StepConnector from '@material-ui/core/StepConnector'
1615

@@ -105,29 +104,29 @@ const EventTimeline = ({ event, textColor, accentColor = undefined }) => {
105104
realItems.length > 0
106105
? realItems
107106
: [
108-
{
109-
date: moment(event.registrationStartTime).format(
110-
dateString,
111-
),
112-
dateValue: moment(event.registrationStartTime).unix(),
113-
completed: moment(
114-
event.registrationStartTime,
115-
).isBefore(),
116-
title: 'Application period begins',
117-
active: true,
118-
},
119-
{
120-
date: moment(event.registrationEndTime).format(
121-
dateString,
122-
),
123-
dateValue: moment(event.registrationEndTime).unix(),
124-
completed: moment(
125-
event.registrationEndTime,
126-
).isBefore(),
127-
title: 'Application period ends',
128-
active: true,
129-
},
130-
]
107+
{
108+
date: moment(event.registrationStartTime).format(
109+
dateString,
110+
),
111+
dateValue: moment(event.registrationStartTime).unix(),
112+
completed: moment(
113+
event.registrationStartTime,
114+
).isBefore(),
115+
title: 'Application period begins',
116+
active: true,
117+
},
118+
{
119+
date: moment(event.registrationEndTime).format(
120+
dateString,
121+
),
122+
dateValue: moment(event.registrationEndTime).unix(),
123+
completed: moment(
124+
event.registrationEndTime,
125+
).isBefore(),
126+
title: 'Application period ends',
127+
active: true,
128+
},
129+
]
131130

132131
if (realItems.length < 1) {
133132
if (

frontend/src/pages/_events/slug/default/index.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import EventHeroImage from 'components/events/EventHeroImage'
77
import Markdown from 'components/generic/Markdown'
88
import AnalyticsService from 'services/analytics'
99

10-
1110
import EventTimeline from './EventTimeline'
1211
import BannerCarousel from 'components/generic/BannerCarousel'
1312
import GradientBox from 'components/generic/GradientBox'
@@ -66,7 +65,8 @@ const useStyles = makeStyles({
6665
},
6766
})
6867

69-
export default ({ isPreview = false }) => { // isPreview determines if the page is being previewed in the Preview modal
68+
export default () => {
69+
// isPreview determines if the page is being previewed in the Preview modal
7070
const dispatch = useDispatch()
7171
const { slug, event, registration } = useContext(EventDetailContext)
7272
const classes = useStyles(event.theme)
@@ -129,7 +129,6 @@ export default ({ isPreview = false }) => { // isPreview determines if the page
129129
onBack={() => dispatch(push('/home'))}
130130
alignRight
131131
backgroundColor={event.theme.headerBackgroundColor}
132-
isPreview={isPreview}
133132
/>
134133
<FadeInWrapper>
135134
<StaggeredList>
@@ -178,7 +177,10 @@ export default ({ isPreview = false }) => { // isPreview determines if the page
178177
<StaggeredListItem>
179178
<Box mt={3} />
180179
<GradientBox color="theme_white" p={3}>
181-
<Typography variant="button" gutterBottom>
180+
<Typography
181+
variant="button"
182+
gutterBottom
183+
>
182184
Event Timeline
183185
</Typography>
184186
<hr className="tw-h-px tw-bg-gray-500 tw-border-0 tw-dark:bg-gray-900"></hr>
@@ -212,7 +214,6 @@ export default ({ isPreview = false }) => { // isPreview determines if the page
212214
<EventButtons
213215
event={event}
214216
registration={registration}
215-
isPreview={isPreview}
216217
/>
217218
</Box>
218219
</StaggeredList>

0 commit comments

Comments
 (0)