Skip to content

Commit bafb7d8

Browse files
authored
Merge pull request #177 from prgrms-web-devcourse/develop
배포
2 parents c22b174 + 2826c23 commit bafb7d8

File tree

24 files changed

+271
-58
lines changed

24 files changed

+271
-58
lines changed

public/assets/error.svg

Lines changed: 4 additions & 0 deletions
Loading

src/components/base/LinkStrong/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ interface Props {
1010

1111
const LinkStrong = ({ href, children }: Props) => (
1212
<Link href={href} passHref>
13-
<Strong>{children}</Strong>
13+
<a>
14+
<Strong>{children}</Strong>
15+
</a>
1416
</Link>
1517
);
1618

src/components/base/Tab/TabItem.tsx

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { useNavigationContext } from "@contexts/hooks";
12
import styled from "@emotion/styled";
23
import Text from "../Text";
34

@@ -9,8 +10,14 @@ interface Props {
910
}
1011

1112
const TabItem = ({ title, index, active = false, ...props }: Props) => {
13+
const { navigationProps } = useNavigationContext();
14+
1215
return (
13-
<TabItemWrapper active={active} {...props}>
16+
<TabItemWrapper
17+
active={active}
18+
isBackgroundTransparent={navigationProps.isTopTransparent}
19+
{...props}
20+
>
1421
<Text strong={active}>{title}</Text>
1522
</TabItemWrapper>
1623
);
@@ -20,14 +27,28 @@ interface TabItemWrapperProps {
2027
active?: boolean;
2128
}
2229

23-
const TabItemWrapper = styled.div<TabItemWrapperProps>`
30+
const TabItemWrapper = styled.div<{
31+
active?: boolean;
32+
isBackgroundTransparent: boolean;
33+
}>`
2434
flex-grow: 1;
2535
display: inline-flex;
2636
align-items: center;
2737
justify-content: center;
2838
width: 140px;
29-
height: 40px;
39+
height: 50px;
3040
cursor: pointer;
41+
background: rgba(
42+
255,
43+
255,
44+
255,
45+
${({ isBackgroundTransparent }) => (isBackgroundTransparent ? 0 : 1)}
46+
);
47+
transition: background 200ms;
48+
49+
:hover {
50+
background: ${({ theme }) => theme.colors.gray200};
51+
}
3152
`;
3253

3354
TabItem.defaultProps = {

src/components/base/Tab/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ const Tab = ({
6666

6767
const TabItemContainer = styled.div`
6868
display: flex;
69+
position: sticky;
70+
align-self: flex-start;
71+
box-shadow: ${({ theme }) => theme.boxShadows.sm};
72+
top: 56px;
6973
`;
7074

7175
const childrenToArray = (children: ReactNode, types: "Tab.Item") => {

src/components/domain/BottomFixedButton/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ const BottomFixedButton: React.FC<Props> = ({
4141
<Background bottom={bottom} custom={custom} style={containerStyle}>
4242
{iconButton && iconButton.href ? (
4343
<Link href={iconButton.href} passHref>
44-
<IconButton name={iconButton.icon} />
44+
<a>
45+
<IconButton name={iconButton.icon} />
46+
</a>
4547
</Link>
4648
) : (
4749
iconButton && <IconButton name={iconButton.icon} />

src/components/domain/BottomNavigtion/NavIcon/index.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ const NavIcon = ({ href, iconName, pageType }: Props) => {
1616

1717
return (
1818
<Link href={href} key={href} passHref>
19-
<Icon
20-
name={iconName}
21-
size={24}
22-
color={currentPage === pageType ? "black" : "#cfcfcf"}
23-
/>
19+
<a>
20+
<Icon
21+
name={iconName}
22+
size={24}
23+
color={currentPage === pageType ? "black" : "#cfcfcf"}
24+
/>
25+
</a>
2426
</Link>
2527
);
2628
};

src/components/domain/CourtItem/ChatLink.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ interface Props {
99
const ChatButton: React.FC<Props> = ({ courtId }) => {
1010
return (
1111
<Link href={`/chat/courts/${courtId}`} passHref>
12-
<IconButton name="message-square" />
12+
<a>
13+
<IconButton name="message-square" />
14+
</a>
1315
</Link>
1416
);
1517
};
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import { Button, Icon, Image, Spacer, Text } from "@components/base";
2+
import styled from "@emotion/styled";
3+
import Link from "next/link";
4+
import React, { CSSProperties } from "react";
5+
6+
interface Props {
7+
title: string;
8+
description: string;
9+
buttonTitle?: string;
10+
style?: CSSProperties;
11+
}
12+
13+
const ErrorMessage = ({ title, description, buttonTitle, style }: Props) => {
14+
return (
15+
<WrapperSpacer gap="base" type="vertical" style={style}>
16+
<Image src={"/assets/error.svg"} alt="error" />
17+
<Spacer gap="xxs" type="vertical" style={{ textAlign: "center" }}>
18+
<Text size="md" block strong>
19+
{title}
20+
</Text>
21+
<TextGray size="xs">{description}</TextGray>
22+
</Spacer>
23+
<Link href="/courts" passHref>
24+
<SearchButton fullWidth>
25+
<SearchIcon name="map" size="sm" color="white" />
26+
{buttonTitle}
27+
</SearchButton>
28+
</Link>
29+
<div style={{ height: 40 }}></div>
30+
</WrapperSpacer>
31+
);
32+
};
33+
34+
export default ErrorMessage;
35+
36+
const TextGray = styled(Text)`
37+
color: ${({ theme }) => theme.colors.gray500};
38+
`;
39+
40+
const SearchButton = styled(Button)`
41+
display: flex;
42+
justify-content: center;
43+
align-items: center;
44+
`;
45+
46+
const SearchIcon = styled(Icon)`
47+
margin-right: 5px;
48+
`;
49+
50+
const WrapperSpacer = styled(Spacer)`
51+
height: 80%;
52+
align-items: center;
53+
justify-content: center;
54+
`;

src/components/domain/FollowListItem/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@ import React, { CSSProperties } from "react";
22
import styled from "@emotion/styled";
33
import type { ReactNode } from "react";
44
import { Avatar, Button, Spacer, Text } from "@components/base";
5+
import { LinkAvatar } from "@components/domain";
56

67
interface Props {
78
children: ReactNode;
89
className?: string;
910
style?: CSSProperties;
1011
src: string;
1112
isFollowed: boolean;
13+
userId: number;
1214
}
1315
// 아바타 + 이름 + 버튼
1416

@@ -18,6 +20,7 @@ const FollowListItem: React.FC<Props> = ({
1820
style,
1921
src,
2022
isFollowed,
23+
userId,
2124
}) => {
2225
return (
2326
<ListItem className={className} style={style}>
@@ -27,7 +30,7 @@ const FollowListItem: React.FC<Props> = ({
2730
alignItems: "center",
2831
}}
2932
>
30-
<Avatar shape="circle" size={36} src={src} />
33+
<LinkAvatar size={36} imageUrl={src} userId={userId} />
3134
<Text size="base" strong>
3235
{children}
3336
</Text>

src/components/domain/LinkAvatar/index.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,19 @@ const getSize = (size: Size) => {
2020
interface Props {
2121
userId: string | number;
2222
imageUrl: string;
23-
size?: Size;
23+
size?: Size | number;
2424
}
2525

2626
const LinkAvatar = ({ userId, imageUrl, size = "middle" }: Props) => {
2727
return (
2828
<Link href={`/user/${userId || 1}`} passHref>
29-
<Avatar size={getSize(size)} src={imageUrl} shape="circle" />
29+
<a>
30+
<Avatar
31+
size={typeof size === "number" ? size : getSize(size)}
32+
src={imageUrl}
33+
shape="circle"
34+
/>
35+
</a>
3036
</Link>
3137
);
3238
};

0 commit comments

Comments
 (0)