Moved frontend to separate folder, added basic user context and user page
This commit is contained in:
16
front/types/main.ts
Normal file
16
front/types/main.ts
Normal 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
16
front/types/user.ts
Normal 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 };
|
13
front/types/userContext.ts
Normal file
13
front/types/userContext.ts
Normal 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>>;
|
||||
};
|
Reference in New Issue
Block a user