Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/update user profile #392

Merged
merged 7 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions client/app/[locale]/auth/sign-in/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@ import { getI18n } from "@/utils/services/internationalization/server"

import { siteConfig } from "@/config/site"
import CommonPageLayout from "@/components/layouts/common"
import NotAuthOnlyWrapper from "@/components/wrappers/not-auth-only/not-auth-only"

export const metadata = siteConfig.page.signIn.metadata

const SignInPage = async () => {
const t = await getI18n()
return (
<CommonPageLayout title={t("page.sign_in")}>
<SignInPageTemplate />
</CommonPageLayout>
<NotAuthOnlyWrapper>
<CommonPageLayout title={t("page.sign_in")} titlePosition="middle">
<SignInPageTemplate />
</CommonPageLayout>
</NotAuthOnlyWrapper>
)
}
export default SignInPage
9 changes: 6 additions & 3 deletions client/app/[locale]/auth/sign-up/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@ import { getI18n } from "@/utils/services/internationalization/server"

import { siteConfig } from "@/config/site"
import CommonPageLayout from "@/components/layouts/common"
import NotAuthOnlyWrapper from "@/components/wrappers/not-auth-only/not-auth-only"

export const metadata = siteConfig.page.signUp.metadata

const SignUpPage = async () => {
const t = await getI18n()
return (
<CommonPageLayout title={t("page.sign_up")}>
<SignUpPageTemplate />
</CommonPageLayout>
<NotAuthOnlyWrapper>
<CommonPageLayout title={t("page.sign_up")} titlePosition="middle">
<SignUpPageTemplate />
</CommonPageLayout>
</NotAuthOnlyWrapper>
)
}

Expand Down
2 changes: 1 addition & 1 deletion client/app/[locale]/profile/edit/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const EditProfilePage = async () => {
const t = await getI18n()
return (
<AuthenticatedPageWrapper>
<CommonPageLayout title={t("page.edit_profile")} titlePosition="middle">
<CommonPageLayout title={t("page.edit_profile")}>
<EditProfileTemplate
cityList={cityList}
countryList={countryList}
Expand Down
3 changes: 2 additions & 1 deletion client/components/customized-ui/avatars/base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ interface IBaseAvatar {
url?: string
alt: string | null
fallBack: string | null
size?: "large" | "medium"
size?: "large" | "medium" | "veryLarge"
className?: string
}
const BaseAvatar: React.FunctionComponent<IBaseAvatar> = ({
Expand All @@ -23,6 +23,7 @@ const BaseAvatar: React.FunctionComponent<IBaseAvatar> = ({
size === "large" && "h-24 w-24 text-2xl",

size === "medium" && "h-12 w-12 text-2xl",
size === "veryLarge" && "h-44 w-44 text-3xl",
className
)}
>
Expand Down
13 changes: 13 additions & 0 deletions client/components/customized-ui/badges/referee/referee.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from "react"
import { useI18n } from "@/utils/services/internationalization/client"

const RefereeBadge = () => {
const t = useI18n()
return (
<div className="py flex items-center justify-center rounded-lg bg-teal-400 px-3 text-white">
{t("user.type.referee")}
</div>
)
}

export default RefereeBadge
13 changes: 13 additions & 0 deletions client/components/customized-ui/badges/referrer/referrer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from "react"
import { useI18n } from "@/utils/services/internationalization/client"

const ReferrerBadge = () => {
const t = useI18n()
return (
<div className="py flex shrink-0 items-center justify-center rounded-lg bg-orange-400 px-3 text-white">
{t("user.type.referrer")}
</div>
)
}

export default ReferrerBadge
4 changes: 1 addition & 3 deletions client/components/customized-ui/bars/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,7 @@ const SearchBar: React.FunctionComponent<ISearchSearchBarProps> = ({
<div
className={cn(
"flex w-full flex-row md:mt-4",
bottomLeftSection
? "justify-center md:justify-between "
: "justify-end"
bottomLeftSection ? "justify-between " : "justify-end"
)}
>
{bottomLeftSection}
Expand Down
12 changes: 9 additions & 3 deletions client/components/customized-ui/buttons/contact.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useI18n } from "@/utils/services/internationalization/client"

import { EMessageType } from "@/types/common/message-type"
import { EReferralType } from "@/types/common/referral-type"
import { cn } from "@/lib/utils"
import useUserStore from "@/hooks/state/user/store"
import { Button } from "@/components/ui/button"
import { Icons } from "@/components/icons"
Expand All @@ -15,13 +16,17 @@ interface IContactButtonProps {
messageType: EMessageType
postUuid?: string | null
receiverType?: EReferralType
buttonClassName?: string
showIcon?: boolean
}
const ContactButton: React.FunctionComponent<IContactButtonProps> = ({
username,
toUuid,
messageType,
postUuid,
receiverType,
buttonClassName,
showIcon = false,
}) => {
const t = useI18n()
const [isContactFormOpen, setIsContactFormOpen] = useState(false)
Expand All @@ -39,11 +44,12 @@ const ContactButton: React.FunctionComponent<IContactButtonProps> = ({
return (
<>
<Button
className="flex w-full flex-row gap-1"
variant={"theme"}
className={cn("flex w-full flex-row gap-1", buttonClassName)}
onClick={handleContactClick}
>
<Icons.mail className="mr-1 h-4 w-4" />
<p> {t("general.contact")}</p>
{showIcon && <Icons.coffee size={16} />}
<p>Coffee Chat</p>
</Button>

<ContactDialog
Expand Down
172 changes: 0 additions & 172 deletions client/components/customized-ui/cards/referral.tsx

This file was deleted.

11 changes: 10 additions & 1 deletion client/components/customized-ui/footer/nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,16 @@ import { Icons } from "@/components/icons"
const NavFooter = () => {
const t = useI18n()
const pathname = usePathname()
const noShowFooter = pathname.includes(siteConfig.page.chat.href)

const hideFooterPageList = [
siteConfig.page.chat.href,
siteConfig.page.profile.href,
siteConfig.page.editProfile.href,
]

const noShowFooter = hideFooterPageList.some((path) =>
pathname.includes(path)
)
return (
<footer
className={cn(
Expand Down
12 changes: 10 additions & 2 deletions client/components/customized-ui/form/check-box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@ interface ICheckBoxProps {
name: string
label: string
description?: string
checkBoxClassName?: string
labelClassName?: string
}

const FormCheckBox: React.FunctionComponent<ICheckBoxProps> = ({
control,
name,
label,
description,
checkBoxClassName,
labelClassName,
}) => {
return (
<FormField
Expand All @@ -31,10 +35,14 @@ const FormCheckBox: React.FunctionComponent<ICheckBoxProps> = ({
render={({ field }) => (
<FormItem className="flex flex-row items-start space-x-3 space-y-0 rounded-md border p-4 shadow">
<FormControl>
<Checkbox checked={field.value} onCheckedChange={field.onChange} />
<Checkbox
checked={field.value}
onCheckedChange={field.onChange}
className={checkBoxClassName}
/>
</FormControl>
<div className="space-y-1 leading-none">
<FormLabel>{label}</FormLabel>
<FormLabel className={labelClassName}>{label}</FormLabel>
{description && <FormDescription>{description}</FormDescription>}
</div>
<FormMessage />
Expand Down
3 changes: 2 additions & 1 deletion client/components/customized-ui/form/select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ import {
SelectValue,
} from "@/components/ui/select"
import { IFormTextInputProps } from "@/components/customized-ui/form/input"
import { ISelectOption } from "@/components/customized-ui/selects/base"

interface IFormSelectProps extends IFormTextInputProps {
options: { value: string; label: string }[]
options: ISelectOption[]
defaultValue?: string
isDisabled?: boolean
triggerClassName?: string
Expand Down
Loading