Skip to content

Commit 0ab7fea

Browse files
authored
release: develop-> main (#275)
2 parents a013343 + 6678fc0 commit 0ab7fea

22 files changed

Lines changed: 159 additions & 26 deletions

File tree

messages/en/common.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
"submit": "Submit",
2020
"search": "Search",
2121
"reset": "Reset",
22-
"home": "Go to home"
22+
"home": "Go to home",
23+
"share": "Share"
2324
},
2425
"navigation": {
2526
"home": "Home",

messages/ja/common.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
"submit": "送信",
2020
"search": "検索",
2121
"reset": "リセット",
22-
"home": "ホームへ"
22+
"home": "ホームへ",
23+
"share": "共有"
2324
},
2425
"loading": {
2526
"text": "読み込み中...",

messages/ko/common.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
"submit": "제출",
2020
"search": "검색",
2121
"reset": "초기화",
22-
"home": "홈으로"
22+
"home": "홈으로",
23+
"share": "공유하기"
2324
},
2425
"navigation": {
2526
"home": "",

src/components/app-bar/index.styles.ts

Lines changed: 47 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
import { css } from '@emotion/react';
22
import { theme } from '@/styles';
33

4+
const SIDE_PADDING = 16;
5+
const ACTION_BUTTON_SIZE = 24;
6+
const ACTION_BUTTON_GAP = 8;
7+
8+
const getLeftReservedWidth = (leftButton: boolean) =>
9+
SIDE_PADDING + (leftButton ? ACTION_BUTTON_SIZE : 0);
10+
11+
const getRightReservedWidth = (homeButton: boolean, rightButton: boolean) =>
12+
SIDE_PADDING +
13+
(homeButton ? ACTION_BUTTON_SIZE : 0) +
14+
(homeButton && rightButton ? ACTION_BUTTON_GAP : 0) +
15+
(rightButton ? ACTION_BUTTON_SIZE : 0);
16+
417
export const wrapper = (props: { backgroundColor: string }) => css`
518
flex-shrink: 0;
619
position: relative;
@@ -30,13 +43,32 @@ export const contents = css`
3043
padding: 8px 16px;
3144
`;
3245

33-
export const center = css`
34-
position: absolute;
35-
left: 50%;
36-
transform: translateX(-50%);
37-
38-
white-space: nowrap;
39-
`;
46+
export const center = (props: {
47+
leftButton: boolean;
48+
homeButton: boolean;
49+
rightButton: boolean;
50+
}) => {
51+
const reservedWidth =
52+
Math.max(
53+
getLeftReservedWidth(props.leftButton),
54+
getRightReservedWidth(props.homeButton, props.rightButton)
55+
) * 2;
56+
57+
return css`
58+
display: flex;
59+
align-items: center;
60+
justify-content: center;
61+
gap: 8px;
62+
position: absolute;
63+
left: 50%;
64+
transform: translateX(-50%);
65+
overflow: hidden;
66+
67+
max-width: calc(100% - ${reservedWidth}px);
68+
69+
white-space: nowrap;
70+
`;
71+
};
4072

4173
export const logoButton = css`
4274
display: inline-flex;
@@ -80,7 +112,6 @@ export const rightButtonWrapper = (props: { buttonType: string }) => css`
80112
81113
width: 24px;
82114
height: 24px;
83-
margin-left: auto;
84115
border-radius: 50%;
85116
86117
background-color: ${props.buttonType === 'styled'
@@ -95,3 +126,11 @@ export const rightButtonWrapper = (props: { buttonType: string }) => css`
95126
opacity: 0.8;
96127
}
97128
`;
129+
130+
export const rightActions = css`
131+
display: flex;
132+
align-items: center;
133+
gap: 8px;
134+
135+
margin-left: auto;
136+
`;

src/components/app-bar/index.tsx

Lines changed: 52 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ import {
66
Chevron,
77
Share,
88
ShareWhite,
9+
GnbHomeActive,
10+
GnbHomeInactive,
11+
GnbHomeWhite,
912
} from '@/icons';
1013
import { Text } from '../text';
1114
import {
@@ -15,6 +18,7 @@ import {
1518
leftButtonWrapper,
1619
rightButtonWrapper,
1720
logoButton,
21+
rightActions,
1822
} from './index.styles';
1923
import { useRouter } from 'next/router';
2024
import { useCurrentLocale } from '@/i18n/navigation';
@@ -33,6 +37,8 @@ interface Props {
3337
logo?: LogoType;
3438
onLogoClick?: () => void;
3539
backgroundColor?: BackgroundColor;
40+
homeButton?: boolean;
41+
onHomeClick?: () => void;
3642
rightButton?: boolean;
3743
rightButtonType?: RightButtonType;
3844
onRightButtonClick?: () => void;
@@ -59,6 +65,12 @@ const RIGHT_BUTTON_ICON_MAP = {
5965
share: <Share width="24px" height="24px" />,
6066
} as const;
6167

68+
const HOME_BUTTON_ICON_MAP = {
69+
white: <GnbHomeWhite width="24px" height="24px" />,
70+
styled: <GnbHomeActive width="24px" height="24px" />,
71+
dark: <GnbHomeInactive width="24px" height="24px" />,
72+
} as const;
73+
6274
const LOGO_MAP = {
6375
light: <KommaSpaceLogoWhite width="90px" height="40px" />,
6476
dark: <KommaSpaceLogo width="90px" height="40px" />,
@@ -72,6 +84,8 @@ export function AppBar({
7284
leftButton = false,
7385
buttonType = 'styled',
7486
backgroundColor = 'none',
87+
homeButton = false,
88+
onHomeClick,
7589
rightButton = false,
7690
rightButtonType = 'share',
7791
onRightButtonClick,
@@ -88,15 +102,28 @@ export function AppBar({
88102
router.push(`/${currentLocale}${ROUTES.HOME}`);
89103
};
90104

105+
const handleHomeClick = () => {
106+
if (onHomeClick) {
107+
onHomeClick();
108+
return;
109+
}
110+
router.push(`/${currentLocale}${ROUTES.HOME}`);
111+
};
112+
91113
return (
92114
<header css={wrapper({ backgroundColor: BACKGROUND_COLOR_MAP[backgroundColor] })}>
93115
<div css={contents}>
94116
{leftButton && (
95-
<button onClick={onBackClick} css={leftButtonWrapper({ buttonType })}>
117+
<button
118+
type="button"
119+
onClick={onBackClick}
120+
css={leftButtonWrapper({ buttonType })}
121+
aria-label={t('button.back')}
122+
>
96123
{BUTTON_ICON_MAP[buttonType]}
97124
</button>
98125
)}
99-
<div css={center}>
126+
<div css={center({ leftButton, homeButton, rightButton })}>
100127
{logo && (
101128
<button
102129
type="button"
@@ -113,10 +140,29 @@ export function AppBar({
113140
</Text>
114141
)}
115142
</div>
116-
{rightButton && (
117-
<button onClick={onRightButtonClick} css={rightButtonWrapper({ buttonType })}>
118-
{RIGHT_BUTTON_ICON_MAP[rightButtonType]}
119-
</button>
143+
{(homeButton || rightButton) && (
144+
<div css={rightActions}>
145+
{homeButton && (
146+
<button
147+
type="button"
148+
onClick={handleHomeClick}
149+
css={rightButtonWrapper({ buttonType })}
150+
aria-label={t('button.home')}
151+
>
152+
{HOME_BUTTON_ICON_MAP[buttonType]}
153+
</button>
154+
)}
155+
{rightButton && (
156+
<button
157+
type="button"
158+
onClick={onRightButtonClick}
159+
css={rightButtonWrapper({ buttonType })}
160+
aria-label={t('button.share')}
161+
>
162+
{RIGHT_BUTTON_ICON_MAP[rightButtonType]}
163+
</button>
164+
)}
165+
</div>
120166
)}
121167
</div>
122168
</header>

src/components/company-detail/company-review-list-content.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,18 @@ export function CompanyReviewListContent({
4040
}
4141
}, [canUseMyCountryOnly, myCountryOnly]);
4242

43+
const effectiveCountry = canUseMyCountryOnly && myCountryOnly ? country : undefined;
44+
4345
const queryParams = useMemo(
4446
() => ({
4547
companyId,
4648
// TODO: Re-enable after backend filter behavior is aligned.
4749
// with_photos: withPhotos || undefined,
4850
my_country_only: canUseMyCountryOnly && myCountryOnly ? true : undefined,
51+
country: effectiveCountry,
4952
tags: selectedTags.length > 0 ? selectedTags.join(',') : undefined,
5053
}),
51-
[companyId, canUseMyCountryOnly, myCountryOnly, selectedTags]
54+
[companyId, canUseMyCountryOnly, myCountryOnly, effectiveCountry, selectedTags]
5255
);
5356

5457
const { data, fetchNextPage, hasNextPage, isFetchingNextPage, isLoading } =

src/components/program-123-detail-view/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,7 @@ export function Program123DetailView({
494494
) : (
495495
<AppBar
496496
leftButton
497+
homeButton
497498
buttonType="dark"
498499
onBackClick={onBackClick ?? handleDefaultBackClick}
499500
backgroundColor="bg_surface1"

src/icons/GnbHomeWhite.tsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import * as React from 'react';
2+
import type { SVGProps } from 'react';
3+
4+
export const GnbHomeWhite = (props: SVGProps<SVGSVGElement>) => (
5+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" {...props}>
6+
<path
7+
stroke="#fff"
8+
strokeLinecap="round"
9+
strokeLinejoin="round"
10+
strokeWidth={2}
11+
d="M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8"
12+
/>
13+
<path
14+
stroke="#fff"
15+
strokeLinecap="round"
16+
strokeLinejoin="round"
17+
strokeWidth={2}
18+
d="M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"
19+
/>
20+
</svg>
21+
);

src/icons/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export * from './GnbCalendarActive';
4545
export * from './GnbCalendarInactive';
4646
export * from './GnbHomeActive';
4747
export * from './GnbHomeInactive';
48+
export * from './GnbHomeWhite';
4849
export * from './GnbMypageActive';
4950
export * from './GnbMypageInactive';
5051
export * from './GnbSearchActive';

src/pages/404.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default function NotFoundPage() {
1919
{isDesktop ? (
2020
<DesktopAppBar onSearchChange={() => {}} showSearch={false} />
2121
) : (
22-
<AppBar onBackClick={router.back} leftButton={true} buttonType="dark" />
22+
<AppBar onBackClick={router.back} leftButton={true} homeButton={true} buttonType="dark" />
2323
)}
2424
<div css={pageWrapper}>
2525
<div css={content}>

0 commit comments

Comments
 (0)