Created EventPreview component

This commit is contained in:
mmacierzanka committed 2021-10-02 22:35:33 +02:00
1 parent 5f95bfdc75
commit 2217fb2634
4 files changed
+44 -25

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
import { Link } from "react-router-dom";
import { BIcon } from "../BIcon";
import styles from "./index.module.scss";
export const EventPreview = (props) => {
return (
<Link to="/" className={styles.link}>
<div className={styles.item}>
<span className={styles.location}>{props.name ?? "Event name"}</span> <br></br>
<span>
<BIcon icon="calendar" /> {props.date ?? ""}
</span>
</div>
</Link>
);
};
@@ -0,0 +1,21 @@
@import "../../index.scss";
.link {
text-decoration: none;
color: black !important;
}
.item {
border: 1px solid black;
border-radius: 15px;
width: 70vw;
max-width: 500px;
height: 10vh;
margin: 3px auto;
padding: 10px 25px;
}
.location {
font-weight: bold;
font-size: 1.7em;
}
+4 -9
View File
@@ -1,7 +1,8 @@
import axios from "axios";
import { useState, useEffect } from "react"; import { useState, useEffect } from "react";
import { Stack } from "react-bootstrap"; import { Stack } from "react-bootstrap";
import { EventPreview } from "../../components/EventPreview";
import styles from "./index.module.scss"; import styles from "./index.module.scss";
import axios from "axios";
import { BACKEND_URL } from "../../constants"; import { BACKEND_URL } from "../../constants";
export const Home = () => { export const Home = () => {
@@ -23,16 +24,10 @@ export const Home = () => {
<div className={styles.con}> <div className={styles.con}>
<Stack gap={1}> <Stack gap={1}>
{events.map((e, i) => { {events.map((e, i) => {
return ( return <EventPreview name={e.name} date={e.date} key={i} />;
<div key={i} className={styles.item}>
<span className={styles.location}>{e.name}</span> <br></br>
<span>{e.date}</span>
</div>
);
})} })}
<p className={styles.more}>więcej</p> <p className={styles.more}>więcej</p>
</Stack> </Stack>
</div> </div>
); );
}; };
+3 -16
View File
@@ -1,24 +1,11 @@
.item {
border: 1px solid black;
border-radius: 15px;
width: 70vw;
max-width: 500px;
height:10vh;
margin: 0 auto;
padding-left:25px;
padding-top:10px;
}
.con { .con {
width: 70vw; width: 70vw;
max-width: 500px; max-width: 500px;
margin: 0 auto; margin: 0 auto;
font-family: "Poppins", sans-serif; font-family: "Poppins", sans-serif;
} }
.location {
font-weight: bold; .more {
font-size: 1.7em; color: #5873ff;
}
.more{
color: #5873FF;
text-align: right; text-align: right;
} }