Skip to content

Feature/follow #463

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

Merged
merged 33 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
bad2b6c
feat: handle port number
winverse Jul 9, 2023
7c8a8a6
feat: add Vlink
winverse Jul 14, 2023
be404b2
feat: add redirect to V3 client host in main page
winverse Aug 23, 2023
b5600d4
feat: redirect to v3 client host
winverse Aug 30, 2023
3fc5a34
Merge remote-tracking branch 'origin/master' into feature/prepare-for-v3
winverse Aug 30, 2023
71fd338
chore: remove if condition in main page
winverse Aug 30, 2023
aa496a4
chore: change css
winverse Sep 5, 2023
7bf0959
Merge remote-tracking branch 'origin/feature/prepare-for-v3' into fea…
winverse Sep 5, 2023
99e5314
chore: clean up env
winverse Sep 8, 2023
766074e
feat: Implement follow button in Post page
winverse Sep 13, 2023
0d89c22
styles: change postFollowButton css
winverse Sep 13, 2023
192bd57
feat: Add followed value when read post
winverse Sep 14, 2023
9bb8b66
feat: connect to follow api
winverse Sep 14, 2023
6271e1d
feat: Add follow feature to post view component
winverse Sep 14, 2023
834e79a
fix: change email bug fix
winverse Sep 25, 2023
24ac52c
refactor: change email
winverse Sep 27, 2023
26ad9ef
fix: naming convention
winverse Sep 27, 2023
429b8c7
feat: hide follow button by post owner
winverse Oct 4, 2023
954b376
chore: handle env
winverse Oct 23, 2023
4ad11ff
Merge remote-tracking branch 'origin/fix/redirect-new-home-onlogin' i…
winverse Oct 23, 2023
e402a0f
refactor: follow
winverse Oct 29, 2023
734107a
Merge branch 'fix/follow' into feature/follow&feed
winverse Oct 30, 2023
65e739e
chore: change logo href
winverse Oct 30, 2023
2e46826
fix: resolve eslint error
winverse Oct 30, 2023
96e5cde
fix: follow button style
winverse Nov 9, 2023
7198295
feat: apply VLink to Header
winverse Nov 9, 2023
5317999
feat: implement follow button in userProfile component
winverse Nov 28, 2023
766b5aa
chore: rename follow button component
winverse Nov 28, 2023
d2d553b
feat: apply vlink to the velog page
winverse Nov 28, 2023
5a51723
fix: update follow button
winverse Nov 29, 2023
5d3030c
fix: follow button background color in dark
winverse Dec 4, 2023
11cbfde
Merge branch 'master' into feature/follow
velopert Dec 22, 2023
82bee81
fix: redirect from ssr, and add canonical
velopert Dec 22, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
PUBLIC_URL=/

REACT_APP_CLIENT_V3_HOST=http://localhost:3001
REACT_APP_API_HOST=http://localhost:5002/

REACT_APP_GRAPHQL_HOST=http://localhost:5002/
REACT_APP_GRAPHQL_HOST_NOCDN=https://v2.velog.io/
5 changes: 4 additions & 1 deletion .env → .env.production
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
REACT_APP_API_HOST=http://localhost:5001/
PUBLIC_URL=/

REACT_APP_CLIENT_V3_HOST=http://localhost:3001
REACT_APP_API_HOST=http://localhost:5002/

REACT_APP_GRAPHQL_HOST=https://v2cdn.velog.io/
REACT_APP_GRAPHQL_HOST_NOCDN=https://v2.velog.io/
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jspm_packages

# Serverless directories
.serverless
.webpack
.webpack
2 changes: 1 addition & 1 deletion src/components/auth/AuthSocialButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const AuthSocialButton: React.FC<AuthSocialButtonProps> = ({
const host =
process.env.NODE_ENV === 'production'
? process.env.REACT_APP_API_HOST
: 'http://localhost:5001/';
: 'http://localhost:5002/';

const redirectTo = `${host}api/v2/auth/social/redirect/${provider}?next=${currentPath}&isIntegrate=${
isIntegrate ? 1 : 0
Expand Down
16 changes: 8 additions & 8 deletions src/components/base/HeaderLogo.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import * as React from 'react';
import styled from 'styled-components';
import { Link } from 'react-router-dom';
import { Logo, VelogIcon } from '../../static/svg';
import { UserLogo } from '../../modules/header';
import { themedPalette } from '../../lib/styles/themes';
import { createFallbackTitle } from '../../lib/utils';
import media from '../../lib/styles/media';
import { ellipsis } from '../../lib/styles/utils';
import VLink from '../common/VLink';

export interface HeaderLogoProps {
custom: boolean;
Expand All @@ -22,23 +22,23 @@ const HeaderLogo: React.FC<HeaderLogoProps> = ({
if (!custom) {
return (
<HeaderLogoBlock>
<a href="/">
<VLink to="/">
<Logo data-testid="velog-logo" className="velog-logo" />
</a>
</VLink>
</HeaderLogoBlock>
);
}
if (!userLogo) return <div />;
if (!username) return <div />;
const velogPath = `/@${username}`;
const velogPath = `/@${username}/posts`;
return (
<HeaderLogoBlock>
<VelogLogoLink href="/">
<VelogLogoLink to={velogPath}>
<VelogIcon />
</VelogLogoLink>
<Link to={velogPath} className="user-logo">
<VLink to={velogPath} className="user-logo">
{userLogo.title || createFallbackTitle(username)}
</Link>
</VLink>
</HeaderLogoBlock>
);
};
Expand Down Expand Up @@ -74,7 +74,7 @@ const HeaderLogoBlock = styled.div`
}
`;

const VelogLogoLink = styled.a`
const VelogLogoLink = styled(VLink)`
color: inherit;

svg {
Expand Down
2 changes: 1 addition & 1 deletion src/components/base/HeaderUserMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const HeaderUserMenu: React.FC<HeaderUserMenuProps> = ({
<OutsideClickHandler onOutsideClick={onClose}>
<HeaderUserMenuBlock onClick={onClose}>
<div className="menu-wrapper">
<HeaderUserMenuItem to={`/@${username}`}>
<HeaderUserMenuItem to={`/@${username}/posts`} isMigrated={true}>
내 벨로그
</HeaderUserMenuItem>
<div className="mobile-only">
Expand Down
34 changes: 27 additions & 7 deletions src/components/base/HeaderUserMenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@ import * as React from 'react';
import styled from 'styled-components';
import { Link } from 'react-router-dom';
import { themedPalette } from '../../lib/styles/themes';
import VLink from '../common/VLink';

const WrapperLink = styled(Link)`
display: block;
color: inherit;
text-decoration: none;
`;

const WrapperVLink = styled(VLink)`
display: block;
color: inherit;
text-decoration: none;
`;

const HeaderUserMenuItemBlock = styled.div`
color: ${themedPalette.text1};
padding: 0.75rem 1rem;
Expand All @@ -24,25 +31,38 @@ const HeaderUserMenuItemBlock = styled.div`
interface HeaderUserMenuItemProps {
to?: string;
onClick?: () => void;
isMigrated?: boolean;
}

const HeaderUserMenuItem: React.FC<HeaderUserMenuItemProps> = ({
children,
to,
onClick,
isMigrated = false,
}) => {
const jsx = (
<HeaderUserMenuItemBlock onClick={onClick}>
{children}
</HeaderUserMenuItemBlock>
);
return to ? (
<WrapperLink to={to} style={{ display: 'block' }}>
{jsx}
</WrapperLink>
) : (
jsx
);

if (to && !isMigrated) {
return (
<WrapperLink to={to} style={{ display: 'block' }}>
{jsx}
</WrapperLink>
);
}

if (to && isMigrated) {
return (
<WrapperVLink to={to} style={{ display: 'block' }}>
{jsx}
</WrapperVLink>
);
}

return jsx;
};

export default HeaderUserMenuItem;
9 changes: 5 additions & 4 deletions src/components/common/FlatPostCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import media from '../../lib/styles/media';
import PrivatePostLabel from './PrivatePostLabel';
import optimizeImage from '../../lib/optimizeImage';
import { LikeIcon } from '../../static/svg';
import VLink from './VLink';

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

const url = `/@${post.user.username}/${post.url_slug}`;
const velogUrl = `/@${post.user.username}`;
const velogUrl = `/@${post.user.username}/posts`;

if (!post.user.profile) {
console.log(post);
Expand All @@ -159,17 +160,17 @@ const FlatPostCard = ({ post, hideUser }: PostCardProps) => {
<PostCardBlock onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave}>
{!hideUser && (
<div className="user-info">
<Link to={velogUrl}>
<VLink to={velogUrl}>
<img
src={optimizeImage(
post.user.profile?.thumbnail || userThumbnail,
120,
)}
alt="thumbnail"
/>
</Link>
</VLink>
<div className="username">
<Link to={`/@${post.user.username}`}>{post.user.username}</Link>
<VLink to={`${velogUrl}`}>{post.user.username}</VLink>
</div>
</div>
)}
Expand Down
Loading