This commit is contained in:
Maciej Kotowski committed 2021-10-07 21:01:46 +02:00
commit ef03b882f7
3 files changed
+13 -14

No files matched your search

@@ -33,12 +33,10 @@ export const EventPreviewEdit = (props) => {
</div>
<div className="d-flex justify-content-between align-items-center ">
<span className={styles.time}>
<BIcon icon="calendar" />
{`${getDate(props.data.time)} ${getTime(props.data.time)}` ?? ""}
<BIcon icon="calendar" /> {`${getDate(props.data.time)} ${getTime(props.data.time)}` ?? ""}
</span>
<span className={styles.location}>
<BIcon icon="geo-alt-fill" />
{props.data.address?.split(", ").splice(0, 2).join(", ")}
<BIcon icon="geo-alt-fill" /> {props.data.address?.split(", ").splice(0, 2).join(", ")}
</span>
</div>
<div className="d-flex justify-content-between align-items-center ">
+9 -9
View File
@@ -14,6 +14,15 @@ export const UserPanel = (props) => {
<h3>Zalogowano jako</h3>
<h1>{LOGIN_MANAGER.state.email ?? "Nieznany użytkownik"}</h1>
<Stack gap={2}>
<button
aria-label="Dashboard"
onClick={() => {
props.history?.push("/dashboard");
props.close();
}}
>
Dashboard
</button>
<button
aria-label="Wyloguj się"
onClick={async () => {
@@ -24,15 +33,6 @@ export const UserPanel = (props) => {
>
<BIcon icon="box-arrow-right" /> Wyloguj się
</button>
<button
aria-label="Dashboard"
onClick={() => {
props.history?.push("/dashboard");
props.close();
}}
>
Dashboard
</button>
</Stack>
</div>
);
+2 -1
View File
@@ -24,8 +24,9 @@ export class APIClient extends EventEmitter {
}
async deleteEvent(item) {
const rq = await axios.post(`${this.#dbUrl}/api/deleteEvent`,item);
const rq = await axios.post(`${this.#dbUrl}/api/deleteEvent`, item);
if (rq.status !== 200) throw new Error(`Request failed with status code ${rq.status}: ${rq.statusText}`);
await this.fetchEvents();
return rq.data;
}