-
Notifications
You must be signed in to change notification settings - Fork 1
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
[FE] assignment : Daystar #4
base: main
Are you sure you want to change the base?
Changes from all commits
af75fa7
944c52a
94bcc99
58ce382
55c9159
5ef443b
3439c37
3b0a52d
714a551
eea0918
215eee8
445b7fa
91003c0
19d5f20
2168527
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
"use client"; | ||
|
||
// use client에 대해서는 공부가 더 필요할 것 같습니다 | ||
import React from "react"; | ||
|
||
import DaystarMyPageMainFrame from "@sparcs-clubs/web/features/Daystar/my/frames/DaystarMyPageMainFrame"; | ||
|
||
const DaystarMy = () => <DaystarMyPageMainFrame />; | ||
|
||
export default DaystarMy; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
"use client"; | ||
|
||
import React, { useState } from "react"; | ||
|
||
import styled from "styled-components"; | ||
|
||
import Card from "@sparcs-clubs/web/common/components/Card"; | ||
import DaystarItemNumberInput from "@sparcs-clubs/web/common/components/Daystar/DaystarItemNumberInput"; | ||
import DaystarTextInput from "@sparcs-clubs/web/common/components/Daystar/DaystarTextInput"; | ||
import ItemNumberInput from "@sparcs-clubs/web/common/components/Forms/ItemNumberInput"; | ||
import TextInput from "@sparcs-clubs/web/common/components/Forms/TextInput"; | ||
import Select from "@sparcs-clubs/web/common/components/Select"; | ||
import Typography from "@sparcs-clubs/web/common/components/Typography"; | ||
|
||
const DaystarWrapper = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
gap: 8px; | ||
`; | ||
Comment on lines
+15
to
+19
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FlexWrapper를 사용합시당 |
||
|
||
const Daystar = () => { | ||
const [firstText, setFirstText] = useState(""); | ||
const [secondText, setSecondText] = useState(""); | ||
const [firstItemNumber, setFirstItemNumber] = useState("0"); | ||
const [solItemNumber, setSolItemNumber] = useState("0"); | ||
|
||
const [secondHasError, setSecondHasError] = useState(false); | ||
|
||
const handleSecondTextChange = (value: string) => { | ||
setSecondText(value); | ||
setSecondHasError(value.length < 5); // 5글자보다 짧으면 에러 뜨는 것으로 테스트 | ||
}; | ||
Comment on lines
+29
to
+32
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (optional) 여기서 이 input을 한 번도 클릭하지 않았을 때는 에러가 안 뜨게 하려면 어떻게 해야할까요! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
const handleFirstItemNumberChange = (value: string) => { | ||
setFirstItemNumber(value); | ||
}; | ||
|
||
const handleSolItemNumberChange = (value: string) => { | ||
setSolItemNumber(value); | ||
}; | ||
|
||
return ( | ||
<DaystarWrapper> | ||
<TextInput placeholder="" /> | ||
<ItemNumberInput placeholder="" /> | ||
<Select items={[]} /> | ||
<Card outline gap={16}> | ||
<Typography type="h3">부모 컴포넌트가 받는 값들</Typography> | ||
<Typography> | ||
입력 값들 | ||
<br /> | ||
{`1번째 InputText : ${firstText}`} | ||
<br /> | ||
{`2번째 InputText : ${secondText}`} | ||
<br /> | ||
{`1번째 ItemNumberInput : ${firstItemNumber}`} | ||
<br /> | ||
{`기존 ItemNumberInput : ${solItemNumber}`} | ||
</Typography> | ||
</Card> | ||
<DaystarTextInput placeholder="Placeholder" handleChange={setFirstText} /> | ||
<DaystarTextInput | ||
placeholder="5글자 미만이면 Error" | ||
errorMessage={secondHasError ? "5글자 이상 입력해주세요" : ""} | ||
handleChange={handleSecondTextChange} | ||
/> | ||
<DaystarTextInput placeholder="Disabled" disabled /> | ||
<DaystarItemNumberInput | ||
label="Label" | ||
value={firstItemNumber} | ||
itemLimit={50} | ||
unit="개" | ||
placeholder="0개" | ||
handleChange={handleFirstItemNumberChange} | ||
/> | ||
<DaystarItemNumberInput | ||
label="Disabled" | ||
itemLimit={50} | ||
disabled | ||
unit="개" | ||
placeholder="0개" | ||
handleChange={handleFirstItemNumberChange} | ||
/> | ||
<ItemNumberInput | ||
label="기존 Component" | ||
value={solItemNumber} | ||
itemLimit={9} | ||
unit="개" | ||
placeholder="(기존) 0개" | ||
handleChange={handleSolItemNumberChange} | ||
/> | ||
</DaystarWrapper> | ||
); | ||
}; | ||
|
||
export default Daystar; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
페이지에 프레임이 하나일 때는 웬만하면 프레임 쓰지 말기!