react-icons/ai#AiOutlineWarning JavaScript Examples
The following examples show how to use
react-icons/ai#AiOutlineWarning.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LoginModal.js From airdnd-frontend with MIT License | 4 votes |
LoginModal = ({
modalVisible,
form,
invalid,
refObj,
loading,
result,
isPwdShown,
onFormChange,
cleanupModal,
openSignupMenuModal,
closeModal,
onToggleShowPwd,
handleSubmit,
}) => {
const { email, pwd } = form;
const { emailRef, pwdRef } = refObj;
return (
<StLoginModal
modalState={modalVisible}
header
width="570px"
height="545px"
title="로그인"
setModalState={closeModal}
cleanup={cleanupModal}
>
<StLoginModalWrapper>
<GoogleLogin
clientId={process.env.REACT_APP_GOOGLE_LOGIN_API_KEY}
cookiePolicy={'single_host_origin'}
onSuccess={res => console.log(res)}
onFailure={res => console.log(res)}
render={() => (
<StFacebookButton>
<FaFacebookF />
<StButtonText>페이스북 계정으로 로그인</StButtonText>
</StFacebookButton>
)}
></GoogleLogin>
<GoogleLogin
clientId={process.env.REACT_APP_GOOGLE_LOGIN_API_KEY}
cookiePolicy={'single_host_origin'}
onSuccess={res => console.log(res)}
onFailure={res => console.log(res)}
render={() => (
<StGoogleButton>
<FcGoogle />
<StButtonText>구글 계정으로 로그인</StButtonText>
</StGoogleButton>
)}
></GoogleLogin>
<StDividerLine />
<StDividerText>또는</StDividerText>
<StLoginForm onSubmit={handleSubmit}>
{result && result !== 'Success' && (
<StResultWrapper result={result}>
<StErrorWrapper>
<AiOutlineWarning></AiOutlineWarning>
</StErrorWrapper>
<StResultTextWrapper>
{result === 'NoId' && (
<StResultText>
이 이메일 주소와 연결된 계정이 없습니다. 다른 이메일 주소를
사용해 보세요.
</StResultText>
)}
{result === 'WrongPwd' && (
<StResultText>비밀번호가 틀립니다.</StResultText>
)}
</StResultTextWrapper>
</StResultWrapper>
)}
<StInputWrapper>
<StInput
value={email}
onChange={({ target: { value } }) => onFormChange('email', value)}
focusBorderColor
placeholder="이메일 주소"
ref={emailRef}
isInvalid={invalid.email}
></StInput>
<RiMailLine />
{email.length === 0 && invalid.email && (
<StValidationText isInvalid={invalid.email}>
이메일을 입력하세요.
</StValidationText>
)}
{email.length > 0 && invalid.email && (
<StValidationText isInvalid={invalid.email}>
이메일 형식이 맞지 않습니다.
</StValidationText>
)}
</StInputWrapper>
<StInputWrapper name="password">
<StInput
type={isPwdShown ? 'text' : 'password'}
value={pwd}
onChange={({ target: { value } }) => onFormChange('pwd', value)}
focusBorderColor
placeholder="비밀번호"
ref={pwdRef}
isInvalid={invalid.pwd}
></StInput>
<RiLock2Line />
{pwd.length === 0 && invalid.pwd && (
<StValidationText isInvalid={invalid.pwd}>
비밀번호를 입력하세요.
</StValidationText>
)}
{pwd.length > 0 && invalid.pwd && (
<StValidationText isInvalid={invalid.pwd}>
비밀번호는 최소 8글자 이상이어야 합니다. 다시 시도해 주세요.
</StValidationText>
)}
</StInputWrapper>
<StShowPwdButtonWrapper>
<StShowPwdButton onClick={onToggleShowPwd}>
{isPwdShown ? '비밀번호 숨기기' : '비밀번호 보이기'}
</StShowPwdButton>
</StShowPwdButtonWrapper>
<StSubmitButton border="none" type="submit" disabled={loading}>
{loading ? <StSubmitLoader /> : '로그인하기'}
</StSubmitButton>
</StLoginForm>
<StDividerLine />
<StSignupButtonWrapper>
<StSignupText>에어비앤비 계정이 없으세요? </StSignupText>
<StSignupButton btnType="color" onClick={openSignupMenuModal}>
회원가입하기
</StSignupButton>
</StSignupButtonWrapper>
</StLoginModalWrapper>
</StLoginModal>
);
}
Example #2
Source File: SignupEmailModal.js From airdnd-frontend with MIT License | 4 votes |
SignupEmailModal = ({
modalVisible,
form,
invalid,
refObj,
range,
loading,
result,
isPwdFocused,
openLoginModal,
closeModal,
cleanupModal,
onFormChange,
handleSubmit,
onPwdFocused,
onGoogleLoginSuccess,
onGoogleLoginFailure,
}) => {
const {
email,
firstName,
lastName,
pwd,
birthMonth,
birthDay,
birthYear,
} = form;
const {
pwdValidation: { pwdLevel, pwdLength, pwdContain, pwdCase },
} = invalid;
const {
emailRef,
firstNameRef,
lastNameRef,
pwdRef,
birthMonthRef,
birthDayRef,
birthYearRef,
} = refObj;
return (
<StSignupEmailModal
modalState={modalVisible}
header
title="회원가입"
width="570px"
height="670px"
setModalState={closeModal}
cleanup={cleanupModal}
>
<StSignupFormWrapper>
<StSignupForm onSubmit={handleSubmit}>
{result && result !== 'Success' && (
<StResultWrapper result={result}>
<StErrorWrapper>
<AiOutlineWarning></AiOutlineWarning>
</StErrorWrapper>
<StResultTextWrapper>
{result === 'AlreadyEmail' && (
<StResultText>이메일이 이미 존재합니다.</StResultText>
)}
{result === 'Error' && (
<StResultText>회원가입에 실패하였습니다.</StResultText>
)}
</StResultTextWrapper>
</StResultWrapper>
)}
<StInputWrapper>
<StInput
value={email}
onChange={({ target: { value } }) => onFormChange('email', value)}
focusBorderColor
placeholder="이메일 주소"
ref={emailRef}
isInvalid={invalid.email}
></StInput>
<RiMailLine />
{email.length === 0 && invalid.email && (
<StValidationText isInvalid={invalid.email}>
이메일을 입력하세요.
</StValidationText>
)}
{email.length > 0 && invalid.email && result !== 'AlreadyEmail' && (
<StValidationText isInvalid={invalid.email}>
이메일 형식이 맞지 않습니다.
</StValidationText>
)}
</StInputWrapper>
<StInputWrapper>
<StInput
value={firstName}
onChange={({ target: { value } }) =>
onFormChange('firstName', value)
}
focusBorderColor
placeholder="이름 (예: 길동)"
ref={firstNameRef}
isInvalid={invalid.firstName}
></StInput>
<RiUserLine />
{firstName.length === 0 && invalid.firstName && (
<StValidationText isInvalid={invalid.firstName}>
이름을 입력하세요.
</StValidationText>
)}
{firstName.length > 35 && invalid.firstName && (
<StValidationText isInvalid={invalid.firstName}>
이름을 입력할 수 있는 최대 글자 수는 35자입니다. 다시
시도하세요.
</StValidationText>
)}
{firstName.length !== 0 &&
firstName.length < 35 &&
invalid.firstName && (
<StValidationText isInvalid={invalid.firstName}>
이름에 유효한 글자를 입력하세요.
</StValidationText>
)}
</StInputWrapper>
<StInputWrapper>
<StInput
value={lastName}
onChange={({ target: { value } }) =>
onFormChange('lastName', value)
}
focusBorderColor
placeholder="성 (예: 홍)"
ref={lastNameRef}
isInvalid={invalid.lastName}
></StInput>
<RiUserLine />
{lastName.length === 0 && invalid.lastName && (
<StValidationText isInvalid={invalid.lastName}>
성을 입력하세요.
</StValidationText>
)}
{lastName.length > 35 && invalid.lastName && (
<StValidationText isInvalid={invalid.lastName}>
성을 입력할 수 있는 최대 글자 수는 35자입니다. 다시 시도하세요.
</StValidationText>
)}
{lastName.length !== 0 &&
lastName.length < 35 &&
invalid.lastName && (
<StValidationText isInvalid={invalid.lastName}>
성에 유효한 글자를 입력하세요.
</StValidationText>
)}
</StInputWrapper>
<StInputWrapper name="password">
<StInput
type="password"
value={pwd}
onChange={({ target: { value } }) => onFormChange('pwd', value)}
onFocus={() => onPwdFocused(true)}
focusBorderColor
placeholder="비밀번호 설정하기"
ref={pwdRef}
isInvalid={invalid.pwd}
></StInput>
<RiEyeCloseLine />
{pwd.length === 0 && invalid.pwd && (
<StValidationText isInvalid={invalid.pwd}>
비밀번호를 입력하세요.
</StValidationText>
)}
{pwd.length > 0 && invalid.pwd && (
<StValidationText isInvalid={invalid.pwd}>
비밀번호 형식이 맞지 않습니다.
</StValidationText>
)}
{isPwdFocused && (
<StPwdValidationList>
<StPwdValidationItem isPwdValid={pwdLevel}>
{pwdLevel >= 1 ? <MdCheck /> : <MdClose />}
<StPwdValidationText>
비밀번호 보안 수준:
<StPwdValidationLevelText pwdLevel={pwdLevel}>
{pwdLevel
? pwdLevel === 2
? ' 강함'
: ' 보통'
: ' 약함'}
</StPwdValidationLevelText>
</StPwdValidationText>
</StPwdValidationItem>
{pwdLevel === 0 && (
<>
<StPwdValidationItem isPwdValid={pwdContain}>
{pwdContain ? <MdCheck /> : <MdClose />}
<StPwdValidationText>
비밀번호에 본인 이름이나 이메일 주소를 포함할 수
없습니다.
</StPwdValidationText>
</StPwdValidationItem>
<StPwdValidationItem isPwdValid={pwdLength}>
{pwdLength ? <MdCheck /> : <MdClose />}
<StPwdValidationText>최소 8자</StPwdValidationText>
</StPwdValidationItem>
<StPwdValidationItem isPwdValid={pwdCase}>
{pwdCase ? <MdCheck /> : <MdClose />}
<StPwdValidationText>
숫자나 기호를 포함하세요
</StPwdValidationText>
</StPwdValidationItem>
</>
)}
</StPwdValidationList>
)}
</StInputWrapper>
<StBirthDayTitle>생일</StBirthDayTitle>
<StBirthDayText>
만 18세 이상의 성인만 회원으로 가입할 수 있습니다. 생일은 다른
에어비앤비 이용자에게 공개되지 않습니다.
</StBirthDayText>
<StBirthDayWrapper>
<StBirthDayDropDown
name="birthMonth"
width="40%"
title="월"
options={range(1, 12, 1)}
outline
value={birthMonth}
isInvalid={invalid.birthMonth}
onChange={({ target: { value } }) =>
onFormChange('birthMonth', value)
}
ref={birthMonthRef}
></StBirthDayDropDown>
<StBirthDayDropDown
name="birthDay"
width="22%"
title="일"
options={range(1, 31, 1)}
outline
value={birthDay}
isInvalid={invalid.birthDay}
onChange={({ target: { value } }) =>
onFormChange('birthDay', value)
}
ref={birthDayRef}
></StBirthDayDropDown>
<StBirthDayDropDown
name="birthYear"
width="33%"
title="년"
options={range(1900, new Date().getFullYear(), 1).reverse()}
outline
value={birthYear}
isInvalid={invalid.birthYear}
onChange={({ target: { value } }) =>
onFormChange('birthYear', value)
}
ref={birthYearRef}
></StBirthDayDropDown>
</StBirthDayWrapper>
{(isNaN(birthMonth) || isNaN(birthDay) || isNaN(birthYear)) &&
(invalid.birthMonth || invalid.birthDay || invalid.birthYear) && (
<StValidationText>
계속하시려면 생일을 선택하세요.
</StValidationText>
)}
{!isNaN(birthMonth) &&
!isNaN(birthDay) &&
!isNaN(birthYear) &&
(invalid.birthMonth || invalid.birthDay || invalid.birthYear) && (
<StValidationText>
입력하신 생일을 다시 한번 확인하세요. 올바른 날짜 형식이
아닙니다.
</StValidationText>
)}
<StSubmitButton isLoading={loading} border="none" type="submit">
{loading ? <StSubmitLoader /> : '가입하기'}
</StSubmitButton>
</StSignupForm>
<StDividerLine />
<StLoginButtonWrapper>
<StLoginText>이미 에어비앤비 계정이 있나요?</StLoginText>
<StLoginButton
isLoading={loading}
btnType="color"
onClick={openLoginModal}
>
로그인
</StLoginButton>
</StLoginButtonWrapper>
</StSignupFormWrapper>
</StSignupEmailModal>
);
}