-
Notifications
You must be signed in to change notification settings - Fork 117
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
[김동현] week16 #1066
The head ref may contain hidden characters: "part2-\uAE40\uB3D9\uD604-week13"
[김동현] week16 #1066
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
import "./ButtonGroup.css"; | ||
import add_icon from "../assets/svg/add.svg"; | ||
import { ButtonGroupProps } from "../types/type"; | ||
|
||
function ButtonGroup({ buttonList }: ButtonGroupProps) { | ||
if (!Array.isArray(buttonList)) { | ||
return null; | ||
} | ||
Comment on lines
+3
to
+8
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. 이렇게 early return 을 추가하는 부분 좋습니다. 이 곳 말고도 프로젝트 내 다양한 곳에 early return 추가할 부분이 있을거에요. early return 을 습관화해서 비효율적인 랜더링을 막으면 최적화에 도움이 됩니다. |
||
|
||
function ButtonGroup({ buttonList }: any) { | ||
return ( | ||
<div className="button_area"> | ||
<div className="button_list"> | ||
<button className="button_folder">전체</button> | ||
{buttonList.map((button: any) => ( | ||
{buttonList.map((button) => ( | ||
<button key={button.id} type="button" className="button_folder"> | ||
{button.name} | ||
</button> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,11 +6,11 @@ import Banner from "../../components/Banner"; | |
import SearchBar from "../../components/SearchBar"; | ||
import CardsArea from "../../components/CardsArea"; | ||
import Footer from "../../components/Footer"; | ||
import { FolderData, UserData } from "@/src/types/type"; | ||
import { FolderData, UserData } from "../../types/type"; | ||
|
||
function SharePage() { | ||
const [users, setUsers] = useState<UserData | undefined>(); | ||
const [folders, setFolders] = useState<FolderData | undefined>(); | ||
const [folders, setFolders] = useState<FolderData[]>(); | ||
// const [isLoading, setIsLoading] = useState(false); | ||
// const [error, setError] = useState(null); | ||
|
||
|
@@ -53,7 +53,7 @@ function SharePage() { | |
<Banner userName={users?.name} /> | ||
<div className="sharePage_contents"> | ||
<SearchBar /> | ||
<CardsArea foldersData={folders} /> | ||
<CardsArea folderList={folders} /> | ||
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. 명시적으로 array 관련된 값들은 ***List / ***Item 이렇게 구분해서 네이밍을 해요. 기존 Data -> List 로 변경해주셔서 더 좋네요. |
||
</div> | ||
<Footer /> | ||
</div> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,10 @@ export interface FolderData { | |
imageSource?: string; | ||
} | ||
|
||
export interface FolderProps{ | ||
folderList: FolderData[] | undefined; | ||
} | ||
|
||
export interface ButtonData { | ||
id: number; | ||
created_at: string; | ||
|
@@ -23,6 +27,11 @@ export interface ButtonData { | |
link?: any; | ||
} | ||
|
||
|
||
export interface ButtonGroupProps { | ||
buttonList: ButtonData[] | undefined; | ||
}; | ||
|
||
Comment on lines
+31
to
+34
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. 타입 추가 좋습니다. 뒤에 undefined 값은 불필요해보입니다~
|
||
export interface Icon { | ||
id: number; | ||
name: string; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,8 +13,29 @@ | |
"isolatedModules": true, | ||
"jsx": "preserve", | ||
"incremental": true, | ||
"baseUrl": ".", | ||
"paths": { | ||
"@/*": ["./*"] | ||
"api/*": [ | ||
"src/api/*" | ||
], | ||
"assets/*": [ | ||
"src/assets/*" | ||
], | ||
"components/*": [ | ||
"src/components/*" | ||
], | ||
"constants/*": [ | ||
"src/constants/*" | ||
], | ||
"pages/*": [ | ||
"src/pages/*" | ||
], | ||
"types/*":[ | ||
"src/types/*" | ||
], | ||
"util/*": [ | ||
"src/util/*" | ||
], | ||
Comment on lines
+18
to
+38
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. "@util/* 이거처럼 @ 없이 이렇게 설정을 하기도 합니다! 설정 굳! |
||
}, | ||
"typeRoots": ["./node_modules/@types", "@types"] | ||
}, | ||
|
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.
지난번 리뷰를 반영해주셨군요! 굳 👍