Skip to content

Commit

Permalink
feat: profile
Browse files Browse the repository at this point in the history
  • Loading branch information
ttiimmothy committed Dec 3, 2023
1 parent 56268be commit a609503
Show file tree
Hide file tree
Showing 11 changed files with 4,273 additions and 21 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"Nsenph",
"Openrice",
"paymentmethod",
"primevue",
"reduxjs",
"supabase",
"tailwindcss"
Expand Down
8 changes: 4 additions & 4 deletions public/error.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
4,204 changes: 4,204 additions & 0 deletions src/assets/error.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions src/assets/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import RestaurantImage from "./restaurant_empty.jpg";
import PrimeVue from "./primevue.svg";
import Error from "./error.svg";

// export { RestaurantImage, Error };
export { RestaurantImage, PrimeVue, Error };
28 changes: 28 additions & 0 deletions src/assets/primevue.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/restaurant_empty.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions src/image.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
declare module "*.jpg" {
const value: any;
export = value;
}

declare module "*.png" {
const value: any;
export = value;
}

declare module "*.svg" {
const value: any;
export = value;
}
15 changes: 8 additions & 7 deletions src/pages/ProfilePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ import { createRestaurantOwnerThunk } from "../redux/restaurantOwner/restaurantO
import { createRestaurantDishThunk } from "../redux/restaurantDish/restaurantDishSlice";
import { fileTypeToExtension } from "../utils/fileTypeToExtension";
import { uploadImage } from "../utils/uploadImageService";
import { PrimeVue } from "../assets/index";
import TextareaInput from "../components/utils/inputs/TextareaInput";
import TextInput from "../components/utils/inputs/TextInput";
import SelectInput from "../components/utils/inputs/SelectInput";
import NumberInput from "../components/utils/inputs/NumberInput";
import FileInput from "../components/utils/inputs/FileInput";
import ErrorPage from "./error/ErrorPage";

import "react-datepicker/dist/react-datepicker.css";

Expand Down Expand Up @@ -200,7 +200,7 @@ const ProfilePage: React.FC = () => {
}
};

return user?.role === "Admin" ? (
return (
<form
className="flex flex-col gap-3 px-6 w-120 mx-auto"
onSubmit={handleSubmit((restaurant) => {
Expand All @@ -215,9 +215,12 @@ const ProfilePage: React.FC = () => {
}
})}
>
<p className="col-span-2 text-center text-3xl font-bold">
Create new restaurant
</p>
<div className="w-full flex justify-center">
<div className="w-40 h-40 rounded-full bg-blue-400 flex items-center justify-center border-1 border-gray-700">
<img className="" src={PrimeVue} />
</div>
</div>

<Controller
name="name"
control={control}
Expand Down Expand Up @@ -449,8 +452,6 @@ const ProfilePage: React.FC = () => {
</button>
</div>
</form>
) : (
<ErrorPage />
);
};

Expand Down
17 changes: 7 additions & 10 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
Expand All @@ -14,13 +10,14 @@
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx"
"jsx": "preserve",
"incremental": true,
"paths": { "@/*": ["./src/*"] }
},
"include": [
"src"
]
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
}

0 comments on commit a609503

Please sign in to comment.