Skip to content

Commit 0031228

Browse files
authored
Merge pull request #463 from velopert/feature/follow
Feature/follow
2 parents d8ccfa7 + 82bee81 commit 0031228

28 files changed

+412
-79
lines changed

.env.development

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
PUBLIC_URL=/
2+
3+
REACT_APP_CLIENT_V3_HOST=http://localhost:3001
4+
REACT_APP_API_HOST=http://localhost:5002/
5+
6+
REACT_APP_GRAPHQL_HOST=http://localhost:5002/
7+
REACT_APP_GRAPHQL_HOST_NOCDN=https://v2.velog.io/

.env renamed to .env.production

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
REACT_APP_API_HOST=http://localhost:5001/
21
PUBLIC_URL=/
2+
3+
REACT_APP_CLIENT_V3_HOST=http://localhost:3001
4+
REACT_APP_API_HOST=http://localhost:5002/
5+
36
REACT_APP_GRAPHQL_HOST=https://v2cdn.velog.io/
47
REACT_APP_GRAPHQL_HOST_NOCDN=https://v2.velog.io/

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ jspm_packages
2929

3030
# Serverless directories
3131
.serverless
32-
.webpack
32+
.webpack

src/components/auth/AuthSocialButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const AuthSocialButton: React.FC<AuthSocialButtonProps> = ({
6262
const host =
6363
process.env.NODE_ENV === 'production'
6464
? process.env.REACT_APP_API_HOST
65-
: 'http://localhost:5001/';
65+
: 'http://localhost:5002/';
6666

6767
const redirectTo = `${host}api/v2/auth/social/redirect/${provider}?next=${currentPath}&isIntegrate=${
6868
isIntegrate ? 1 : 0

src/components/base/HeaderLogo.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import * as React from 'react';
22
import styled from 'styled-components';
3-
import { Link } from 'react-router-dom';
43
import { Logo, VelogIcon } from '../../static/svg';
54
import { UserLogo } from '../../modules/header';
65
import { themedPalette } from '../../lib/styles/themes';
76
import { createFallbackTitle } from '../../lib/utils';
87
import media from '../../lib/styles/media';
98
import { ellipsis } from '../../lib/styles/utils';
9+
import VLink from '../common/VLink';
1010

1111
export interface HeaderLogoProps {
1212
custom: boolean;
@@ -22,23 +22,23 @@ const HeaderLogo: React.FC<HeaderLogoProps> = ({
2222
if (!custom) {
2323
return (
2424
<HeaderLogoBlock>
25-
<a href="/">
25+
<VLink to="/">
2626
<Logo data-testid="velog-logo" className="velog-logo" />
27-
</a>
27+
</VLink>
2828
</HeaderLogoBlock>
2929
);
3030
}
3131
if (!userLogo) return <div />;
3232
if (!username) return <div />;
33-
const velogPath = `/@${username}`;
33+
const velogPath = `/@${username}/posts`;
3434
return (
3535
<HeaderLogoBlock>
36-
<VelogLogoLink href="/">
36+
<VelogLogoLink to={velogPath}>
3737
<VelogIcon />
3838
</VelogLogoLink>
39-
<Link to={velogPath} className="user-logo">
39+
<VLink to={velogPath} className="user-logo">
4040
{userLogo.title || createFallbackTitle(username)}
41-
</Link>
41+
</VLink>
4242
</HeaderLogoBlock>
4343
);
4444
};
@@ -74,7 +74,7 @@ const HeaderLogoBlock = styled.div`
7474
}
7575
`;
7676

77-
const VelogLogoLink = styled.a`
77+
const VelogLogoLink = styled(VLink)`
7878
color: inherit;
7979
8080
svg {

src/components/base/HeaderUserMenu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const HeaderUserMenu: React.FC<HeaderUserMenuProps> = ({
4444
<OutsideClickHandler onOutsideClick={onClose}>
4545
<HeaderUserMenuBlock onClick={onClose}>
4646
<div className="menu-wrapper">
47-
<HeaderUserMenuItem to={`/@${username}`}>
47+
<HeaderUserMenuItem to={`/@${username}/posts`} isMigrated={true}>
4848
내 벨로그
4949
</HeaderUserMenuItem>
5050
<div className="mobile-only">

src/components/base/HeaderUserMenuItem.tsx

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,20 @@ import * as React from 'react';
22
import styled from 'styled-components';
33
import { Link } from 'react-router-dom';
44
import { themedPalette } from '../../lib/styles/themes';
5+
import VLink from '../common/VLink';
56

67
const WrapperLink = styled(Link)`
78
display: block;
89
color: inherit;
910
text-decoration: none;
1011
`;
1112

13+
const WrapperVLink = styled(VLink)`
14+
display: block;
15+
color: inherit;
16+
text-decoration: none;
17+
`;
18+
1219
const HeaderUserMenuItemBlock = styled.div`
1320
color: ${themedPalette.text1};
1421
padding: 0.75rem 1rem;
@@ -24,25 +31,38 @@ const HeaderUserMenuItemBlock = styled.div`
2431
interface HeaderUserMenuItemProps {
2532
to?: string;
2633
onClick?: () => void;
34+
isMigrated?: boolean;
2735
}
2836

2937
const HeaderUserMenuItem: React.FC<HeaderUserMenuItemProps> = ({
3038
children,
3139
to,
3240
onClick,
41+
isMigrated = false,
3342
}) => {
3443
const jsx = (
3544
<HeaderUserMenuItemBlock onClick={onClick}>
3645
{children}
3746
</HeaderUserMenuItemBlock>
3847
);
39-
return to ? (
40-
<WrapperLink to={to} style={{ display: 'block' }}>
41-
{jsx}
42-
</WrapperLink>
43-
) : (
44-
jsx
45-
);
48+
49+
if (to && !isMigrated) {
50+
return (
51+
<WrapperLink to={to} style={{ display: 'block' }}>
52+
{jsx}
53+
</WrapperLink>
54+
);
55+
}
56+
57+
if (to && isMigrated) {
58+
return (
59+
<WrapperVLink to={to} style={{ display: 'block' }}>
60+
{jsx}
61+
</WrapperVLink>
62+
);
63+
}
64+
65+
return jsx;
4666
};
4767

4868
export default HeaderUserMenuItem;

src/components/common/FlatPostCard.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import media from '../../lib/styles/media';
1414
import PrivatePostLabel from './PrivatePostLabel';
1515
import optimizeImage from '../../lib/optimizeImage';
1616
import { LikeIcon } from '../../static/svg';
17+
import VLink from './VLink';
1718

1819
const PostCardBlock = styled.div`
1920
padding-top: 4rem;
@@ -150,7 +151,7 @@ const FlatPostCard = ({ post, hideUser }: PostCardProps) => {
150151
};
151152

152153
const url = `/@${post.user.username}/${post.url_slug}`;
153-
const velogUrl = `/@${post.user.username}`;
154+
const velogUrl = `/@${post.user.username}/posts`;
154155

155156
if (!post.user.profile) {
156157
console.log(post);
@@ -159,17 +160,17 @@ const FlatPostCard = ({ post, hideUser }: PostCardProps) => {
159160
<PostCardBlock onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave}>
160161
{!hideUser && (
161162
<div className="user-info">
162-
<Link to={velogUrl}>
163+
<VLink to={velogUrl}>
163164
<img
164165
src={optimizeImage(
165166
post.user.profile?.thumbnail || userThumbnail,
166167
120,
167168
)}
168169
alt="thumbnail"
169170
/>
170-
</Link>
171+
</VLink>
171172
<div className="username">
172-
<Link to={`/@${post.user.username}`}>{post.user.username}</Link>
173+
<VLink to={`${velogUrl}`}>{post.user.username}</VLink>
173174
</div>
174175
</div>
175176
)}

0 commit comments

Comments
 (0)