Skip to content
This repository was archived by the owner on Mar 3, 2020. It is now read-only.

Resolves #100 #101

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
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
29 changes: 15 additions & 14 deletions velog-frontend/src/components/user/UserHead/UserHead.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const UserHead = ({ username, profile, self, following, onToggleFollow, rawTagNa
const { github, twitter, facebook, email, url } = profile.profile_links;
const hasAccount = !!(github || twitter || facebook);
const hasLink = !!(url || email);
const urlRegExr = /(http|https):\/\/([\w+?.\w+])+([a-zA-Z0-9~!@#$%^&*()_\-=+\\/?.:;',]*)?/;

return (
<div className="UserHead">
Expand All @@ -38,19 +39,19 @@ const UserHead = ({ username, profile, self, following, onToggleFollow, rawTagNa
<div className="user-info">
<section className="top">
{!self &&
following !== undefined && (
<div className="subscribe-wrapper">
{following ? (
<Button className="subscribe" theme="gray" onClick={onToggleFollow}>
구독중
</Button>
) : (
<Button className="subscribe" onClick={onToggleFollow}>
구독하기
</Button>
)}
</div>
)}
following !== undefined && (
<div className="subscribe-wrapper">
{following ? (
<Button className="subscribe" theme="gray" onClick={onToggleFollow}>
구독중
</Button>
) : (
<Button className="subscribe" onClick={onToggleFollow}>
구독하기
</Button>
)}
</div>
)}
<div className="username">@{username}</div>
</section>
<section className="profile-content">
Expand Down Expand Up @@ -87,7 +88,7 @@ const UserHead = ({ username, profile, self, following, onToggleFollow, rawTagNa
{url && (
<div className="link-line">
<LinkIcon />
<a href={url} target="_blank">
<a href={!urlRegExr.exec(url.toLowerCase()) ? `http://${url}` : url} target="_blank">
{url}
</a>
</div>
Expand Down