-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #61 from ecss-soton/events-page
Events-page
- Loading branch information
Showing
13 changed files
with
876 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,6 +92,10 @@ | |
} | ||
} | ||
|
||
.columnEvents { | ||
grid-column-end: span 12; | ||
} | ||
|
||
.pagination { | ||
margin-top: calc(var(--base) * 2); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
@import '../../_css/common'; | ||
|
||
.rectangle { | ||
background-color: var(--theme-elevation-50); | ||
border-radius: 42px; | ||
box-shadow: -8px 8px 33px -16px var(--theme-shadow); | ||
height: 100%; | ||
position: relative; | ||
width: 100%; | ||
display: flex; | ||
flex-direction: row; | ||
|
||
@include extra-small-break { | ||
flex-direction: column; | ||
width: 80%; | ||
} | ||
} | ||
|
||
.when { | ||
text-align: center; | ||
width: 150px; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
|
||
@include extra-small-break { | ||
width: 100%; | ||
} | ||
} | ||
|
||
.date { | ||
color: var(--theme-elevation-1000); | ||
font-size: 48px; | ||
font-weight: 700; | ||
letter-spacing: 0; | ||
line-height: normal; | ||
|
||
@include extra-small-break { | ||
font-size: 18vw; | ||
} | ||
} | ||
|
||
.month { | ||
color: var(--theme-elevation-400); | ||
font-size: 24px; | ||
font-weight: 400; | ||
letter-spacing: 0; | ||
line-height: normal; | ||
width: 100%; | ||
|
||
@include extra-small-break { | ||
font-size: 7vw; | ||
} | ||
} | ||
|
||
.desc { | ||
color: var(--theme-elevation-800); | ||
font-size: 24px; | ||
font-weight: 400; | ||
letter-spacing: 0; | ||
line-height: normal; | ||
width: 100%; | ||
|
||
@include extra-small-break { | ||
display: none; | ||
} | ||
} | ||
|
||
.name { | ||
color: var(--theme-elevation-1000); | ||
font-size: 64px; | ||
font-weight: 700; | ||
letter-spacing: 0; | ||
line-height: normal; | ||
width: 100%; | ||
|
||
@include extra-small-break { | ||
font-size: 10vw; | ||
} | ||
} | ||
|
||
.what { | ||
flex: 75%; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
padding-top: 3%; | ||
padding-bottom: 0.5%; | ||
padding-right: 5%; | ||
padding-left: 2%; | ||
|
||
@include extra-small-break { | ||
width: 100%; | ||
padding-left: 1%; | ||
padding-right: 1%; | ||
padding-bottom: 2%; | ||
text-align: center; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import React from 'react' | ||
import { Inter } from '@next/font/google' | ||
|
||
import { Event } from '../../../payload/payload-types' | ||
|
||
import classes from './index.module.scss' | ||
|
||
const inter = Inter({ | ||
subsets: ['latin'], | ||
weight: ['400', '700'], | ||
style: ['normal'], | ||
}) | ||
|
||
export const EventItem: React.FC<{ | ||
event?: Event | ||
}> = props => { | ||
const { | ||
event: { name, date, description: desc }, | ||
} = props | ||
|
||
const getMonthName = (monthNumber: number): string => { | ||
const monthNames = [ | ||
'Jan', | ||
'Feb', | ||
'Mar', | ||
'Apr', | ||
'May', | ||
'Jun', | ||
'Jul', | ||
'Aug', | ||
'Sep', | ||
'Oct', | ||
'Nov', | ||
'Dec', | ||
] | ||
return monthNames[monthNumber - 1] | ||
} | ||
|
||
const dateParts = date.split('-') | ||
const year = dateParts[0] | ||
const month = parseInt(dateParts[1], 10) | ||
const day = dateParts[2].split('T')[0] | ||
const monthName = getMonthName(month) | ||
|
||
// const { slug, title, categories, meta } = doc || {} | ||
// const { description, image: metaImage } = meta || {} | ||
|
||
// const hasCategories = categories && Array.isArray(categories) && categories.length > 0 | ||
// const titleToUse = titleFromProps || title | ||
// const sanitizedDescription = description?.replace(/\s/g, ' ') // replace non-breaking space with white space | ||
// const href = `/${relationTo}/${slug}` | ||
|
||
return ( | ||
<div className={[classes.rectangle, inter.className].join(' ')}> | ||
<div className={classes.when}> | ||
<div className={classes.date}>{day}</div> | ||
<div className={classes.month}>{monthName}</div> | ||
</div> | ||
<div className={classes.what}> | ||
<div className={classes.name}>{name}</div> | ||
<p className={classes.desc}>{desc}</p> | ||
</div> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import type { CollectionConfig } from 'payload/types' | ||
|
||
import { admins } from '../access/admins' | ||
|
||
const Events: CollectionConfig = { | ||
slug: 'events', | ||
access: { | ||
read: () => true, | ||
create: admins, | ||
update: admins, | ||
delete: admins, | ||
}, | ||
admin: { | ||
useAsTitle: 'id', | ||
defaultColumns: ['id', 'type'], | ||
}, | ||
fields: [ | ||
{ | ||
name: 'id', | ||
label: 'id', | ||
type: 'text', | ||
required: true, | ||
}, | ||
{ | ||
name: 'name', | ||
label: 'Name', | ||
type: 'text', | ||
required: true, | ||
}, | ||
{ | ||
name: 'date', | ||
label: 'Date', | ||
type: 'date', | ||
required: true, | ||
admin: { | ||
date: { | ||
pickerAppearance: 'dayAndTime', | ||
displayFormat: 'dd-MM-yyyy hh:mm', | ||
}, | ||
}, | ||
}, | ||
{ | ||
name: 'location', | ||
label: 'Location', | ||
type: 'text', | ||
}, | ||
{ | ||
name: 'description', | ||
label: 'Description', | ||
type: 'text', | ||
maxLength: 150, | ||
}, | ||
], | ||
} | ||
|
||
export default Events |
Oops, something went wrong.