show profile user in header
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import * as api from "../service/ProfileService";
|
||||
|
||||
export const useGetProfile = () => {
|
||||
return useQuery({
|
||||
queryKey: ["profile"],
|
||||
queryFn: api.getProfile,
|
||||
retry: false,
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,7 @@
|
||||
import { api } from "@/config/axios";
|
||||
import { GetProfileResponse } from "../types/Types";
|
||||
|
||||
export const getProfile = async (): Promise<GetProfileResponse> => {
|
||||
const { data } = await api.get<GetProfileResponse>("/public/user/me");
|
||||
return data;
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
export interface UserProfile {
|
||||
id: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
deletedAt: string | null;
|
||||
restaurant: string;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
phone: string;
|
||||
birthDate: string;
|
||||
marriageDate: string;
|
||||
referrer: string | null;
|
||||
isActive: boolean;
|
||||
gender: boolean;
|
||||
wallet: number;
|
||||
points: number;
|
||||
}
|
||||
|
||||
export interface GetProfileResponse {
|
||||
statusCode: number;
|
||||
success: boolean;
|
||||
data: UserProfile;
|
||||
}
|
||||
+11
-13
@@ -9,7 +9,6 @@
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
|
||||
html,
|
||||
body {
|
||||
@apply h-full bg-background font-irancell font-normal text-foreground;
|
||||
@@ -109,9 +108,10 @@ input:autofill {
|
||||
transition: background-color 10000s ease-in-out 0s;
|
||||
}
|
||||
|
||||
|
||||
.box-shadow-normal {
|
||||
box-shadow: 0px 2px 16px 0px #00000014;
|
||||
height: fit-content;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
.gradient-border {
|
||||
@@ -128,16 +128,14 @@ input:autofill {
|
||||
/* border thickness */
|
||||
border-radius: inherit;
|
||||
/* inherit border-radius from parent */
|
||||
background: linear-gradient(to bottom right,
|
||||
var(--container) 6.25%,
|
||||
rgba(255, 253, 253, 0) 52.01%,
|
||||
var(--container) 96.87%);
|
||||
mask:
|
||||
linear-gradient(#fff 0 0) content-box,
|
||||
linear-gradient(#fff 0 0);
|
||||
-webkit-mask:
|
||||
linear-gradient(#fff 0 0) content-box,
|
||||
linear-gradient(#fff 0 0);
|
||||
background: linear-gradient(
|
||||
to bottom right,
|
||||
var(--container) 6.25%,
|
||||
rgba(255, 253, 253, 0) 52.01%,
|
||||
var(--container) 96.87%
|
||||
);
|
||||
mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
||||
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
||||
-webkit-mask-composite: xor;
|
||||
mask-composite: exclude;
|
||||
pointer-events: none;
|
||||
@@ -361,4 +359,4 @@ html[data-theme="dark"] {
|
||||
body {
|
||||
@apply bg-background text-foreground;
|
||||
}
|
||||
} */
|
||||
} */
|
||||
|
||||
Reference in New Issue
Block a user