Moved frontend to separate folder, added basic user context and user page

This commit is contained in:
2020-11-28 20:01:35 +05:00
parent da8a37dfbd
commit 452518f898
27 changed files with 382 additions and 50 deletions

16
front/types/main.ts Normal file
View File

@ -0,0 +1,16 @@
type RouteT = {
id: number;
name: string;
length: number;
averageTime?: number;
userTime?: number;
startCoordinates?: CoordinatesT;
coordinates?: CoordinatesT[];
};
type CoordinatesT = {
latitude: number;
longitude: number;
};
export type { RouteT, CoordinatesT };

16
front/types/user.ts Normal file
View File

@ -0,0 +1,16 @@
import { RouteT } from "./main";
interface IHeaderProps {
points: number;
}
interface IRouteView {
header: string;
routes: RouteT[];
}
interface IRouteCard {
route: RouteT;
}
export type { IHeaderProps, IRouteView, IRouteCard };

View File

@ -0,0 +1,13 @@
import { Dispatch, SetStateAction } from "react";
export type UserT = {
username: string;
email: string;
id: number;
points: number;
};
export type UserContextT = {
userState: UserT;
setUserState: Dispatch<SetStateAction<UserT>>;
};