Archived
Merge branch 'master' of https://github.com/makoteq/eco-hack
This commit is contained in:
commit
c9cd8194b1
11 files changed
+48
-20
No files matched your search
@@ -31,6 +31,10 @@
|
||||
## Screenshots
|
||||

|
||||
|
||||
|
||||

|
||||
|
||||
|
||||
## Usage
|
||||
Simply visit our internet website ecomeet.me and start saving our planet!
|
||||
|
||||
|
||||
+3
-2
@@ -2,7 +2,6 @@ import { useEffect, useState } from "react";
|
||||
import { BrowserRouter as Router, Switch, Route } from "react-router-dom";
|
||||
import { Home } from "./pages/Home";
|
||||
import { Dashboard } from "./pages/Dashboard";
|
||||
import { Users } from "./pages/Users";
|
||||
import { Credits } from "./pages/Credits";
|
||||
import { NotFound } from "./pages/NotFound";
|
||||
import { Navbar } from "./components/Navbar";
|
||||
@@ -26,6 +25,7 @@ export const App = () => {
|
||||
lon: e.lon,
|
||||
id: e._id,
|
||||
createdTime: e.created?.time,
|
||||
user: e.user,
|
||||
}}
|
||||
></Event>
|
||||
</Route>
|
||||
@@ -50,6 +50,7 @@ export const App = () => {
|
||||
lon: e.lon,
|
||||
id: e._id,
|
||||
createdTime: e.created.time,
|
||||
user: e.user,
|
||||
}}
|
||||
></Event>
|
||||
</Route>
|
||||
@@ -73,6 +74,7 @@ export const App = () => {
|
||||
lon: e.lon,
|
||||
id: e._id,
|
||||
createdTime: e.created.time,
|
||||
user: e.user,
|
||||
}}
|
||||
></Event>
|
||||
</Route>
|
||||
@@ -88,7 +90,6 @@ export const App = () => {
|
||||
<Switch>
|
||||
<Route exact path="/dashboard" component={Dashboard} />
|
||||
<Route exact path="/credits" component={Credits} />
|
||||
<Route exact path="/users" component={Users} />
|
||||
<Route exact path="/">
|
||||
<Home />
|
||||
</Route>
|
||||
|
||||
@@ -15,7 +15,7 @@ export const EventPreview = (props) => {
|
||||
});
|
||||
};
|
||||
return (
|
||||
<Link to={`/event/${props.data.id}`} className={styles.link}>
|
||||
<Link aria-label={props.data.name ?? "Nazwa wydarzenia"} to={`/event/${props.data.id}`} className={styles.link}>
|
||||
<div className={styles.item}>
|
||||
<span className={styles.name}>{props.data.name ?? "Event name"}</span> <br></br>
|
||||
<div className="d-flex justify-content-between align-items-center ">
|
||||
@@ -29,7 +29,7 @@ export const EventPreview = (props) => {
|
||||
<div className="d-flex justify-content-between align-items-center ">
|
||||
<EventType type={props.data.type} />
|
||||
<span className={styles.createdSpan}>
|
||||
utworzone {getDate(props.data.createdTime)} o godzinie {getTime(props.data.createdTime)}
|
||||
utworzone {getDate(props.data.createdTime)} o godzinie {getTime(props.data.createdTime)} przez {props.data.user}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -27,7 +27,7 @@ export const LoginPanel = (props) => {
|
||||
return (
|
||||
<>
|
||||
<div className={container}>
|
||||
<button className={styles.closeBtn} onClick={props.close}>
|
||||
<button className={styles.closeBtn} aria-label="Zamknij" onClick={props.close}>
|
||||
<BIcon icon="x" size={"20px"} />
|
||||
</button>
|
||||
<p className={styles.title}>Zaloguj się</p>
|
||||
@@ -35,7 +35,7 @@ export const LoginPanel = (props) => {
|
||||
<Stack gap={2}>
|
||||
<input type="text" autoComplete={"username"} placeholder="Nazwa użytkownika"></input>
|
||||
<input type="password" autoComplete={"current-password"} placeholder="Hasło"></input>
|
||||
<button type="submit" className={"greenButton"}>
|
||||
<button type="submit" aria-label="Zaloguj się" className={"greenButton"}>
|
||||
Zaloguj się
|
||||
</button>
|
||||
</Stack>
|
||||
|
||||
@@ -13,10 +13,11 @@ export const Navbar = () => {
|
||||
|
||||
return (
|
||||
<nav className={styles.nav}>
|
||||
<Link to="/" style={{ textDecoration: "none" }}>
|
||||
<Link aria-label="Strona główna" to="/" style={{ textDecoration: "none" }}>
|
||||
<img alt="eco-meet title" height="60" src={title} />
|
||||
</Link>
|
||||
<button
|
||||
aria-label="Zarządzanie kontem"
|
||||
className={styles.navBtn}
|
||||
onClick={async () => {
|
||||
if (LOGIN_MANAGER.state) {
|
||||
|
||||
@@ -8,13 +8,14 @@ export const UserPanel = (props) => {
|
||||
|
||||
return (
|
||||
<div className={styles.container}>
|
||||
<button className={styles.closeBtn} onClick={props.close}>
|
||||
<button aria-label="Zamknij" className={styles.closeBtn} onClick={props.close}>
|
||||
<BIcon icon="x" size={"20px"} />
|
||||
</button>
|
||||
<h3>Zalogowano jako</h3>
|
||||
<h1>{LOGIN_MANAGER.state.email ?? "Nieznany użytkownik"}</h1>
|
||||
<Stack gap={2}>
|
||||
<button
|
||||
aria-label="Wyloguj się"
|
||||
onClick={async () => {
|
||||
await LOGIN_MANAGER.logout();
|
||||
props.close();
|
||||
@@ -24,6 +25,7 @@ export const UserPanel = (props) => {
|
||||
<BIcon icon="box-arrow-right" /> Wyloguj się
|
||||
</button>
|
||||
<button
|
||||
aria-label="Dashboard"
|
||||
onClick={() => {
|
||||
props.history?.push("/dashboard");
|
||||
props.close();
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useState } from "react";
|
||||
import { Stack } from "react-bootstrap";
|
||||
import { BIcon } from "../../components/BIcon";
|
||||
import { useHistory } from "react-router";
|
||||
import { API_CLIENT } from "../../constants";
|
||||
import { API_CLIENT, LOGIN_MANAGER } from "../../constants";
|
||||
import { container } from "../../global.module.scss";
|
||||
import styles from "./index.module.scss";
|
||||
import { spawnPopup } from "../../utils/popups/spawnPopup";
|
||||
@@ -50,6 +50,7 @@ export const CreateEvent = () => {
|
||||
lat: mapPos?.[1] ?? null,
|
||||
address: locationText,
|
||||
time: date.getTime(),
|
||||
user: LOGIN_MANAGER.state.email,
|
||||
};
|
||||
API_CLIENT.createEvent(rqObj)
|
||||
.then(() => {
|
||||
@@ -82,6 +83,7 @@ export const CreateEvent = () => {
|
||||
<p style={{ width: "70%", margin: 0 }}>{locationText}</p>
|
||||
{locationText !== "Brak lokalizacji" && (
|
||||
<button
|
||||
aria-label="Usuń lokalizację"
|
||||
className={styles.redButton}
|
||||
type="button"
|
||||
onClick={() => {
|
||||
@@ -93,6 +95,7 @@ export const CreateEvent = () => {
|
||||
</button>
|
||||
)}
|
||||
<button
|
||||
aria-label="Wybierz lokalizację"
|
||||
type="button"
|
||||
style={{ width: "30%" }}
|
||||
onClick={() => {
|
||||
@@ -128,7 +131,7 @@ export const CreateEvent = () => {
|
||||
<input onChange={formik.handleChange} type="date" id="date" style={{ width: "50%" }} />
|
||||
<input onChange={formik.handleChange} type="time" id="time" style={{ width: "50%" }} />
|
||||
</Stack>
|
||||
<button type="submit" className={"greenButton"}>
|
||||
<button aria-label="Utwórz wydarzenie" type="submit" className={"greenButton"}>
|
||||
Utwórz wydarzenie
|
||||
</button>
|
||||
</Stack>
|
||||
|
||||
@@ -20,6 +20,7 @@ export const Event = (props) => {
|
||||
</span>
|
||||
{data.address && data.address !== "Brak lokalizacji" && <EventField icon="geo-alt-fill" content={data.address} />}
|
||||
<EventField icon="calendar3" content={new Date(data.time).toLocaleString(navigator.language, { dateStyle: "full", timeStyle: "short" })} />
|
||||
<EventField icon="person" content={`Utworzone przez: ${data.user}`} />
|
||||
{data.lon && data.lat && <Map blockInteraction={true} width={"100%"} height={"500px"} showMarker={true} zoom={15} center={fromLonLat([data.lon, data.lat])} />}
|
||||
{data.description && <p className={styles.description}>{data.description}</p>}
|
||||
</Stack>
|
||||
|
||||
@@ -69,7 +69,7 @@ export const Home = () => {
|
||||
elements: list.sort(sortingFn(list.sortingMode.split(":")[0] === "distance" ? await getPos() : null)).map((e, i) => {
|
||||
return (
|
||||
<EventPreview
|
||||
data={{ name: e.name, type: e.type, lon: e.lon, lat: e.lat, createdTime: e.created?.time, time: e.time, id: e._id, address: e.address }}
|
||||
data={{ name: e.name, type: e.type, lon: e.lon, lat: e.lat, createdTime: e.created?.time, time: e.time, id: e._id, address: e.address, user: e.user }}
|
||||
key={i}
|
||||
/>
|
||||
);
|
||||
@@ -102,7 +102,17 @@ export const Home = () => {
|
||||
elements: events.sort(sortingFn(pos)).map((e, i) => {
|
||||
return (
|
||||
<EventPreview
|
||||
data={{ name: e.name, type: e.type, lon: e.lon, lat: e.lat, createdTime: e.created?.time, time: e.time, id: e._id, address: e.address }}
|
||||
data={{
|
||||
name: e.name,
|
||||
type: e.type,
|
||||
lon: e.lon,
|
||||
lat: e.lat,
|
||||
createdTime: e.created?.time,
|
||||
time: e.time,
|
||||
id: e._id,
|
||||
address: e.address,
|
||||
user: e.user,
|
||||
}}
|
||||
key={i}
|
||||
/>
|
||||
);
|
||||
@@ -115,7 +125,7 @@ export const Home = () => {
|
||||
elements: events.sort(sortingFn(pos, e.target.value)).map((e, i) => {
|
||||
return (
|
||||
<EventPreview
|
||||
data={{ name: e.name, type: e.type, lon: e.lon, lat: e.lat, createdTime: e.created?.time, time: e.time, id: e._id, address: e.address }}
|
||||
data={{ name: e.name, type: e.type, lon: e.lon, lat: e.lat, createdTime: e.created?.time, time: e.time, id: e._id, address: e.address, user: e.user }}
|
||||
key={i}
|
||||
/>
|
||||
);
|
||||
@@ -130,7 +140,17 @@ export const Home = () => {
|
||||
elements: events.sort(sortingFn(pos)).map((e, i) => {
|
||||
return (
|
||||
<EventPreview
|
||||
data={{ name: e.name, type: e.type, lon: e.lon, lat: e.lat, createdTime: e.created?.time, time: e.time, id: e._id, address: e.address }}
|
||||
data={{
|
||||
name: e.name,
|
||||
type: e.type,
|
||||
lon: e.lon,
|
||||
lat: e.lat,
|
||||
createdTime: e.created?.time,
|
||||
time: e.time,
|
||||
id: e._id,
|
||||
address: e.address,
|
||||
user: e.user,
|
||||
}}
|
||||
key={i}
|
||||
/>
|
||||
);
|
||||
@@ -142,7 +162,7 @@ export const Home = () => {
|
||||
elements: events.sort(sortingFn(null)).map((e, i) => {
|
||||
return (
|
||||
<EventPreview
|
||||
data={{ name: e.name, type: e.type, lon: e.lon, lat: e.lat, createdTime: e.created?.time, time: e.time, id: e._id, address: e.address }}
|
||||
data={{ name: e.name, type: e.type, lon: e.lon, lat: e.lat, createdTime: e.created?.time, time: e.time, id: e._id, address: e.address, user: e.user }}
|
||||
key={i}
|
||||
/>
|
||||
);
|
||||
@@ -167,6 +187,7 @@ export const Home = () => {
|
||||
<option value="distance:descending">Najdalej</option>
|
||||
</select>
|
||||
<button
|
||||
aria-label="Utwórz wydarzenie"
|
||||
ref={createEventButton}
|
||||
onClick={() => {
|
||||
history.push("/create");
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
// import styles from './index.module.scss';
|
||||
|
||||
export const Users = () => {
|
||||
return <h2>Users</h2>;
|
||||
};
|
||||
Whitespace-only changes.
Reference in new issue
Block a user