Skip to content

Commit

Permalink
Merge pull request #22 from primus-teoSprint/feat/#21
Browse files Browse the repository at this point in the history
[#21] λ§ˆμ΄νŽ˜μ΄μ§€, 투자 μ§€ν‘œ νŽ˜μ΄μ§€, κ²°κ³Ό λ‘œλ”©μ€‘
  • Loading branch information
hanseulhee authored Apr 7, 2024
2 parents be4c89e + 7238ae9 commit e26c30a
Show file tree
Hide file tree
Showing 19 changed files with 556 additions and 9 deletions.
20 changes: 20 additions & 0 deletions app/(route)/indicators/_components/form/FormTitle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import S from './form.module.css'

interface Props {
title: string
subTitle?: string
}

function FormTitle({
title,
subTitle = 'ν•΄λ‹Ή ν•­λͺ©μ˜ μˆ˜μΉ˜λŠ” μ–΄λ–»κ²Œ λ˜λ‚˜μš”?',
}: Props) {
return (
<div className={S.wrapper}>
<span className={S.title}>{title}</span>
<p className={S.subTitle}>{subTitle}</p>
</div>
)
}

export default FormTitle
36 changes: 36 additions & 0 deletions app/(route)/indicators/_components/form/form.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
.wrapper {
display: flex;
flex-direction: column;
gap: 2px;
}

.title {
font-size: 1.2rem;
font-weight: 700;
}

.subTitle {
font-size: 0.7rem;
font-weight: 300;
margin-bottom: 10px;
}

.inputWrapper {
display: flex;
align-items: center;
width: 100%;
height: auto;
border-radius: 15px;
padding: 14px 20px;
border: 1px solid #efefef;
}

.input {
all: unset;
font-size: 0.83rem;
}

.error {
font-size: 0.67rem;
color: #ff453a;
}
21 changes: 21 additions & 0 deletions app/(route)/indicators/_components/result/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import Nav from '@/app/_common/nav'
import Title from '@/app/_common/text/title'
import S from './result.module.css'

//TODO: μ‚¬μš©μžκ°€ ν΄λ¦­ν•œ 아이디어 이름과 ν•΄λ‹Ή νˆ΄μ„ μ‚¬μš©ν•œ μ‚¬μš©μž μˆ˜κ°€ λ³΄μ—¬μ§‘λ‹ˆλ‹€.
function Result() {
return (
<div className={S.wrapper}>
<Nav />
<div>
<Title title="검증 κ²°κ³Ό" />
<div>
<Title title="아이디어 이름" />
<span>전체 μ‚¬μš©μž 162λͺ…</span>
</div>
</div>
</div>
)
}

export default Result
6 changes: 6 additions & 0 deletions app/(route)/indicators/_components/result/result.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.wrapper {
display: flex;
flex-direction: column;
padding-bottom: 50px;
padding: 0 18px;
}
52 changes: 52 additions & 0 deletions app/(route)/indicators/indicators.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
.wrapper {
display: flex;
flex-direction: column;
width: 100%;
}

.formWrapper {
position: relative;
margin-top: 46px;
min-height: 100vh;
height: 100%;
}

.paddingWrapper {
padding: 0 18px;
}

.overflowWrapper {
display: flex;
flex-direction: column;
padding: 0 18px;
overflow: auto;
height: 690px;
width: 100%;
gap: 14px;
}

.bottomWrapper {
position: absolute;
bottom: 0;
background-color: #fbfbfb;
width: 100%;
height: 150px;
border-top-left-radius: 38px;
border-top-right-radius: 38px;
}

.submitBtnWrapper {
position: absolute;
right: 16px;
bottom: 50px;

color: white;
font-weight: 700;
font-size: 1.2rem;
text-align: center;
width: 100px;
height: auto;
padding: 10px 20px;
border-radius: 9px;
background-color: var(--purple-700);
}
73 changes: 73 additions & 0 deletions app/(route)/indicators/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
'use client'

import Title from '@/app/_common/text/title'
import { useRouter } from 'next/navigation'
import { useState } from 'react'
import Nav from '../list/_components/nav'
import FormTitle from './_components/form/FormTitle'
import FormS from './_components/form/form.module.css'
import S from './indicators.module.css'

//* 투자 μ§€ν‘œ μž…λ ₯ νŽ˜μ΄μ§€μž…λ‹ˆλ‹€.
//TODO: title에 μ‚¬μš©μžκ°€ μž…λ ₯ν–ˆλ˜ μš”μ†Œλ“€μ΄ λ³΄μ—¬μ§€κ²Œ λ©λ‹ˆλ‹€.
//TODO: recoil μ‚¬μš©
//? ν”ΌκΈ°λ‹˜μ΄ ν•˜μ‹  νˆ¬μžμ§€ν‘œ 툴둜 λ³€κ²½ μ˜ˆμ •
function Indicators() {
const router = useRouter()
const [inputValue, setInputValue] = useState('')
const [error, setError] = useState('')

const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
setInputValue(e.target.value)
setError('')
}

const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault()
if (!/^\d+$/.test(inputValue)) {
setError('숫자만 μž…λ ₯ κ°€λŠ₯ν•©λ‹ˆλ‹€.')
} else {
router.push('/result')
}
}

return (
<>
<Nav />
<div className={S.wrapper}>
<div className={S.paddingWrapper}>
<Title title="아이디어 제λͺ©" />
</div>
<form className={S.formWrapper} onSubmit={handleSubmit}>
<div className={S.overflowWrapper}>
<FormTitle
title="전체 이용자 수"
subTitle="전체 이용자 수λ₯Ό 가지고 총 κ²°κ³Ό μ§€ν‘œκ°€ κ³„μ‚°λ©λ‹ˆλ‹€."
/>

<div className={FormS.inputWrapper}>
<input
className={FormS.input}
placeholder="수치λ₯Ό μž…λ ₯ν•΄ μ£Όμ„Έμš”."
value={inputValue}
onChange={handleChange}
/>
</div>

{error && (
<span className={FormS.error}>숫자만 μž…λ ₯ κ°€λŠ₯ν•©λ‹ˆλ‹€.</span>
)}
</div>

<div className={S.bottomWrapper}>
<button type="submit" className={S.submitBtnWrapper}>
μ œμΆœν•˜κΈ°
</button>
</div>
</form>
</div>
</>
)
}

export default Indicators
2 changes: 1 addition & 1 deletion app/(route)/list/_components/nav/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useRouter } from 'next/navigation'
import { GoArrowLeft } from 'react-icons/go'
import S from './nav.module.css'

function Nav({ title }: { title: string }) {
function Nav({ title }: { title?: string }) {
const router = useRouter()

return (
Expand Down
12 changes: 12 additions & 0 deletions app/(route)/main/page.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,15 @@
flex-direction: column;
gap: 18px;
}

.columnWrapper {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
position: relative;
flex-wrap: wrap;
min-height: 100vh;
width: 100%;
padding-bottom: 300px;
}
4 changes: 3 additions & 1 deletion app/(route)/main/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ function Main() {
<main className={S.wrapper}>
<Nav />
<div className={S.inWrapper}>
<Search />
<Link href="/search">
<Search />
</Link>
<div className={S.marginWrapper}>
<Title title="인기 λ§Žμ€ 툴" />
</div>
Expand Down
Empty file.
45 changes: 45 additions & 0 deletions app/(route)/mypage/_components/ideaCard/ideaCard.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
.wrapper {
width: 100%;
}

.rowWrapper {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}

.columnWrapper {
display: flex;
flex-direction: column;
background-color: var(--gray-100);
padding: 13px 17px;
border-radius: 11px;
cursor: pointer;
width: 100%;
}

.ideaTitle {
font-size: 0.98rem;
font-weight: 700;
letter-spacing: 0.03px;
}

.ideaTool {
font-size: 0.7rem;
}

.btnWrapper {
display: flex;
justify-content: center;
align-items: center;
width: 70px;
height: 40px;
font-weight: 500;
font-size: 0.9rem;
color: white;
background-color: var(--purple-700);
border-radius: 9px;

margin-left: 10px;
}
24 changes: 24 additions & 0 deletions app/(route)/mypage/_components/ideaCard/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import Link from 'next/link'
import S from './ideaCard.module.css'

//TODO: 아이디어 λͺ…κ³Ό μ‚¬μš©ν•œ 툴이 λ“€μ–΄κ°€κ²Œ λ©λ‹ˆλ‹€.
//TODO: μ™„λ£Œλœ 아이디어일 경우 κ²°κ³Ό νŽ˜μ΄μ§€(/result)둜 μ΄λ™ν•©λ‹ˆλ‹€.
//TODO: 진행쀑인 아이디어일 경우 투자 μ§€ν‘œ νŽ˜μ΄μ§€(/indicators)둜 μ΄λ™ν•©λ‹ˆλ‹€.
function IdeaCard() {
return (
<div className={S.wrapper}>
<Link href="/indicators">
<div className={S.rowWrapper}>
<div className={S.columnWrapper}>
<span className={S.ideaTitle}>아이디어 제λͺ©</span>
<p className={S.ideaTool}>아이디어 툴</p>
</div>

<div className={S.btnWrapper}>μ—΄λžŒ</div>
</div>
</Link>
</div>
)
}

export default IdeaCard
26 changes: 26 additions & 0 deletions app/(route)/mypage/mypage.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.wrapper {
display: flex;
flex-direction: column;
justify-content: center;
padding: 0 18px;
padding-bottom: 50px;
}

.sectionTitle {
font-size: 1.3rem;
font-weight: 700;
margin-top: 26px;
}

.sectionSubTitle {
font-size: 0.86rem;
font-weight: 300;
}

.ideaCardWrapper {
display: flex;
flex-direction: column;

gap: 17px;
margin: 12px 0 40px 0;
}
28 changes: 27 additions & 1 deletion app/(route)/mypage/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
import Nav from '@/app/_common/nav'
import Title from '@/app/_common/text/title'
import IdeaCard from './_components/ideaCard'
import S from './mypage.module.css'

//TODO: μ‚¬μš©μž λͺ…, 아이디어 검증 μˆ˜κ°€ λ“€μ–΄κ°‘λ‹ˆλ‹€.
//TODO: μ™„λ£Œλœ 아이디어, μž…λ ₯ μ „ 아이디어λ₯Ό λΆˆλŸ¬μ˜΅λ‹ˆλ‹€.(get)
function Mypage() {
return
return (
<>
<div className={S.wrapper}>
<Nav />
<Title title="아이디어" />

<span className={S.sectionTitle}>μ™„λ£Œ</span>
<p className={S.sectionSubTitle}>투자 μ§€ν‘œλ₯Ό μ™„λ£Œν•œ 아이디어</p>
<div className={S.ideaCardWrapper}>
<IdeaCard />
</div>

<span className={S.sectionTitle}>μž…λ ₯ μ „</span>
<p className={S.sectionSubTitle}>투자 μ§€ν‘œλ₯Ό μž…λ ₯ν•˜μ§€ μ•Šμ€ 아이디어</p>
<div className={S.ideaCardWrapper}>
<IdeaCard />
</div>
</div>
</>
)
}

export default Mypage
2 changes: 1 addition & 1 deletion app/(route)/onboard/Onboard.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,5 @@
}

.wrap:nth-child(3) {
animation-delay: 2mss;
animation-delay: 2s;
}
Loading

0 comments on commit e26c30a

Please sign in to comment.