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

마이 페이지 입력값 글자 수 제한 수정 #142

Merged
merged 4 commits into from
Jan 29, 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
2 changes: 1 addition & 1 deletion src/app/mypage/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface LayoutProps {
export default function Layout({ children }: LayoutProps) {
const router = useRouter();

const handleClickSettingButton = () => router.push('/setting');
const handleClickSettingButton = () => router.push('/settings');

return (
<main className='bg-[url("/assets/image/mypage/background.png")] bg-cover w-full max-w-[480px] h-[100dvh]'>
Expand Down
11 changes: 7 additions & 4 deletions src/app/mypage/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { useGetUserProfile } from '@hooks/api/useGetUserProfile';
import { usePutUserName } from '@hooks/api/usePutUserName';
import MyLogContent from '@components/mypage/MyLogContent';
import BookMarkContent from '@components/mypage/BookMarkContent';
import useInput from '@hooks/useInput';

export default function Page() {
const [isInputActive, setIsInputActive] = useState(false);
Expand All @@ -31,7 +30,11 @@ export default function Page() {
const userLevel = userProfile?.level || DEFAULT_DDOBAP_LEVEL;
const StatusImage = DDOBAP_LEVEL_IMAGE[userLevel];

const [nickName, , setNickName] = useInput(userProfile?.nickname ?? '');
const [nickName, setNickName] = useState(userProfile?.nickname);

useEffect(() => {
setNickName(userProfile?.nickname);
}, [userProfile?.nickname]);
sjoleee marked this conversation as resolved.
Show resolved Hide resolved

useEffect(() => {
let timer: NodeJS.Timeout;
Expand All @@ -57,7 +60,7 @@ export default function Page() {

const handleInputBlur = () => {
setIsInputActive(false);
if (!nickName.trim().length) setNickName(userProfile?.nickname || '');
if (!nickName?.trim().length) setNickName(userProfile?.nickname || '');
else putUserName(nickName || '');
};

Expand All @@ -78,7 +81,7 @@ export default function Page() {
<input
ref={handleInputRefCallback}
type="text"
defaultValue={userProfile?.nickname}
value={nickName}
onChange={handleInputValue}
onBlur={handleInputBlur}
className={`w-[170px] h-[29px] bg-transparent text-white header-22 outline-none border-b-[1px] border-b-transparent focus:outline-none focus:border-b-[1px] focus:border-b-white `}
Expand Down
2 changes: 1 addition & 1 deletion src/components/main/StoreDetailSection/Report/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default function Report() {
return (
<div className="px-[16px] pb-[8px]">
<SectionTitle>또잇또잇 리포트</SectionTitle>
<div className="flex gap-[8px] mx-[16px] my-[4px]">
<div className="flex gap-[8px] mx-[16px] my-[4px] justify-center items-center">
<TopVisit />
<ReVisit />
</div>
Expand Down
Loading