Skip to content

Commit

Permalink
rebase and fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MiaPass committed Oct 7, 2024
1 parent 992fe24 commit c17b13e
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 28 deletions.
11 changes: 11 additions & 0 deletions messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,17 @@
"s_passwordMinCharacters": "Password must be at least 8 characters",
"s_passwordsMatch": "Passwords must match"
},
"Profile": {
"title": "Account Information",
"description": "Saved during Registration",
"home": "Home",
"Dashboard": "Dashboard",
"Profile": "Profile",
"p_name": "Name",
"p_lastname": "Lastname",
"p_email": "Email",
"p_phone": "Phone"
},
"RecoveryCode": {
"title": "Enter your code",
"description": "Enter the 5 digit code sent to the email provided. If you can't find it, check your spam folder.",
Expand Down
38 changes: 38 additions & 0 deletions messages/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,44 @@
"s_passwordMinCharacters": "La contraseña debe tener al menos 8 caracteres",
"s_passwordsMatch": "Las contraseñas deben coincidir"
},
"Setting": {
"title": "Configuración de Cuenta",
"description": "Personaliza tu cuenta según tus preferencias y necesidades.",
"home": "Inicio",
"Dashboard": "Panel de Control",
"Setting": "Configuración",
"s_changePassword": "Cambiar contraseña",
"s_changePasswordTitle": "Cambie su contraseña",
"s_deleteAccount": "Eliminar Cuenta",
"s_deleteAccount-title": "¿Desea eliminar su cuenta?",
"s_deleteAccount-modal": "¿Estás segura de que quieres eliminar esta cuenta?",
"s_deleteAccount-accept": "Aceptar",
"s_deleteAccount-cancel": "Cancelar",
"s_deleteAccount-confirm": "Confirmar",
"s_notificationSettings": "Configuración de Notificaciones",
"s_notificationSettings-title": "Configuración de Notificaciones",
"s_notificationSettings-modal": "Hay cambios sin guardar, desea continuar?",
"s_notificationSettings-continue": "Continuar",
"s_notificationSettings-cancel": "Cancelar",
"s_notificationSettings-button": "Guardar Cambios",
"s_notificationSettings-labelSwitch": "Notificación",
"s_passwordRequired": "*La contraseña es un campo requerido",
"s_passwordNewRequired": "*La nueva contraseña es un campo requerido",
"s_passwordConfirmNewRequired": "*Confirmar nueva contraseña es un campo requerido",
"s_passwordMinCharacters": "La contraseña debe tener al menos 8 caracteres",
"s_passwordsMatch": "Las contraseñas deben coincidir"
},
"Profile": {
"title": "Información de Cuenta",
"description": "Guardada durante el Registro",
"home": "Inicio",
"Dashboard": "Panel de Control",
"Profile": "Perfil",
"p_name": "Nombre",
"p_lastname": "Apellido",
"p_email": "Correo electrónico",
"p_phone": "Teléfono"
},
"RecoveryCode": {
"title": "Ingresa tu código",
"description": "Ingresa el código de 5 dígitos enviado al email proporcionado.\nSi no lo encuentras revisa tu bandeja de spam.",
Expand Down
2 changes: 0 additions & 2 deletions src/features/navbar/constants/dataNav.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { icons } from '@/features/shared/hooks/icons';
import { images } from '@/features/shared/hooks/images';
import { IoPersonOutline } from "react-icons/io5";



const { HomeIcon, ItemsIcon, CloseIcon, IconUser, IconSettings, IconLogOut, IconDropdown } = icons();
Expand Down
20 changes: 7 additions & 13 deletions src/features/navbar/molecules/dropdown/DropdownUser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { useSearchParams } from 'next/navigation';
import { IoPersonOutline } from 'react-icons/io5';
import { IoSettingsOutline } from 'react-icons/io5';
import { AccordionComponent } from '@/features/shared/atoms/accordion/accordion';
import { getUser } from '@/features/profile/actions/ProfileAction';

type Props = {
dataPerfil: {
Expand All @@ -34,17 +35,10 @@ type Props = {
isUserDropdownOpen: boolean;
handleDropdownUser: () => void;
id?:string;
user?: {
phone: string | null;
email: string | null;
last_name: string | null;
first_name: string | null;
id: string;
image_id: string | null;
};
}

export const DropdownUser = (props: Props) => {
export const DropdownUser = async(props: Props) => {
const user = await getUser();
const background = props.isUserDropdownOpen ? 'animation' : '';
const rotate = props.isUserDropdownOpen ? style.rotate : '';
const t = useTranslations('NavigationUser');
Expand All @@ -68,8 +62,8 @@ export const DropdownUser = (props: Props) => {
<div className={style.container}>
<div className={style.containerIconUser}>
<button onClick={props.handleDropdownUser} className={`${style.iconUser} ${background}`}>
<Image src={props.user?.image_id ?? props.dataUser.image} alt={'Icon user'} height={1080} width={1080}/>
<Image className={`${style.dropdown} ${rotate}`} width={82} height={82} src={props.user?.image_id ?? props.dataUser.icon} alt={'dropdown'}/>
<Image src={user?.image_id ?? props.dataUser.image} alt={'Icon user'} height={1080} width={1080}/>
<Image className={`${style.dropdown} ${rotate}`} width={82} height={82} src={user?.image_id ?? props.dataUser.icon} alt={'dropdown'}/>
</button>
</div>
<motion.ul
Expand All @@ -80,9 +74,9 @@ export const DropdownUser = (props: Props) => {
>
<div className={style.perfil}>
<div className={style.containerIconUserOpen}>
<Image className={style.profileImage} src={props.user?.image_id ?? props.dataUser.image}
<Image className={style.profileImage} src={user?.image_id ?? props.dataUser.image}
alt={'Icon user'} width={82} height={82}/>
<p>{props.user?.first_name ?? props.dataUser.username}</p>
<p>{user?.first_name ?? props.dataUser.username}</p>
</div>
{
props.dataPerfil.map(({ description, path }) =>
Expand Down
9 changes: 0 additions & 9 deletions src/features/navbar/organisms/NavbarTop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@ import { DropdownUser } from '@/features/navbar/molecules/dropdown/DropdownUser'

type Props = {
isPublic: boolean;
user?: {
phone: string | null;
email: string | null;
last_name: string | null;
first_name: string | null;
id: string;
image_id: string | null;
};
}

export const NavbarTop = (props: Props) => {
Expand Down Expand Up @@ -49,7 +41,6 @@ export const NavbarTop = (props: Props) => {
handleDropdownLang={handleDropdownLang}
/>
<DropdownUser dataPerfil={dataPerfil}
user={props.user}
style={style} dataUser={dataUser}
dataLogin={dataLogin}
isUserDropdownOpen={isUserDropdownOpen}
Expand Down
4 changes: 1 addition & 3 deletions src/features/navbar/template/NavbarTopTemplate.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import React from 'react';
import { NavbarTop } from '@/features/navbar/organisms/NavbarTop';
import { getUser } from '@/features/profile/actions/ProfileAction';

type Props = {
isPublic: boolean;
}

export const NavbarTopTemplate = async(props: Props) => {
const user = await getUser();
return (
<NavbarTop isPublic={props.isPublic} user={user} />
<NavbarTop isPublic={props.isPublic} />
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ interface Props {
}

export const InputDynamic = (props: Props) => {
export const InputDynamic = (props: Props): JSX.Element => {
switch (props.keySelected.filter) {
case EnumFilterApply.Single:
return <InputSearchSimple {...props}/>;
Expand Down

0 comments on commit c17b13e

Please sign in to comment.