-
Notifications
You must be signed in to change notification settings - Fork 3
[feature] 홍보 상세페이지에 행사 위치 지도를 추가한다 #1621
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
Changes from all commits
cf13758
da42ba9
8dbe051
3b57082
5ebdeb3
b45f11c
ea954e2
3d983e3
0ea2663
a4f48e5
6a4df3d
6f2c925
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -9,6 +9,7 @@ import PromotionClubCTA from './components/detail/PromotionClubCTA/PromotionClub | |||||
| import PromotionDetailTopBar from './components/detail/PromotionDetailTopBar/PromotionDetailTopBar'; | ||||||
| import PromotionImageGallery from './components/detail/PromotionImageGallery/PromotionImageGallery'; | ||||||
| import PromotionInfoSection from './components/detail/PromotionInfoSection/PromotionInfoSection'; | ||||||
| import PromotionMapSection from './components/detail/PromotionMapSection/PromotionMapSection'; | ||||||
|
Contributor
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. 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win 새로 추가한 import는 상대 경로 대신 별칭을 쓰면 리팩터링/이동 시 안정성이 좋아집니다. 제안 diff-import PromotionMapSection from './components/detail/PromotionMapSection/PromotionMapSection';
+import PromotionMapSection from '`@/pages/PromotionPage/components/detail/PromotionMapSection/PromotionMapSection`';As per coding guidelines, Use path alias 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| import PromotionTitleSection from './components/detail/PromotionTitleSection/PromotionTitleSection'; | ||||||
| import RelatedPromotionSection from './components/detail/RelatedPromotionSection/RelatedPromotionSection'; | ||||||
| import * as Styled from './PromotionDetailPage.styles'; | ||||||
|
|
@@ -53,6 +54,7 @@ const PromotionDetailPage = () => { | |||||
| <Styled.ContentWrapper> | ||||||
| <Styled.LeftSection> | ||||||
| <PromotionInfoSection article={article} /> | ||||||
| <PromotionMapSection article={article} /> | ||||||
| <PromotionClubCTA | ||||||
| clubId={article.clubId} | ||||||
| clubName={article.clubName} | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| import styled from 'styled-components'; | ||
| import { media } from '@/styles/mediaQuery'; | ||
| import { colors } from '@/styles/theme/colors'; | ||
|
|
||
| export const Container = styled.section` | ||
| padding-top: 20px; | ||
|
|
||
| ${media.tablet} { | ||
| padding: 16px 20px 0px 20px; | ||
| } | ||
| `; | ||
|
|
||
| export const MapCard = styled.button` | ||
| padding: 0; | ||
| font: inherit; | ||
| width: 100%; | ||
| height: 189px; | ||
| border-radius: 20px; | ||
| border: 1px solid ${colors.gray[400]}; | ||
| overflow: hidden; | ||
| cursor: pointer; | ||
| background-color: #f2f2f2; | ||
|
|
||
| * { | ||
| cursor: pointer !important; | ||
| } | ||
| `; | ||
|
|
||
| export const LocationText = styled.div` | ||
| display: flex; | ||
| align-items: center; | ||
| gap: 2px; | ||
| padding: 8px 2px 0; | ||
| font-size: 14px; | ||
| color: ${colors.gray[700]}; | ||
|
|
||
| svg { | ||
| width: 18px; | ||
| height: 18px; | ||
| margin: 1px 2px 1px 0px; | ||
| color: ${colors.gray[500]}; | ||
| } | ||
|
|
||
| ${media.tablet} { | ||
| padding: 6px 2px 0; | ||
| } | ||
| `; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| import { useState } from 'react'; | ||
| import LocationIcon from '@/assets/images/icons/location_icon.svg?react'; | ||
| import MapModal from '@/components/map/MapModal/MapModal'; | ||
| import NaverMap from '@/components/map/NaverMap/NaverMap'; | ||
| import { ClubLocation } from '@/constants/clubLocation'; | ||
| import { useGetClubDetail } from '@/hooks/Queries/useClub'; | ||
| import { PromotionArticle } from '@/types/promotion'; | ||
| import * as Styled from './PromotionMapSection.styles'; | ||
|
|
||
| interface Props { | ||
| article: PromotionArticle; | ||
| } | ||
|
|
||
| const PromotionMapSection = ({ article }: Props) => { | ||
| const [isMapModalOpen, setIsMapModalOpen] = useState(false); | ||
| const { data: clubDetail } = useGetClubDetail(`@${article.clubName}`, { | ||
| enabled: isMapModalOpen, | ||
| staleTime: 60 * 60 * 1000, | ||
| gcTime: 60 * 60 * 1000, | ||
| }); | ||
|
|
||
| if (article.latitude == null || article.longitude == null) { | ||
| return null; | ||
| } | ||
|
|
||
| const location: ClubLocation = { | ||
| clubName: article.clubName, | ||
| lat: article.latitude, | ||
| lng: article.longitude, | ||
| building: article.location, | ||
| detailLocation: '', | ||
| }; | ||
|
|
||
| return ( | ||
| <> | ||
| <Styled.Container> | ||
| <Styled.MapCard onClick={() => setIsMapModalOpen(true)}> | ||
| <NaverMap location={location} /> | ||
| </Styled.MapCard> | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| <Styled.LocationText> | ||
| <LocationIcon /> | ||
| {article.location} | ||
| </Styled.LocationText> | ||
| </Styled.Container> | ||
|
|
||
| <MapModal | ||
| isOpen={isMapModalOpen} | ||
| onClose={() => setIsMapModalOpen(false)} | ||
| clubName={article.clubName} | ||
| clubLogo={clubDetail?.logo} | ||
| location={location} | ||
| bubbleText='행사 위치' | ||
| /> | ||
| </> | ||
| ); | ||
| }; | ||
|
|
||
| export default PromotionMapSection; | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
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.
🧩 Analysis chain
🏁 Script executed:
Repository: Moadong/moadong
Length of output: 308
🏁 Script executed:
Repository: Moadong/moadong
Length of output: 200
🏁 Script executed:
Repository: Moadong/moadong
Length of output: 3230
🏁 Script executed:
Repository: Moadong/moadong
Length of output: 3080
🏁 Script executed:
Repository: Moadong/moadong
Length of output: 1820
MapCard에 키보드 포커스(:focus-visible) 스타일이 누락되었습니다.
frontend/src/pages/ClubDetailPage/ClubDetailPage.styles.ts의MapCard는styled.button으로 바뀌었지만:focus-visible(또는:focus)이 없어 키보드 네비게이션 시 포커스가 시각적으로 확인되지 않습니다.♿ 포커스 상태 추가 제안
export const MapCard = styled.button` padding: 0; font: inherit; width: 100%; height: 189px; border-radius: 20px; border: 1px solid ${colors.gray[400]}; overflow: hidden; cursor: pointer; background-color: `#f2f2f2`; + + &:focus-visible { + outline: 2px solid ${colors.primary[500]}; + outline-offset: 2px; + } * { cursor: pointer !important; } `;📝 Committable suggestion
🤖 Prompt for AI Agents