Skip to content
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
26 changes: 25 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions src/features/auth/AuthSlider/AuthSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ import './AuthSlider.scss';
import 'swiper/css';
import 'swiper/css/navigation';
import 'swiper/css/pagination';
import { useTranslation } from 'react-i18next';

type Props = {
slides: string[];
};

export const AuthSlider: React.FC<Props> = ({ slides }) => {
const { t } = useTranslation('auth')
return (
<div className="auth-slider">
<Swiper
Expand All @@ -26,15 +28,15 @@ export const AuthSlider: React.FC<Props> = ({ slides }) => {
<SwiperSlide key={index} className="auth-slider__slide">
<img
src={slide}
alt={`Slide ${index}`}
alt={`${t('slideIndex')} ${index}`}
className="auth-slider__image"
/>
</SwiperSlide>
))}
</Swiper>

<Link className="auth-slider__button" to="/">
Back to website
{t("backToWebsite")}
<AuthArrowIcon />
</Link>
</div>
Expand Down
26 changes: 14 additions & 12 deletions src/features/auth/LoginPage/LoginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ import GoogleIcon from '../../../shared/assets/icons/google.svg?react';
import { LanguageContext } from '../../../shared/context/language';
import { ROUTES } from '../../../shared/config/routes';
import '../form.scss';
import { useTranslation } from 'react-i18next';

export function LoginPage() {
const { language: lng } = useContext(LanguageContext)!;
const { t } = useTranslation('auth');
const navigate = useNavigate();
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
Expand Down Expand Up @@ -50,12 +52,12 @@ export function LoginPage() {

return (
<Form.Root className="form" onSubmit={handleSubmit}>
<h2 className="form__title">Log in your account</h2>
<h2 className="form__title">{t("loginTitle")}</h2>

<p className="form__text">
Don&apos;t have an account?{' '}
{t("noAccountPrompt")}{' '}
<Link to={`/${lng}/${ROUTES.signup}`} className="form__link">
Create account
{t('createAccountAction')}
</Link>
</p>

Expand All @@ -64,15 +66,15 @@ export function LoginPage() {
<input
className="form__input"
type="email"
placeholder="Email..."
placeholder={t('emailPlaceholder')}
value={email}
onChange={(e) => setEmail(e.target.value)}
required
/>
</Form.Control>
<div>
<Form.Message className="form__message" match="typeMismatch">
Please provide a valid email
{t('emailValidationFailed')}
</Form.Message>
</div>
</Form.Field>
Expand All @@ -82,14 +84,14 @@ export function LoginPage() {
<PasswordField
value={password}
onChange={(e) => setPassword(e.target.value)}
placeholder="Password..."
placeholder={t('passwordPlaceholder')}
name="password"
required
/>
</Form.Control>
<div>
<Form.Message className="form__message" match="typeMismatch">
Please provide a valid password
{t('passwordValidationFailed')}
</Form.Message>
</div>
</Form.Field>
Expand All @@ -103,24 +105,24 @@ export function LoginPage() {
onChange={(e) => setAgreement(e.target.checked)}
/>
<label htmlFor="agreement">
I agree{' '}
{t('iAgreeCheckbox')}{' '}
<a href="#" target="_blank" className="form__link">
Terms & Conditions
{t('termsAndConditions')}
</a>
</label>
</div>

<Form.Submit asChild>
<button className="form__submit" disabled={loading || !agreement}>
Log in
{t('loginButton')}
</button>
</Form.Submit>

{error && <span className="form__message">{error}</span>}

<p className="form__divider">
<span className="form__line"></span>
<span>Or login with</span>
<span>{t('orLoginWith')}</span>
<span className="form__line"></span>
</p>

Expand All @@ -131,7 +133,7 @@ export function LoginPage() {
disabled={loading}
>
<GoogleIcon />
{loading ? 'Logging in...' : 'Google'}
{loading ? t('loggingInStatus') : t('googleLoginOption')}
</button>
</Form.Root>
);
Expand Down
Loading
Loading