Skip to content

Commit 8ff36d4

Browse files
committed
Merge branch 'master' of github.com:velopert/velog-client
2 parents dd97951 + eff990e commit 8ff36d4

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

src/components/velog/UserTagVerticalList.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ function UserTagVerticalList({
2828
<Link to={`/@${username}`}>전체보기</Link>
2929
<span>({postsCount})</span>
3030
</ListItem>
31-
{tags.map(tag => (
31+
{tags.map((tag) => (
3232
<ListItem active={active === escapeForUrl(tag.name)} key={tag.id}>
33-
<Link to={`@${username}?tag=${escapeForUrl(tag.name)}`}>
33+
<Link to={`/@${username}?tag=${escapeForUrl(tag.name)}`}>
3434
{tag.name}
3535
</Link>
3636
<span>({tag.posts_count})</span>
@@ -69,7 +69,7 @@ const ListItem = styled.li<{ active?: boolean }>`
6969
text-decoration: none;
7070
&:hover {
7171
color: ${palette.gray9};
72-
${props =>
72+
${(props) =>
7373
props.active &&
7474
`
7575
color: ${palette.teal5};
@@ -81,7 +81,7 @@ const ListItem = styled.li<{ active?: boolean }>`
8181
}
8282
}
8383
84-
${props =>
84+
${(props) =>
8585
props.active &&
8686
`
8787
color: ${palette.teal5};

src/containers/auth/AuthModalContainer.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { RootState } from '../../modules';
1111
import { sendAuthEmail, SendAuthEmailResponse } from '../../lib/api/auth';
1212
import useRequest from '../../lib/hooks/useRequest';
1313
import { useLocation } from 'react-router-dom';
14+
import { toast } from 'react-toastify';
1415

1516
interface OwnProps {}
1617
interface StateProps {
@@ -49,6 +50,10 @@ const AuthModalContainer: React.FC<AuthModalContainerProps> = ({
4950

5051
const onSendAuthEmail = useCallback(
5152
async (email: string) => {
53+
if (!validateEmail(email)) {
54+
toast.error('잘못된 이메일 형식입니다.');
55+
return;
56+
}
5257
_sendAuthEmail(email);
5358
},
5459
[_sendAuthEmail],
@@ -68,8 +73,13 @@ const AuthModalContainer: React.FC<AuthModalContainerProps> = ({
6873
);
6974
};
7075

76+
function validateEmail(email: string) {
77+
const re = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
78+
return re.test(String(email).toLowerCase());
79+
}
80+
7181
export default connect<StateProps, DispatchProps, OwnProps, RootState>(
72-
state => ({
82+
(state) => ({
7383
visible: state.core.auth.visible,
7484
mode: state.core.auth.mode,
7585
}),

0 commit comments

Comments
 (0)