-
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
[4주차-ts] Search BAR with TS #7
base: main
Are you sure you want to change the base?
Changes from 1 commit
9eccd76
efa9ab0
144a906
3b7e71e
81fb754
fa563f5
0bda0df
ed7ea6b
48dbda3
4f3a2bb
57051ed
f6d222f
a2e97b9
ee8befe
3a4d32c
a6f7a40
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 |
---|---|---|
@@ -1,16 +1,18 @@ | ||
import React from 'react'; | ||
import { StyledRoot, StoreName, StoreAddress, StorePhoneNumber } from './articleStyle'; | ||
import { Result } from "../../type/result"; | ||
import { StyledRoot, StoreName, StoreAddress, StorePhoneNumber } from "./articleStyle"; | ||
|
||
const StoreArticle = props => { | ||
return ( | ||
<StyledRoot> | ||
<StoreName href={props.placeUrl} target="_blank" rel="noreferrer"> | ||
{props.placeName} | ||
</StoreName> | ||
<StoreAddress>{props.distance ? `${props.distance} m` : props.roadAddressName}</StoreAddress> | ||
<StorePhoneNumber>{props.phone ? props.phone : '전화번호 없음'}</StorePhoneNumber> | ||
</StyledRoot> | ||
); | ||
const StoreArticle = (props: Result) => { | ||
const { place_url, place_name, road_address_name, distance, phone } = props; | ||
|
||
return ( | ||
<StyledRoot> | ||
<StoreName href={place_url} target="_blank" rel="noreferrer"> | ||
{place_name} | ||
</StoreName> | ||
<StoreAddress>{distance ? `${distance} m` : road_address_name}</StoreAddress> | ||
<StorePhoneNumber>{phone ? phone : "전화번호 없음"}</StorePhoneNumber> | ||
</StyledRoot> | ||
); | ||
}; | ||
|
||
export default StoreArticle; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export interface Result { | ||
id?: number; | ||
place_url?: string; | ||
place_name?: string; | ||
road_address_name?: string; | ||
distance?: string; | ||
phone?: string; | ||
Comment on lines
+2
to
+7
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. 모두 옵셔널로 타입지정 해준 이유가 있을까요 ?? 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. 그러게!!!!!!!!머야머야 왜머야!!!!!! 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. 옵셔널로 안주니까 에러가 떠서 옵셔널로 줬어유! 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. 나니요....! 왜그러지 |
||
} |
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.
잘 지정한거 아니에여?!!!