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

Commit

Permalink
Resolves #100
Browse files Browse the repository at this point in the history
  • Loading branch information
Dylan committed Dec 18, 2019
1 parent 2a1ca4f commit 8cd4c2e
Showing 1 changed file with 15 additions and 14 deletions.
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

0 comments on commit 8cd4c2e

Please sign in to comment.