feat(WEB-170): edit profile view
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
export type IconProps = {
|
||||
height?: number
|
||||
width?: number
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
import type { EditProfileSchema } from "@/components/MyProfile/Profile/Edit/Form/schema"
|
||||
import type { Control } from "react-hook-form"
|
||||
import type { User } from "@/types/user"
|
||||
|
||||
export type EditFormProps = {
|
||||
user: User
|
||||
}
|
||||
|
||||
export type EditFormContentProps = {
|
||||
control: Control<EditProfileSchema>
|
||||
}
|
||||
|
||||
type E = {
|
||||
message: string
|
||||
path: string
|
||||
}
|
||||
|
||||
export const enum Status {
|
||||
error = "error",
|
||||
success = "success",
|
||||
}
|
||||
|
||||
type ErrorState = {
|
||||
errors?: E[]
|
||||
message: string
|
||||
status: Status.error
|
||||
}
|
||||
|
||||
type SuccessState = {
|
||||
message: string
|
||||
status: Status.success
|
||||
}
|
||||
|
||||
export type State = ErrorState | SuccessState | null
|
||||
@@ -0,0 +1,10 @@
|
||||
export type ProfileLayoutProps = {
|
||||
communication: React.ReactNode
|
||||
creditCards: React.ReactNode
|
||||
edit: React.ReactNode
|
||||
membershipCard: React.ReactNode
|
||||
password: React.ReactNode
|
||||
profile: React.ReactNode
|
||||
view: React.ReactNode
|
||||
wishes: React.ReactNode
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { Lang } from "@/constants/languages"
|
||||
import type { AllRequestResponse } from "../utils/all"
|
||||
import { Edges } from "../utils/edges"
|
||||
import { Typename } from "../utils/typename"
|
||||
import type { Edges } from "../utils/edges"
|
||||
import type { TypenameInterface } from "../utils/typename"
|
||||
|
||||
export enum PageLinkEnum {
|
||||
AccountPage = "AccountPage",
|
||||
@@ -9,43 +10,44 @@ export enum PageLinkEnum {
|
||||
}
|
||||
|
||||
export type MenuItem = {
|
||||
uid: string
|
||||
lang: Lang
|
||||
linkText: string
|
||||
subItems: MenuItem[] | null
|
||||
uid: string
|
||||
url: string
|
||||
}
|
||||
|
||||
export type SidebarProps = { menuItems: MenuItem[] }
|
||||
export type SidebarProps = {
|
||||
lang: Lang
|
||||
}
|
||||
|
||||
export type AccountPageLink = Typename<
|
||||
{
|
||||
interface NavigationLink {
|
||||
system: {
|
||||
locale: Lang
|
||||
uid: string
|
||||
title: string
|
||||
}
|
||||
title: string
|
||||
}
|
||||
|
||||
export interface AccountPageLink
|
||||
extends NavigationLink,
|
||||
TypenameInterface<PageLinkEnum.AccountPage> {
|
||||
url: string
|
||||
}
|
||||
|
||||
export interface LoyaltyPageLink
|
||||
extends NavigationLink,
|
||||
TypenameInterface<PageLinkEnum.LoyaltyPage> {
|
||||
url: string
|
||||
}
|
||||
|
||||
export interface ContentPageLink
|
||||
extends NavigationLink,
|
||||
TypenameInterface<PageLinkEnum.ContentPage> {
|
||||
web: {
|
||||
url: string
|
||||
system: { uid: string }
|
||||
},
|
||||
PageLinkEnum.AccountPage
|
||||
>
|
||||
|
||||
export type LoyaltyPageLink = Typename<
|
||||
{
|
||||
uid: string
|
||||
title: string
|
||||
url: string
|
||||
system: { uid: string }
|
||||
},
|
||||
PageLinkEnum.LoyaltyPage
|
||||
>
|
||||
|
||||
export type ContentPageLink = Typename<
|
||||
{
|
||||
uid: string
|
||||
title: string
|
||||
web: { url: string }
|
||||
system: { uid: string }
|
||||
},
|
||||
PageLinkEnum.ContentPage
|
||||
>
|
||||
}
|
||||
}
|
||||
|
||||
export type PageLink = ContentPageLink | AccountPageLink | LoyaltyPageLink
|
||||
|
||||
|
||||
@@ -16,3 +16,7 @@ export type BlocksTypename = keyof typeof BlocksTypenameEnum
|
||||
export type Typename<T, K> = T & {
|
||||
__typename: K
|
||||
}
|
||||
|
||||
export interface TypenameInterface<K> {
|
||||
__typename: K
|
||||
}
|
||||
|
||||
@@ -25,7 +25,11 @@ type Victory = {
|
||||
}
|
||||
|
||||
export interface User extends z.infer<typeof getUserSchema> {
|
||||
country: string
|
||||
dob: string
|
||||
firstname: string
|
||||
journeys: Journey[]
|
||||
lastname: string
|
||||
membershipId: number
|
||||
nights: number
|
||||
points: number
|
||||
|
||||
Reference in New Issue
Block a user