Skip to content

Commit

Permalink
Merge pull request #24 from 9oormDari/feature/UserApi
Browse files Browse the repository at this point in the history
[#24] ๋กœ๊ทธ์ธ, ํšŒ์›๊ฐ€์ž… ์—ฐ๊ฒฐ
  • Loading branch information
Mintae Kim authored Sep 28, 2024
2 parents 5f4052f + 968e7b7 commit 2c0ad78
Show file tree
Hide file tree
Showing 16 changed files with 255 additions and 114 deletions.
19 changes: 9 additions & 10 deletions src/components/Goalpage/GoormScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ interface Cloud {
hidden: boolean;
}


export default function GoormScreen() {
const [stage, setStage] = useState<number>(0);

Expand All @@ -22,25 +21,25 @@ export default function GoormScreen() {
cloudType: stage === 1 ? ColorCloud : BlueCloud,
colStart: 1,
rowStart: 1,
hidden: stage === 0
hidden: stage === 0,
},
{
cloudType: stage === 2 ? ColorCloud : BlueCloud,
colStart: 2,
rowStart: 2,
hidden: stage < 2
hidden: stage < 2,
},
{
cloudType: stage === 3 ? ColorCloud : BlueCloud,
colStart: 3,
rowStart: 1,
hidden: stage < 3
hidden: stage < 3,
},
{
cloudType: stage === 4 ? ColorCloud : BlueCloud,
cloudType: stage === 4 ? ColorCloud : BlueCloud,
colStart: 4,
rowStart: 2,
hidden: stage < 4
hidden: stage < 4,
},
];

Expand All @@ -57,9 +56,9 @@ export default function GoormScreen() {
return (
<div
className={cn(
"flex flex-col items-center justify-center w-full",
"relative bg-gradient-to-b from-[#5A82F1] to-[#DAE4FF]",
"p-2 md:p-10 h-[30vh] md:h-[60vh]"
'flex flex-col items-center justify-center w-full',
'relative bg-gradient-to-b from-[#5A82F1] to-[#DAE4FF]',
'p-2 md:p-10 h-[30vh] md:h-[60vh]'
)}
>
{/* ๋‹จ๊ณ„ ์กฐ์ ˆ ๋ฒ„ํŠผ */}
Expand Down Expand Up @@ -93,4 +92,4 @@ export default function GoormScreen() {
</div>
</div>
);
}
}
37 changes: 21 additions & 16 deletions src/components/Goalpage/GoormScreen/CloudComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,36 @@ interface CloudComponentProps {
hidden: boolean;
}

export default function CloudComponent({ cloudType, colStart, rowStart, hidden }: CloudComponentProps) {
export default function CloudComponent({
cloudType,
colStart,
rowStart,
hidden,
}: CloudComponentProps) {
return (
<div
<div
className={cn(
`col-start-${colStart}`,
`row-start-${rowStart}`,
"flex justify-center flex-col items-center",
`${hidden ? "hidden" : ""}`
`col-start-${colStart}`,
`row-start-${rowStart}`,
'flex justify-center flex-col items-center',
`${hidden ? 'hidden' : ''}`
)}
>
<img
<img
src={cloudType}
alt="๊ตฌ๋ฆ„"
alt="๊ตฌ๋ฆ„"
className="md:w-[220px] md:h-[220px]"
style={{zIndex: 1}}
style={{ zIndex: 1 }}
/>
<img
src={CloudDisk}
alt="๋ฐ›์นจ"
<img
src={CloudDisk}
alt="๋ฐ›์นจ"
className={cn(
"w-1/4 h-1/4 md:w-[288px] md:h-[156px]",
"absolute mt-20 md:mt-[200px]",
`${cloudType === ColorCloud ? "" : "hidden"}`
'w-1/4 h-1/4 md:w-[288px] md:h-[156px]',
'absolute mt-20 md:mt-[200px]',
`${cloudType === ColorCloud ? '' : 'hidden'}`
)}
style={{zIndex: 0}}
style={{ zIndex: 0 }}
/>
</div>
);
Expand Down
28 changes: 14 additions & 14 deletions src/components/Goalpage/MemberList.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import MemberCard from "./MemberList/MemberCard";
import MemberCard from './MemberList/MemberCard';

export default function MemberList() {
return (
<>
<div className="w-full text-4xl font-bold text-left px-10 pt-10">
<span className="text-blue-400">์งˆ์ˆ˜์—†์กฐ</span>
<span> ํŒ€์›๋“ค์˜</span>
</div>
<div className="text-4xl font-bold text-left w-full px-10 pt-4">
๋ชฉํ‘œ ์ธ์ฆ์„ ํ™•์ธํ•ด๋ณผ๋ž˜์š”?
</div>
<div className="w-full text-4xl font-bold text-left px-10 pt-10">
<span className="text-blue-400">์งˆ์ˆ˜์—†์กฐ</span>
<span> ํŒ€์›๋“ค์˜</span>
</div>
<div className="text-4xl font-bold text-left w-full px-10 pt-4">
๋ชฉํ‘œ ์ธ์ฆ์„ ํ™•์ธํ•ด๋ณผ๋ž˜์š”?
</div>

<div className="flex flex-row gap-10 pt-10">
<MemberCard name="์กฐ์›1"/>
<MemberCard name="์กฐ์›2"/>
<MemberCard name="์กฐ์›3"/>
</div>
<div className="flex flex-row gap-10 pt-10">
<MemberCard name="์กฐ์›1" />
<MemberCard name="์กฐ์›2" />
<MemberCard name="์กฐ์›3" />
</div>
</>
);
}
}
22 changes: 12 additions & 10 deletions src/components/Goalpage/MemberList/MemberCard.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
interface MemberCardProps {
name: string;
name: string;
}

export default function MemberCard({name}: MemberCardProps) {
return (
<div className="flex flex-col items-center justify-center w-[267px] h-[406px] bg-gray-200 rounded-lg">
<div className="w-[80px] h-[80px] bg-gray-300 rounded-full"></div>
<div className="text-lg font-bold">{name}</div>
<button className="w-[200px] h-[40px] bg-blue-400 rounded-lg">๋ณด๋Ÿฌ ๊ฐ€๊ธฐ</button>
</div>
);
}
export default function MemberCard({ name }: MemberCardProps) {
return (
<div className="flex flex-col items-center justify-center w-[267px] h-[406px] bg-gray-200 rounded-lg">
<div className="w-[80px] h-[80px] bg-gray-300 rounded-full"></div>
<div className="text-lg font-bold">{name}</div>
<button className="w-[200px] h-[40px] bg-blue-400 rounded-lg">
๋ณด๋Ÿฌ ๊ฐ€๊ธฐ
</button>
</div>
);
}
28 changes: 25 additions & 3 deletions src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
import { useState, useEffect, useRef } from 'react';
import { useEffect, useRef, useState } from 'react';

import HamburgerMenu from './HamburgerMenu';
import NavLink from './NavLink';
import cn from '../../lib/cn';
import { useNavigate } from 'react-router-dom';

export default function Header() {
const [isMenuOpen, setIsMenuOpen] = useState(false);
const menuRef = useRef<HTMLDivElement>(null);
const navigate = useNavigate();
const [isLoggedIn, setIsLoggedIn] = useState(false); // ๋กœ๊ทธ์ธ ์—ฌ๋ถ€ ์ƒํƒœ ๊ด€๋ฆฌ

useEffect(() => {
// localStorage์—์„œ accessToken์„ ํ™•์ธํ•˜์—ฌ ๋กœ๊ทธ์ธ ์—ฌ๋ถ€ ์„ค์ •
const token = localStorage.getItem('accessToken');
if (token) {
setIsLoggedIn(true);
} else {
setIsLoggedIn(false);
}
}, []);

const toggleMenu = () => {
setIsMenuOpen((prev) => !prev);
Expand Down Expand Up @@ -56,7 +70,11 @@ export default function Header() {
<NavLink href="/" label="์„œ๋น„์Šค์†Œ๊ฐœ" />
<NavLink href="/guide" label="์ด์šฉ๋ฐฉ๋ฒ•" />
<NavLink href="/goal" label="๋ชฉํ‘œ ์ ๊ฒ€" />
<NavLink href="/mypage" label="๋งˆ์ดํŽ˜์ด์ง€" />
{isLoggedIn ? (
<NavLink href="/mypage" label="๋งˆ์ดํŽ˜์ด์ง€" />
) : (
<NavLink href="/login" label="๋กœ๊ทธ์ธ/ํšŒ์›๊ฐ€์ž…" />
)}
</nav>

{/* ์˜ค๋ฒ„๋ ˆ์ด */}
Expand Down Expand Up @@ -99,7 +117,11 @@ export default function Header() {
<NavLink href="/" label="์„œ๋น„์Šค์†Œ๊ฐœ" />
<NavLink href="/guide" label="์ด์šฉ๋ฐฉ๋ฒ•" />
<NavLink href="/goal" label="๋ชฉํ‘œ ์ ๊ฒ€" />
<NavLink href="/mypage" label="๋งˆ์ดํŽ˜์ด์ง€" />
{isLoggedIn ? (
<NavLink href="/mypage" label="๋งˆ์ดํŽ˜์ด์ง€" />
) : (
<NavLink href="/login" label="๋กœ๊ทธ์ธ/ํšŒ์›๊ฐ€์ž…" />
)}
</nav>
</div>
</header>
Expand Down
24 changes: 8 additions & 16 deletions src/components/Mainpage/AdditionalIntroSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import Trophy from '../../assets/MainPage/Icons/Trophy.svg';
export default function AdditionalIntroSection() {
const items = [
{
text:
'ํŒ€๊ณผ ํ•จ๊ป˜ํ•˜๋Š”\n ๋ชฉํ‘œ ๋ฐ ๋ฃจํ‹ด ์„ค์ •',
text: 'ํŒ€๊ณผ ํ•จ๊ป˜ํ•˜๋Š”\n ๋ชฉํ‘œ ๋ฐ ๋ฃจํ‹ด ์„ค์ •',
image: Flag,
},
{
Expand Down Expand Up @@ -40,9 +39,10 @@ export default function AdditionalIntroSection() {
];

return (
<section className={cn(
"bg-white w-full p-5 md:px-10 py-10 flex items-center",
"justify-center flex-col md:px-60 "
<section
className={cn(
'bg-white w-full p-5 md:px-10 py-10 flex items-center',
'justify-center flex-col md:px-60 '
)}
>
{/* ์ฒซ ๋ฒˆ์งธ ๋ฐ•์Šค ๊ทธ๋ฃน */}
Expand All @@ -53,11 +53,7 @@ export default function AdditionalIntroSection() {
</h2>
<div className="place-items-center grid grid-cols-1 md:grid-cols-3 gap-8 text-center">
{items.map((item, index) => (
<Item
key={index}
text={item.text}
image={item.image}
/>
<Item key={index} text={item.text} image={item.image} />
))}
</div>
</div>
Expand All @@ -70,14 +66,10 @@ export default function AdditionalIntroSection() {
</h2>
<div className="place-items-center grid grid-cols-1 md:grid-cols-3 gap-8 text-center">
{additionalItems.map((item, index) => (
<Item
key={index}
text={item.text}
image={item.image}
/>
<Item key={index} text={item.text} image={item.image} />
))}
</div>
</div>
</section>
);
}
}
18 changes: 10 additions & 8 deletions src/components/Mainpage/ImageIntroSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,33 @@ export default function ImageIntroSection() {
return (
<section
className={cn(
"relative bg-gradient-to-b from-[#5A82F1] to-[#DAE4FF]",
"p-2 md:p-10 flex items-center flex-col justify-center"
'relative bg-gradient-to-b from-[#5A82F1] to-[#DAE4FF]',
'p-2 md:p-10 flex items-center flex-col justify-center'
)}
>
<img
<img
src={GoormdariFriends}
alt="GoormdariFriends"
className='md:mt-20 h-[358.46px] w-[182.52] md:h-[762] md:w-[388]'
className="md:mt-20 h-[358.46px] w-[182.52] md:h-[762] md:w-[388]"
/>
<div className="md:pt-10 bottom-10 text-left md:text-center text-[#455DA8]">
<h2 className="text-2xl md:text-[44px] font-bold mb-4 md:mb-8">
๊ตฌ๋ฆ„๋‹ค๋ฆฌ์™€ <br className='md:hidden'/>
๊ตฌ๋ฆ„๋‹ค๋ฆฌ์™€ <br className="md:hidden" />
ํ•จ๊ป˜ ์ด๋ค„๋‚˜๊ฐ€์š”!
</h2>
<p className="text-base md:text-lg">
๊ตฌ๋ฆ„๋‹ค๋ฆฌ๋Š” ์นœ๊ตฌ๋“ค๊ณผ ํ•จ๊ป˜ ๋งค์ผ ๋ฃจํ‹ด์„ ๋‹ฌ์„ฑํ•˜๋ฉฐ <br className='md:hidden'/>
๊ตฌ๋ฆ„๋‹ค๋ฆฌ๋Š” ์นœ๊ตฌ๋“ค๊ณผ ํ•จ๊ป˜ ๋งค์ผ ๋ฃจํ‹ด์„ ๋‹ฌ์„ฑํ•˜๋ฉฐ{' '}
<br className="md:hidden" />
๋ชฉํ‘œ๋ฅผ ํ–ฅํ•ด ๋‚˜์•„๊ฐ€๋Š” ์„œ๋น„์Šค์ž…๋‹ˆ๋‹ค
</p>
{/* ๋ฐ์Šคํฌํƒ‘์—์„œ ๋ณด์ด๋Š” pํƒœ๊ทธ */}
<p className="text-lg hidden md:block">
์นœ๊ตฌ๋“ค๊ณผ์˜ ๋ฃจํ‹ด ์ธ์ฆ์„ ํ†ตํ•ด ๊พธ์ค€ํ•จ์„ ์œ ์ง€ํ•˜๊ณ  ๋ชฉํ‘œ์— ๊ฐ€๊นŒ์›Œ์งˆ ์ˆ˜ ์žˆ๋„๋ก ๋„์™€๋“œ๋ฆฝ๋‹ˆ๋‹ค <br />
์นœ๊ตฌ๋“ค๊ณผ์˜ ๋ฃจํ‹ด ์ธ์ฆ์„ ํ†ตํ•ด ๊พธ์ค€ํ•จ์„ ์œ ์ง€ํ•˜๊ณ  ๋ชฉํ‘œ์—
๊ฐ€๊นŒ์›Œ์งˆ ์ˆ˜ ์žˆ๋„๋ก ๋„์™€๋“œ๋ฆฝ๋‹ˆ๋‹ค <br />
๊ตฌ๋ฆ„๋‹ค๋ฆฌ์™€ ํ•จ๊ป˜ ์ƒ์‚ฐ์ ์ด๊ณ  ์˜๋ฏธ์žˆ๋Š” ํ•˜๋ฃจ๋ฅผ ๋งŒ๋“ค์–ด๋ณด์„ธ์š”!
</p>
{/* ๋ชจ๋ฐ”์ผ์—์„œ ๋ณด์ด๋Š” pํƒœ๊ทธ */}
<p className='text-base md:hidden mb-4'>
<p className="text-base md:hidden mb-4">
ํŒ€๊ณผ์˜ ๋ฃจํ‹ด ์ธ์ฆ์„ ํ†ตํ•ด ๊พธ์ค€ํ•˜๊ฒŒ ๋ชฉํ‘œ๋ฅผ ์ด๋ค„๋ณด์„ธ์š”!
</p>
</div>
Expand Down
20 changes: 11 additions & 9 deletions src/components/Mainpage/Item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@ const Item: React.FC<ItemProps> = ({ text, image }) => {
return (
<div
className={cn(
"relative h-[70px] md:h-[300px] w-[300px] p-5",
"transform transition-transform",
"duration-300 hover:scale-105 rounded-lg bg-[#E8EAF8] shadow-lg"
'relative h-[70px] md:h-[300px] w-[300px] p-5',
'transform transition-transform',
'duration-300 hover:scale-105 rounded-lg bg-[#E8EAF8] shadow-lg'
)}
>
{/* ํ…์ŠคํŠธ๋ฅผ ์ƒ๋‹จ์— ๊ณ ์ • */}
<div className={cn(
"absolute top-2 md:top-5 left-2 md:left-5 bg-opacity-50 text-black",
"text-base md:text-2xl text-left font-normal md:font-semibold p-2 rounded-t-lg"
<div
className={cn(
'absolute top-2 md:top-5 left-2 md:left-5 bg-opacity-50 text-black',
'text-base md:text-2xl text-left font-normal md:font-semibold p-2 rounded-t-lg'
)}
>
{formattedText}
Expand All @@ -35,9 +36,10 @@ const Item: React.FC<ItemProps> = ({ text, image }) => {
src={image}
alt={text}
className={cn(
"absolute bottom-2 md:bottom-5 right-2 md:right-5",
"object-contain rounded-b-lg",
"h-[50px] w-[50px] md:h-[120px] md:w-[120px]")}
'absolute bottom-2 md:bottom-5 right-2 md:right-5',
'object-contain rounded-b-lg',
'h-[50px] w-[50px] md:h-[120px] md:w-[120px]'
)}
/>
</div>
);
Expand Down
16 changes: 9 additions & 7 deletions src/components/NeedLoginComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,21 @@ import cn from '../lib/cn.ts';
export default function NeedLoginComponents() {
return (
<div className="flex flex-col items-center justify-center">
<img src={NotGood} alt="Not Good" className='w-1/2 h-1/2'/>
<img src={NotGood} alt="Not Good" className="w-1/2 h-1/2" />
<h1 className="text-2xl md:text-4xl font-bold mt-8">๋กœ๊ทธ์ธ ํ›„</h1>
<h1 className="text-2xl md:text-4xl font-bold mt-2">์ด์šฉํ•  ์ˆ˜ ์žˆ๋Š” ๊ธฐ๋Šฅ์ด์—์š”</h1>
<h1 className="text-2xl md:text-4xl font-bold mt-2">
์ด์šฉํ•  ์ˆ˜ ์žˆ๋Š” ๊ธฐ๋Šฅ์ด์—์š”
</h1>
<a href="/login">
<button
<button
className={cn(
"mt-5 md:mt-10 px-20 md:px-40 py-4 bg-blue-500 rounded-lg",
"text-white text-base md:text-2xl font-bold"
'mt-5 md:mt-10 px-20 md:px-40 py-4 bg-blue-500 rounded-lg',
'text-white text-base md:text-2xl font-bold'
)}
>
๋กœ๊ทธ์ธํ•˜๋Ÿฌ ๊ฐ€๊ธฐ
๋กœ๊ทธ์ธํ•˜๋Ÿฌ ๊ฐ€๊ธฐ
</button>
</a>
</div>
);
}
}
Loading

0 comments on commit 2c0ad78

Please sign in to comment.