Skip to content
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

feature-054 : 닉네임 유효성검사 기능 추가 #114

Merged
merged 2 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
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
Binary file modified src/assets/naver-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions src/components/NicknameModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ const NicknameModal = () => {
const { createToast } = useCreateToast();

const setUserInfo = useSetRecoilState(userInfoState);
const NickNameRegex = /^[a-zA-Z0-9가-힣\s]*$/;
const testNickNameRegex = NickNameRegex.test(name);

const refreshMyInfo = async () => {
try {
Expand Down Expand Up @@ -93,6 +95,11 @@ const NicknameModal = () => {
/7(공백포함)
</InputNickNameMessage>
</TextDiv>
{!testNickNameRegex && (
<WarningMessage>
*아쉽지만,이모티콘은 사용할 수 없어요
</WarningMessage>
)}
{name ? (
<SucButton type="submit" onClick={onApply} style={{ marginTop: 12 }}>
등록하기
Expand Down Expand Up @@ -199,3 +206,10 @@ const TextDiv = styled.div`
border-radius: 12px;
margin-top: 48px;
`;

export const WarningMessage = styled.span`
align-self: flex-start;
margin: 0px 0px 12px 16px;
color: ${theme.color.red};
${theme.typography.Body3}
`;
17 changes: 6 additions & 11 deletions src/pages/SignInPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,19 +92,15 @@ const SignInPage: React.FC = () => {

const redirect_uri = `${location.origin}/social-account`; //Redirect URI
const KAKAO_KEY = '77ddf1baeb87f4a9752ed437db43cd96'; //kakao REST API KEY
const NAVER_CLIENT_ID = 'qR4Npp1ui69SCF6nAJd2';
// const NAVER_CLIENT_ID = 'qR4Npp1ui69SCF6nAJd2';
// oauth 요청 URL
const kakaoURL = `https://kauth.kakao.com/oauth/authorize?client_id=${KAKAO_KEY}&redirect_uri=${redirect_uri}&response_type=code`;
const naverURL = `https://nid.naver.com/oauth2.0/authorize?response_type=code&client_id=${NAVER_CLIENT_ID}&redirect_uri=${redirect_uri}`;
// const naverURL = `https://nid.naver.com/oauth2.0/authorize?response_type=code&client_id=${NAVER_CLIENT_ID}&redirect_uri=${redirect_uri}`;

const handleKakaoLogin = () => {
window.location.href = kakaoURL;
};

const handleNaverLogin = () => {
window.location.href = naverURL;
};

return (
<PageComponent>
<LoginTotalComponent>
Expand All @@ -122,9 +118,9 @@ const SignInPage: React.FC = () => {
계정에 로그인하고 나만의 영상 아카이빙을 시작해요
</TextDiv>

<NaverSection type="button" onClick={handleNaverLogin}>
<NaverSection type="button">
<img src={NaverLogoImage} alt="naver-logo" id="naver_id_login" />
네이버로 시작하기
네이버는 지금 준비중!
</NaverSection>

<KakaoSection type="button" onClick={handleKakaoLogin}>
Expand Down Expand Up @@ -458,13 +454,12 @@ const SocialButton = styled.button`
font-weight: bold;
font-family: 'Pretendard';
border: none;
cursor: pointer;
`;

const NaverSection = styled(SocialButton)`
margin-top: 60px;
background: #03c75a;
color: #ffffff;
background: #F3F3F3;
color: #bbbbbb;
`;

const KakaoSection = styled(SocialButton)`
Expand Down
Loading