removed warnings and fixed bugs

This commit is contained in:
mmacierzanka committed 2021-10-07 23:27:01 +02:00
1 parent a539050698
commit 852e1f4568
4 files changed
+11 -10

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
@@ -13,11 +13,11 @@ import { getPlace } from "../../utils/map/getPlace";
import { MapPopup } from "./MapPopup";
export const CreateEvent = () => {
const history = useHistory();
if (LOGIN_MANAGER.state === null) {
history.push("/");
}
useTitle("Tworzenie wydarzenia");
const history = useHistory();
const [locationText, setLocationText] = useState("Brak lokalizacji");
const formik = useFormik({
initialValues: {
+4 -3
View File
@@ -1,4 +1,5 @@
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";
@@ -8,12 +9,12 @@ import { useHistory } from "react-router";
import { LOGIN_MANAGER } from "../../constants";
export const Dashboard = () => {
const history = useHistory();
if (LOGIN_MANAGER.state === null) {
history.push("/");
}
const [list, updateList] = useState();
let array = [];
const history = useHistory();
const array = useRef([]);
useEffect(() => {
//chce wyrenderować eventpreview ale tylko dla eventów utworzonych przez danego użytkownika
API_CLIENT.isLogged().then((data) => {
@@ -21,7 +22,7 @@ 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();
}