Skip to content

Commit

Permalink
change: ProfileClass on ProfileSettings
Browse files Browse the repository at this point in the history
  • Loading branch information
NiiMiyo committed Dec 2, 2023
1 parent 54794dc commit 451b7b3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/pages/Profile/ProfileSettings/ProfileSettings.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { ChangeEvent, MouseEvent, useContext, useMemo, useState } from 'react';
import { ProfileContext } from '@/pages/Profile';
import { Link, TypeLink, TypeLinkToBootstrapIcon, TypeLinkToLabel } from '@/types/Link';
import { getFullName, separateFullName } from '@/utils/profileUtils';
import { GENDER_OPTIONS } from "@/types/Profile";
import { GENDER_OPTIONS, ProfileClass } from "@/types/Profile";
import { UniversimeApi } from '@/services/UniversimeApi';
import './ProfileSettings.css'

Expand Down Expand Up @@ -32,7 +31,7 @@ export function ProfileSettings(props: ProfileSettingsProps) {
<form action="" className="settings-form">
<div className="section name">
<h2>Nome</h2>
<input id="name" type="text" placeholder='Insira seu nome e sobrenome' defaultValue={getFullName(profileContext.profile)} />
<input id="name" type="text" placeholder='Insira seu nome e sobrenome' defaultValue={profileContext.profile.fullname ?? undefined} />
</div>

<div className="section biography">
Expand Down Expand Up @@ -184,7 +183,7 @@ export function ProfileSettings(props: ProfileSettingsProps) {
? (genderElement as HTMLSelectElement).value
: '';

const [name, lastname] = separateFullName(fullname);
const [name, lastname] = ProfileClass.separateFullname(fullname);

UniversimeApi.Profile.edit({
profileId: profileContext.profile.id,
Expand Down

0 comments on commit 451b7b3

Please sign in to comment.