Skip to content

Commit

Permalink
Merge pull request #203 from bsideproject/feature/user
Browse files Browse the repository at this point in the history
[fix] eslint 오류 수정!!
  • Loading branch information
KinDDoGGang authored Oct 27, 2023
2 parents 3edb60a + 1c3af09 commit d758ebd
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 13 deletions.
2 changes: 0 additions & 2 deletions pages/404.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
/* eslint-disable react/no-unstable-nested-components */
import React from 'react';
import ErrorPage from '@/public/icons/errorPageImage.svg';
import { useRouter } from 'next/router';

export default function NoPostings() {
const router = useRouter();
const noPostingStyle = 'text-[20px] font-bold mt-[29px] text-center';
const containerStyle = 'flex flex-col items-center justify-start mt-[135px]'; // 'justify-start'로 변경

Expand Down
2 changes: 1 addition & 1 deletion pages/room/addRoom/step1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default function Step1() {
// 선택된 value와 label 값을 이용하여 원하는 작업 수행
setDongValue({ ...option, gu: guValue.value, guLabel: guValue.label });
},
[guValue?.label, guValue?.value]
[guValue?.label, guValue?.value],
);

const handleGuChange = useCallback((option: Option) => {
Expand Down
1 change: 1 addition & 0 deletions pages/room/addRoom/step3.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-shadow */
import React, { useState } from 'react';
import { ImageListType } from 'react-images-uploading';
import ModalBox from '@/components/Modal/ModalBox.tsx';
Expand Down
18 changes: 9 additions & 9 deletions pages/userInfo/editProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@
/* eslint-disable jsx-a11y/alt-text */
/* eslint-disable react/no-unstable-nested-components */
/* eslint-disable react/style-prop-object */
import React, { useState, useEffect } from 'react';
import React, { useState } from 'react';
import { FieldValues, SubmitHandler, FieldError, useForm as UseForm } from 'react-hook-form';
import useModal from '@/hooks/useModal.ts';
import { isValidEmail, isRequired } from '@/utils/validCheck.ts';
import { Textarea, Button, Upload, Input, Calendar } from '@/components/index.tsx';
import ProfileCamera from '@/public/icons/profileCamera.svg';
import { User, Profile } from '@/public/types/user';
import { modifyProfile } from '@/api/userInfo';
import isEmpty from 'lodash-es/isEmpty';

interface ProfileProps {
_imageSrc: string;
userInfo: User
userInfo: User;
}

interface ImageComponentClickProps {
Expand All @@ -33,10 +32,9 @@ export default function EditProfile({ _imageSrc, userInfo }: ProfileProps) {
handleSubmit,
formState: { errors },
} = UseForm({ mode: 'onChange' });

const capitalizeFirstLetter = (str: string) => {
return (str || '').charAt(0).toUpperCase() + (str || '').slice(1).toLowerCase();
}
};

const [buttonState, setButtonState] = useState(capitalizeFirstLetter(userInfo?.gender));

Expand All @@ -45,9 +43,7 @@ export default function EditProfile({ _imageSrc, userInfo }: ProfileProps) {
const profileData = data as Profile;
profileData.profileId = userInfo.id || 0;
const result = await modifyProfile(profileData);
console.log("result in editprofile", result);
alert('수정되었습니다');

// openModal({
// props: {
// title: 'My Postings',
Expand Down Expand Up @@ -110,7 +106,6 @@ export default function EditProfile({ _imageSrc, userInfo }: ProfileProps) {
</div>
);
};

return (
<form onSubmit={handleSubmit(onSubmit)}>
<div className="h-screen overflow-y-scroll font-pretendard">
Expand Down Expand Up @@ -188,7 +183,12 @@ export default function EditProfile({ _imageSrc, userInfo }: ProfileProps) {
<div className={subHeader}>Date of birth</div>
</div>
<section className="mb-[8px]">
<Calendar placeholder="MM-DD-YYYY" type="text" register={register('dateOfBirth')} value={userInfo?.birthDate}/>
<Calendar
placeholder="MM-DD-YYYY"
type="text"
register={register('dateOfBirth')}
value={userInfo?.birthDate}
/>
</section>
<div className="mb-[12px] mt-[32px]">
<div className={subHeader}>About you</div>
Expand Down
8 changes: 7 additions & 1 deletion pages/userInfo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ export default function UserProfile({ imgSrc }: UserProfileProps) {
const age = formatAge(userInfo.birthDate);
return (
<>
<ProfileCard age={age} name={userInfo.firstName} gender={userInfo.gender} imageSrc={userInfo.image || imgSrc} userInfo={userInfo} />
<ProfileCard
age={age}
name={userInfo.firstName}
gender={userInfo.gender}
imageSrc={userInfo.image || imgSrc}
userInfo={userInfo}
/>
<div className="mt-[83px] fixed bottom-[-15px] w-full overflow-x-hidden left-[50%] translate-x-[-50%] px-[20px] max-w-max border-t-[1px] border-g2">
<div className="w-full">
<div className="mb-[13px] space-x-[8px] max-w-max">
Expand Down

0 comments on commit d758ebd

Please sign in to comment.