Archived
Created EventPreview component
This commit is contained in:
1 parent
5f95bfdc75
commit
2217fb2634
4 files changed
+45
-26
No files matched your search
@@ -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;
|
||||||
|
}
|
||||||
@@ -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>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -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;
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user