-
Notifications
You must be signed in to change notification settings - Fork 31
[차경훈] sprint8 #174
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
The head ref may contain hidden characters: "React-\uCC28\uACBD\uD6C8-sprint8"
[차경훈] sprint8 #174
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| import React, { ChangeEvent, FocusEvent } from "react"; | ||
|
|
||
| interface AuthFormFieldProps { | ||
| id: string; | ||
| label: string; | ||
| name: string; | ||
| type: "email" | "text" | "password"; | ||
| placeholder: string; | ||
| value: string; | ||
| onChange: (e: ChangeEvent<HTMLInputElement>) => void; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. onChange: ChangeEventHandler<HTMLInputElement>;이렇게 쓰실 수 있어요! |
||
| onBlur?: (e: FocusEvent<HTMLInputElement>) => void; // onBlur는 선택적 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 위와 마찬가지 입니다! onBlur?: FocusEventHandler<HTMLInputElement>; |
||
| error?: string; // 에러 메시지도 선택적 | ||
| showPasswordToggle?: boolean; // 비밀번호 표시/숨김 토글 여부 | ||
| showPassword?: boolean; // 현재 비밀번호 표시 상태 | ||
| onToggleShowPassword?: () => void; // 토글 함수 | ||
| } | ||
|
|
||
| const AuthFormField: React.FC<AuthFormFieldProps> = ({ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 크게 상관은 없는데.. |
||
| id, | ||
| label, | ||
| name, | ||
| type, | ||
| placeholder, | ||
| value, | ||
| onChange, | ||
| onBlur, | ||
| error, | ||
| showPasswordToggle = false, | ||
| showPassword = false, | ||
| onToggleShowPassword, | ||
| }) => { | ||
| return ( | ||
| <div className={`input-item ${error ? "input-error-active" : ""}`}> | ||
| <label htmlFor={id}>{label}</label> | ||
| <div className="input-wrapper"> | ||
| {" "} | ||
| {/* 비밀번호 토글 아이콘을 위해 wrapper 추가 */} | ||
| <input | ||
| id={id} | ||
| name={name} | ||
| type={ | ||
| showPasswordToggle && type === "password" && showPassword | ||
| ? "text" | ||
| : type | ||
| } | ||
| placeholder={placeholder} | ||
| value={value} | ||
| onChange={onChange} | ||
| onBlur={onBlur} | ||
| className={error ? "input-error" : ""} | ||
| /> | ||
| {showPasswordToggle && type === "password" && onToggleShowPassword && ( | ||
| <img | ||
| src={ | ||
| showPassword | ||
| ? "/images/icons/eye-visible.svg" | ||
| : "/images/icons/eye-invisible.svg" | ||
| } | ||
| alt={showPassword ? "비밀번호 보임" : "비밀번호 숨김"} | ||
| className="toggle-password" | ||
| onClick={onToggleShowPassword} | ||
| /> | ||
| )} | ||
| </div> | ||
| {error && <p className={`error-message ${name}-error`}>{error}</p>} | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| export default AuthFormField; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import React from "react"; | ||
| import { Link as RouterLink } from "react-router-dom"; | ||
|
|
||
| // HomePage.tsx, SigninPage.tsx, SignupPage.tsx 에서 사용된 Link 타입 문제 임시 해결 | ||
| const Link: any = RouterLink; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. as RouterLink만 지워도 타입 문제는 딱히 없지 않나요!? 🤔 import { Link } from "react-router-dom"; |
||
|
|
||
| const AuthLogoLink: React.FC = () => { | ||
| return ( | ||
| <Link to="/" className="logo-home-button"> | ||
| <img src="/images/logo/logo.svg" alt="판다마켓 홈" /> | ||
| </Link> | ||
| ); | ||
| }; | ||
|
|
||
| export default AuthLogoLink; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import React from "react"; | ||
| import { Link as RouterLink } from "react-router-dom"; | ||
|
|
||
| // HomePage.tsx, SigninPage.tsx, SignupPage.tsx 에서 사용된 Link 타입 문제 임시 해결 | ||
| const Link: any = RouterLink; | ||
|
|
||
| interface AuthRedirectLinkProps { | ||
| text: string; | ||
| linkText: string; | ||
| to: string; | ||
| } | ||
|
|
||
| const AuthRedirectLink: React.FC<AuthRedirectLinkProps> = ({ | ||
| text, | ||
| linkText, | ||
| to, | ||
| }) => { | ||
| return ( | ||
| <div className="auth-switch"> | ||
| {text} <Link to={to}>{linkText}</Link> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| export default AuthRedirectLink; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| import React from "react"; | ||
|
|
||
| const SocialLoginButtons: React.FC = () => { | ||
| return ( | ||
| <div className="social-login-container"> | ||
| <h3>간편 로그인하기</h3> | ||
| <div className="social-login-buttons-container"> | ||
| <a | ||
| href="https://www.google.com/" | ||
| target="_blank" | ||
| rel="noopener noreferrer" | ||
| > | ||
| <img | ||
| src="/images/social/google-logo.png" | ||
| alt="구글 로그인" | ||
| width="42" | ||
| /> | ||
| </a> | ||
| <a | ||
| href="https://www.kakaocorp.com/page/" | ||
| target="_blank" | ||
| rel="noopener noreferrer" | ||
| > | ||
| <img | ||
| src="/images/social/kakao-logo.png" | ||
| alt="카카오톡 로그인" | ||
| width="42" | ||
| /> | ||
| </a> | ||
| </div> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| export default SocialLoginButtons; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
html 기본 속성의 경우 아래처럼 표현할 수 있습니다.