This commit is contained in:
drgoodcat committed 2021-10-07 23:35:47 +02:00
commit 0751f04a06
5 files changed
+23 -14

No files matched your search

@@ -2,9 +2,8 @@ import { BIcon } from "../BIcon";
import styles from "./index.module.scss";
import { EventType } from "../EventType";
import { API_CLIENT } from "../../constants";
import { useHistory } from "react-router-dom";
export const EventPreviewEdit = (props) => {
const history = useHistory();
const getDate = (time) => {
let date = new Date(time);
return date.toLocaleDateString(navigator.language);
@@ -17,7 +16,6 @@ export const EventPreviewEdit = (props) => {
});
};
const deleteItem = async (arg) => {
console.log("deleting..." + arg);
await API_CLIENT.deleteEvent({ id: arg });
};
return (
+5 -3
View File
@@ -1,10 +1,12 @@
import { Link } from "react-router-dom";
import { BIcon } from "../BIcon";
import styles from "./index.module.scss";
export const Footer = () => {
return (
<div className={styles.footer}><Link aria-label="Credits" to="/credits" style={{ textDecoration: "none" }}><span className={styles.txt}>credits</span></Link></div>
<div className={styles.footer}>
<Link aria-label="Credits" to="/credits" style={{ textDecoration: "none" }}>
<span className={styles.txt}>credits</span>
</Link>
</div>
);
};
+1 -1
View File
@@ -50,7 +50,7 @@ export const MapPopup = (props) => {
}}
showMarker={true}
width="100%"
height="60vh"
height="85vh"
center={center}
zoom={zoom}
></Map>
+5 -2
View File
@@ -13,8 +13,11 @@ import { getPlace } from "../../utils/map/getPlace";
import { MapPopup } from "./MapPopup";
export const CreateEvent = () => {
useTitle("Tworzenie wydarzenia");
const history = useHistory();
if (LOGIN_MANAGER.state === null) {
history.push("/");
}
useTitle("Tworzenie wydarzenia");
const [locationText, setLocationText] = useState("Brak lokalizacji");
const formik = useFormik({
initialValues: {
@@ -120,7 +123,7 @@ export const CreateEvent = () => {
/>
);
},
{ width: "70vw", backgroundColor: "#CCCCCC" }
{ width: "95vw", backgroundColor: "#CCCCCC" }
);
}}
>
+11 -5
View File
@@ -1,14 +1,20 @@
import styles from "./index.module.scss";
import { useRef } from "react";
import { Stack } from "react-bootstrap";
import { useState, useEffect } from "react";
import { API_CLIENT } from "../../constants";
import { container } from "../../global.module.scss";
import { EventPreviewEdit } from "../../components/EventPreviewEdit";
import { useHistory } from "react-router-dom";
import { useHistory } from "react-router";
import { LOGIN_MANAGER } from "../../constants";
export const Dashboard = () => {
const [list, updateList] = useState();
let array = [];
const history = useHistory();
if (LOGIN_MANAGER.state === null) {
history.push("/");
}
const [list, updateList] = useState();
const array = useRef([]);
useEffect(() => {
//chce wyrenderować eventpreview ale tylko dla eventów utworzonych przez danego użytkownika
API_CLIENT.isLogged().then((data) => {
@@ -16,12 +22,12 @@ export const Dashboard = () => {
if (data !== "not logged") {
API_CLIENT.getUserEvents(data.email).then((events) => {
if (events) {
array = events;
array.current = events;
console.log(array);
render();
}
});
}else{
} else {
history.push("/");
}
});