Skip to content

Commit

Permalink
Merge pull request #72 from MOVIEJOJO7/feature/#71
Browse files Browse the repository at this point in the history
Feat : 로그인, 회원가입 페이지 디자인
  • Loading branch information
LikeFireAndSky authored Nov 15, 2023
2 parents 56d5270 + 46df2ea commit 32150b6
Show file tree
Hide file tree
Showing 9 changed files with 77 additions and 36 deletions.
46 changes: 28 additions & 18 deletions Components/Join/DropZone/DropZone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Image from 'next/image';
import { useCallback } from 'react';
import { DropEvent, FileRejection, useDropzone } from 'react-dropzone';
import Swal from 'sweetalert2';
import icon_foot from '@/public/icon_foot.svg';

type onDropProps = <T extends File>(
acceptedFiles: T[],
Expand Down Expand Up @@ -56,24 +57,33 @@ const DropZone = ({ setFn, baseImageUrl }: DropZoneProps) => {
}

return (
<div
{...getRootProps({
className:
'border-4 w-[200px] h-[200px] rounded-full overflow-hidden flex flex-col items-center justify-content',
})}
>
<input {...getInputProps()} />
{baseImageUrl ? (
<Image
src={baseImageUrl}
alt="유저이미지"
width={100}
height={100}
className="w-full h-full"
/>
) : (
<div className="w-full h-full flex flex-col justify-center items-center bg-camera-icon bg-50% bg-no-repeat bg-center"></div>
)}
<div className="relative w-fit h-fit">
<div
{...getRootProps({
className:
'relative border-4 w-[200px] h-[200px] rounded-full overflow-hidden flex flex-col items-center justify-content',
})}
>
<input {...getInputProps()} />
{baseImageUrl ? (
<Image
src={baseImageUrl}
alt="유저이미지"
width={100}
height={100}
className="w-full h-full"
/>
) : (
<div className="w-full h-full flex flex-col justify-center items-center bg-white "></div>
)}
</div>
<Image
src={icon_foot}
width={100}
alt="곰"
height={100}
className="w-8 absolute bottom-7 right-3"
/>
</div>
);
};
Expand Down
17 changes: 10 additions & 7 deletions Components/Join/JoinForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const JoinForm = () => {
{/* 이름 */}
<div className="flex h-[90] w-full flex-col mt-5">
<Input
color="brown"
color="pink"
placeholder="20자 이하의 이름을 입력해주세요."
variant="static"
label="name"
Expand All @@ -127,7 +127,7 @@ const JoinForm = () => {
crossOrigin={'anonymous'}
/>

<div className="text-red-500 text-[10px] mt-2 h-[10px]">
<div className="text-text text-xs mt-2 h-[10px]">
{errors?.name?.type === 'required' && (
<div>name를 입력해주세요.</div>
)}
Expand All @@ -140,7 +140,7 @@ const JoinForm = () => {
{/* id */}
<div className="flex w-full h-[90] flex-col mt-5">
<Input
color="brown"
color="pink"
variant="static"
label="id"
placeholder=" "
Expand All @@ -151,7 +151,7 @@ const JoinForm = () => {
crossOrigin={'anonymous'}
/>

<div className="text-red-500 text-[10px] mt-2 h-[10px]">
<div className="text-text text-xs mt-2 h-[10px]">
{errors?.id?.type === 'pattern' && (
<div>영어와 숫자만 작성 가능합니다.</div>
)}
Expand All @@ -163,7 +163,7 @@ const JoinForm = () => {
{/* 비밀번호 */}
<div className="flex w-full h-[90] flex-col mt-5">
<Input
color="brown"
color="pink"
variant="static"
label="password"
type="password"
Expand All @@ -173,7 +173,7 @@ const JoinForm = () => {
})}
crossOrigin={'anonymous'}
/>
<div className="text-red-500 text-[10px] mt-2 h-[10px]">
<div className="text-text text-xs mt-2 h-[10px]">
{errors?.password?.type === 'minLength' && (
<div>입력은 최소 5자 이상이어야 합니다.</div>
)}
Expand All @@ -183,7 +183,10 @@ const JoinForm = () => {
</div>
</div>
</div>
<Button type="submit" className="w-full bg-main mt-10 text-subtext">
<Button
type="submit"
className="w-full mt-10 text-subtext bg-text text-white"
>
회원가입
</Button>
<Button
Expand Down
20 changes: 15 additions & 5 deletions Components/Login/LoginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ import React from 'react';
import { useForm, SubmitHandler } from 'react-hook-form';
import { fetchLogin } from '../../app/login/login.utils';
import { setCookie } from '@/Components/Login/Cookie';
import { Button } from '@material-tailwind/react';
import { Button, Typography } from '@material-tailwind/react';
import Link from 'next/link';
import { useRouter } from 'next/navigation';
import Swal from 'sweetalert2';
import { Input } from '@material-tailwind/react';
import Image from 'next/image';
import useAsyncLoading from '@/hooks/Open/useAsyncLoading';
import { IFormInput } from './Login.types';
import icon_cat from '@/public/icon_cat.svg';

const LoginForm = () => {
const loadingControl = useAsyncLoading();
Expand Down Expand Up @@ -49,12 +50,18 @@ const LoginForm = () => {
};

return (
<div className="flex flex-col h-full items-center justify-center">
<div className="flex flex-col h-full relative items-center justify-center">
<form
onSubmit={handleSubmit(onSubmit)}
className="flex flex-col items-center justify-center w-2/3"
>
<Image src="/logo.png" alt="Picture of me" width={250} height={250} />
<Image
src={icon_cat}
alt="Picture of me"
width={100}
height={100}
className="w-48 mb-12"
/>
{/* 영어와 숫자만 */}
<Input
placeholder="id"
Expand All @@ -81,13 +88,16 @@ const LoginForm = () => {
{...register('password')}
crossOrigin={'anonymous'}
/>
<Button type="submit" className=" bg-pink-200 w-full mt-10">
<Button type="submit" className="bg-text w-full mt-10">
로그인
</Button>
<Link href="/join" passHref>
<div className="text-gray-700 text-[10px] mt-4 mb-14">회원가입</div>
<div className="text-md text-black mt-3">새로운 집사 되기!</div>
</Link>
</form>
<Typography variant="h3" className="absolute bottom-8">
CatTalk
</Typography>
</div>
);
};
Expand Down
2 changes: 1 addition & 1 deletion app/join/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';

const Join = () => {
return (
<div className="w-full h-full bg-white ">
<div className="w-full h-full bg-fill ">
<JoinForm></JoinForm>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion app/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import LoginForm from '../../Components/Login/LoginForm';

const Login = () => {
return (
<div className="w-full h-full bg-main ">
<div className="w-full h-full bg-bgfill ">
<LoginForm></LoginForm>
</div>
);
Expand Down
5 changes: 5 additions & 0 deletions public/icon_dot_chat.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions public/icon_dot_multi_chat.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions public/icon_foot.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ const config: Config = withMT({
},
extend: {
colors: {
primary: '#FFB8DA',
text: '#764242',
white: '#FFFFFF',
primary: '#FB72B4',
secondary: '#FFD4E9',
subtext: '#7E7E7E',
text: '#FF59A9',
fill: '#EFEFEF',
bgfill: '#7E7E7E',
},
backgroundImage: {
'trash-can': "url('../public/icon_trash.svg')",
Expand Down

0 comments on commit 32150b6

Please sign in to comment.