-
Notifications
You must be signed in to change notification settings - Fork 0
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
랜딩 페이지에 파티 리스트에 드라이버 프로필 추가 #232
+80
−6
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { memo, useCallback } from "react"; | ||
import { useNavigate } from "react-router-dom"; | ||
import { DriverData } from "@/types"; | ||
import basicProfileImage from "@/assets/images/profileImage.png"; | ||
|
||
function DriverBox({ driverId, name, profileImg, region }: DriverData) { | ||
const navigate = useNavigate(); | ||
|
||
const onClickHandler = useCallback(() => { | ||
navigate(`/driver/profile/${driverId}`); | ||
}, [driverId]); | ||
|
||
return ( | ||
<div className="bg-skyblue rounded-lg h-64"> | ||
<div className="relative h-[220px] border rounded-lg"> | ||
<img | ||
className="absolute top-0 left-0 object-cover object-center w-full h-full overflow-hidden rounded-lg" | ||
src={profileImg || basicProfileImage} | ||
alt={name} | ||
/> | ||
<div className="absolute top-0 left-0 flex flex-col items-center justify-end w-full h-full text-base text-darkgray pb-3"> | ||
<button | ||
className="h-9 text-white rounded-full text-xs font-bold w-32 bg-primary" | ||
onClick={onClickHandler} | ||
> | ||
프로필 | ||
</button> | ||
</div> | ||
</div> | ||
<div className="py-1 text-center text-lg text-primary font-semibold">{`${region.length === 1 ? region : "다양한 지역"} ${name} 드라이버`}</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default memo(DriverBox); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
랜딩 페이지 드라이버 프로필은 모든 유저가 조회 가능해야 할 것 같아요.
즉, 로그인 여부 및 JWT 유효성 여부와 상관없이 항상 조회가 가능해야 합니다.
확인해보니, 백엔드에서 JWT가 없어도 조회가 가능하도록 api를 만들어주신 것 같아요.
그럼 해당 api를 호출할 때, JWT를 포함하지 않아도 되기 때문에 두번째 파라미터를
false
로 바꿔주시면 좋을 것 같아요.두번째 파라미터는 api 호출시 JWT를 함께 보낼지에 대한 여부입니다!