Skip to content
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
62 changes: 42 additions & 20 deletions src/pages/auth/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
'use client';
import { useState } from 'react';
import { Icon } from '@/shared/icons';
import { cn } from '@/shared/lib';
import LoginButton from '@/pages/auth/components/LoginButton';
import RecentLoginBubble from '@/pages/auth/components/RecentLoginBubble';

export default function LoginPage() {
const handleLoginClick = (platform: string) => alert(`${platform} ๋กœ๊ทธ์ธ`);
const [recentPlatform, setRecentPlatform] = useState<string | null>(null);

const handleLoginClick = (platform: string) => {
alert(`${platform} ๋กœ๊ทธ์ธ ์ค€๋น„์ค‘`);
console.log(`${platform} ๋กœ๊ทธ์ธ ๋ฒ„ํŠผ ํด๋ฆญ`);
setRecentPlatform(platform);
};

return (
<main className='w-full flex flex-col items-center bg-white'>
Expand Down Expand Up @@ -37,7 +44,7 @@ export default function LoginPage() {
</svg>
</div>

{/* ์ฝ˜ํ…์ธ  */}
{/* ์ฝ˜ํ…์ธ  */}
<section
className={cn(
'w-full flex flex-col items-center text-center',
Expand All @@ -50,7 +57,7 @@ export default function LoginPage() {
<p className='text-label-md text-mint-900'>
๋งŒํ™” ์† ๋ถ€์ฒœ ์—ฌํ–‰
<br />
8๊ฐœ ๋ช…์†Œ๋ฅผ ํƒํ—˜ํ•˜๊ณ  ์—ฝ์„œ๋ฅผ ๋ชจ์•„๋ณด์„ธ์š”!
10๊ฐœ ๋ช…์†Œ๋ฅผ ํƒํ—˜ํ•˜๊ณ  ์—ฝ์„œ๋ฅผ ๋ชจ์•„๋ณด์„ธ์š”!
</p>
</div>

Expand All @@ -59,32 +66,47 @@ export default function LoginPage() {
<Icon name='Stamp' size={132} color='mint-400' />
</div>

{/* ๋กœ๊ทธ์ธ ๋ฒ„ํŠผ */}
<div className='flex flex-col items-center gap-[2.1rem] relative'>
<div className='flex flex-col items-center gap-[2.1rem]'>
<p className='text-label-lg text-gray-400'>start with</p>

{/* ์ตœ๊ทผ ๋กœ๊ทธ์ธ ๋งํ’์„  */}
<div className='absolute -translate-x-1/2 z-50'>
<RecentLoginBubble />
</div>
<div className='flex gap-[1.5rem] relative'>
{/* ์นด์นด์˜ค */}
<div className='relative'>
<LoginButton
platform='kakao'
onClick={() => handleLoginClick('์นด์นด์˜ค')}
/>
{recentPlatform === '์นด์นด์˜ค' && (
<div
className='absolute -top-[3.8rem] left-1/2 -translate-x-1/2
w-auto min-w-max h-auto flex-shrink-0 pointer-events-none'
>
<RecentLoginBubble />
</div>
)}
</div>

{/* ๋กœ๊ทธ์ธ ๋ฒ„ํŠผ */}
<div className='flex gap-[1.5rem]'>
<LoginButton
platform='kakao'
onClick={() => handleLoginClick('์นด์นด์˜ค')}
/>
<LoginButton
platform='google'
onClick={() => handleLoginClick('๊ตฌ๊ธ€')}
/>
{/* ๊ตฌ๊ธ€ */}
<div className='relative'>
<LoginButton
platform='google'
onClick={() => handleLoginClick('๊ตฌ๊ธ€')}
/>
{recentPlatform === '๊ตฌ๊ธ€' && (
<div
className='absolute -top-[3.8rem] left-1/2 -translate-x-1/2
w-auto min-w-max h-auto flex-shrink-0 pointer-events-none'
>
<RecentLoginBubble />
</div>
)}
</div>
</div>

<p className='text-label-md text-gray-400 cursor-pointer underline underline-offset-[0.25rem]'>
๋น„ํšŒ์› ๋กœ๊ทธ์ธ
</p>
</div>

{/* ์•ˆ๋‚ด๋ฌธ */}
<p className='mt-[5rem] text-label-sm text-gray-400'>
๋น„ํšŒ์›์€ ์Šคํƒฌํ”„ ์ €์žฅ๊ณผ ๊ณต์œ  ๊ธฐ๋Šฅ์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.
Expand Down
29 changes: 17 additions & 12 deletions src/shared/components/button/AddressCopy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useState } from 'react';
import { Copy } from '@/shared/utils/copy';

const addressCopyStyle = cva(
'flex items-center justify-start flex-shrink-0 rounded-full transition-all duration-200',
'flex items-center justify-start flex-shrink-0 rounded-full transition-all duration-200 overflow-hidden',
{
variants: {
variant: {
Expand All @@ -23,14 +23,14 @@ const addressCopyStyle = cva(
interface AddressCopyProps
extends React.HTMLAttributes<HTMLDivElement>,
VariantProps<typeof addressCopyStyle> {
label: string;
value: string;
truncate?: boolean;
}

const AddressCopy = ({
label = 'address copy',
value = label,
value,
variant = 'gray',
truncate = true,
className,
...props
}: AddressCopyProps) => {
Expand All @@ -52,24 +52,29 @@ const AddressCopy = ({
onClick={handleCopy}
className={cn(
addressCopyStyle({ variant }),
'w-[35.4rem] h-[4rem] px-[1.3rem] py-[1rem] gap-[0.4rem]',
'w-full h-[4rem] px-[1.3rem] py-[1rem] gap-[0.4rem]',
'cursor-pointer select-none',
className,
)}
{...props}
>
<Icon
name='CopySimple'
size={18}
color={variant === 'mint' ? 'mint-400' : 'gray-400'}
/>
<div className='flex-shrink-0'>
<Icon
name={copied ? 'Check' : 'CopySimple'}
size={18}
color={variant === 'mint' ? 'mint-400' : 'gray-400'}
/>
</div>
<span
className={cn(
'text-label-lg',
'text-label-lg flex-1 min-w-0',
variant === 'mint' ? 'text-mint-400' : 'text-gray-400',
truncate &&
'truncate whitespace-nowrap overflow-hidden text-ellipsis',
)}
title={value}
>
{label}
{value}
</span>
</div>
);
Expand Down
4 changes: 2 additions & 2 deletions src/shared/components/container/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ const cardStyle = cva(
},
size: {
medium:
'w-[17rem] h-[17rem] flex-col items-center justify-center p-[1.2rem]',
'w-full h-[17rem] flex-col items-center justify-center p-[1.2rem]',
large:
'w-[35.4rem] h-[12rem] flex-row items-start justify-start px-[1.3rem] pt-[1.1rem] pb-[3.3rem]',
'w-full h-[12rem] flex-row items-start justify-start px-[1.3rem] pt-[1.1rem] pb-[3.3rem]',
},
},
defaultVariants: {
Expand Down
Loading