Skip to content

Add event listings #1

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dist-ssr
# Editor directories and files
.vscode/*
!.vscode/extensions.json
!.vscode/settings.json
.idea
.DS_Store
*.suo
Expand Down
12 changes: 12 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[javascriptreact]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"eslint.validate": ["javascript"]
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"preview": "vite preview"
},
"dependencies": {
"date-fns": "^2.29.1",
"firebase": "9.8.3",
"react": "^18.0.0",
"react-dom": "^18.0.0",
Expand Down
1 change: 0 additions & 1 deletion src/components/AppContainer/AppContainer.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
div {
width: 100vw;
height: 100vh;
background-color: red;
}
100 changes: 100 additions & 0 deletions src/components/EventListing/EventListing.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
.event-listing {
display: flex;
flex-direction: row;
align-items: center;
padding: 0px;

width: 100%;
max-width: 873px;
height: 136px;

background: #ffffff;
box-shadow: 0px 0px 12px rgba(0, 0, 0, 0.12);
border-radius: 5px;

overflow: hidden;
align-self: stretch;
}

.event-listing__date-snippet {
width: 93px;
height: 136px;

background: #20374a;
position: relative;

flex: none;
align-self: stretch;
flex-grow: 0;
}

.event-listing__date-snippet-text {
position: absolute;
left: 0%;
right: 0%;
top: 0%;
bottom: 0%;

font-family: 'Inter';
font-style: normal;
font-weight: 700;
font-size: 20px;
line-height: 28px;
/* or 140% */

display: flex;
flex-direction: column;
align-items: center;
justify-content: center;

color: #ffffff;
}

.event-listing__date-snippet-day {
font-size: 28px;
}

.event-listing__event-content {
display: flex;
flex-direction: column;
align-items: flex-start;
padding: 10px;
gap: 10px;

height: 100%;

box-sizing: border-box;

flex: 1;
}

.event-listing__title,
.event-listing__subtitle,
.event-listing__location {
font-family: 'Lato';
font-style: normal;
font-weight: 400;
flex: none;
flex-grow: 0;
}

.event-listing__title {
font-size: 32px;
line-height: 38px;
color: #000000;
order: 0;
}

.event-listing__subtitle {
font-size: 24px;
line-height: 29px;
color: #777777;
order: 1;
}

.event-listing__location {
font-size: 24px;
line-height: 29px;
color: #4d4d4d;
order: 2;
}
31 changes: 31 additions & 0 deletions src/components/EventListing/EventListing.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import React from "react";
import PropTypes from "prop-types";
import "./EventListing.css";
import { format } from "date-fns";

export const EventListing = ({title, start, end, location}) => {
return (
<div className="event-listing">
<div className="event-listing__date-snippet">
<p className="event-listing__date-snippet-text">
{format(start, "LLL")}
<p className="event-listing__date-snippet-day">{format(start, "d")}</p>
</p>
</div>
<div className="event-listing__event-content">
<p className="event-listing__title">{title}</p>
<p className="event-listing__subtitle">
{format(start, "eee, LLL d")} to {format(end, "eee, LLL d")}
</p>
<p className="event-listing__location">{location}</p>
</div>
</div>
);
};

EventListing.propTypes = {
title: PropTypes.string.isRequired,
start: PropTypes.instanceOf(Date).isRequired,
end: PropTypes.instanceOf(Date).isRequired,
location: PropTypes.string.isRequired,
};
1 change: 1 addition & 0 deletions src/components/EventListing/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { PageContainer } from "./PageContainer";
7 changes: 5 additions & 2 deletions src/components/PageContainer/PageContainer.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
div {
.page-container {
width: 100%;
height: 100%;
background-color: blue;
padding: 10px;
/* border-box makes it so that padding does not affect the width
of the element */
box-sizing: border-box;
}
4 changes: 2 additions & 2 deletions src/components/PageContainer/PageContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import PropTypes from "prop-types";
import "./PageContainer.css";

export const PageContainer = ({children}) => {
return (<div>{children}</div>);
return (<div className="page-container">{children}</div>);
};

PageContainer.propTypes = {
children: PropTypes.any
children: PropTypes.node
};
143 changes: 141 additions & 2 deletions src/main.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,147 @@
body {
/*
Google fonts script for 'Inter - Bold 700' and 'Lato - Regular 400'
*/
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@700&family=Lato&display=swap');

/* http://meyerweb.com/eric/tools/css/reset/
v5.0.1 | 20191019
License: none (public domain)
*/

html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
menu,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
main,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
margin: 0;
padding: 0;
font-size: 16px;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
menu,
nav,
section {
display: block;
}
/* HTML5 hidden-attribute fix for newer browsers */
*[hidden] {
display: none;
}
body {
line-height: 1;
}
menu,
ol,
ul {
list-style: none;
}
blockquote,
q {
quotes: none;
}
blockquote:before,
blockquote:after,
q:before,
q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}

body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
Expand Down
12 changes: 0 additions & 12 deletions src/pages/LandingPage/AboutSection.css
Original file line number Diff line number Diff line change
@@ -1,12 +0,0 @@
body {
margin: 0;
padding: 0;

font-size: 16px;

font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
12 changes: 0 additions & 12 deletions src/pages/LandingPage/ContactSection.css
Original file line number Diff line number Diff line change
@@ -1,12 +0,0 @@
body {
margin: 0;
padding: 0;

font-size: 16px;

font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
17 changes: 17 additions & 0 deletions src/pages/LandingPage/EventsSection.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.events {
display: flex;
flex-direction: column;
align-items: flex-start;
padding: 32px 0px;
gap: 27px;
}

.events__heading {
font-family: 'Lato';
font-style: normal;
font-weight: 400;
font-size: 50px;
line-height: 60px;

color: #000000;
}
Loading