replace default exports with named
This commit is contained in:
parent
26a7092d74
commit
8d42ab56c8
@ -1,14 +1,12 @@
|
||||
import styles from './Form.module.scss';
|
||||
import { publicRuntimeConfig } from '@/config/runtime';
|
||||
import Button from '@/elements/Button';
|
||||
import Error from '@/elements/Error';
|
||||
import Input from '@/elements/Input';
|
||||
import { Button, Error, Input } from '@/elements';
|
||||
import axios from 'axios';
|
||||
import { useState } from 'react';
|
||||
|
||||
const { APP_BASE_PATH } = publicRuntimeConfig;
|
||||
|
||||
export default function Form() {
|
||||
export function Form() {
|
||||
const [hasError, setHasError] = useState(false);
|
||||
const error = hasError ? <Error>Неверный логин или пароль</Error> : null;
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import Form from './Form';
|
||||
import { Form } from './Form';
|
||||
import styles from './Login.module.scss';
|
||||
import Logo from '@/elements/Logo';
|
||||
import { Logo } from '@/elements';
|
||||
|
||||
export default function Login() {
|
||||
export function Login() {
|
||||
return (
|
||||
<div className={styles.wrapper}>
|
||||
<div className={styles.login}>
|
||||
|
||||
2
apps/web/components/index.js
Normal file
2
apps/web/components/index.js
Normal file
@ -0,0 +1,2 @@
|
||||
export * from './Form';
|
||||
export * from './Login';
|
||||
@ -3,7 +3,7 @@ import styles from './Button.module.css';
|
||||
|
||||
type ButtonProps = JSX.IntrinsicElements['button'];
|
||||
|
||||
export default function Button({ children, ...props }: ButtonProps) {
|
||||
export function Button({ children, ...props }: ButtonProps) {
|
||||
return (
|
||||
<button className={styles.btn} {...props}>
|
||||
{children}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import styles from './Error.module.css';
|
||||
|
||||
export default function Error({ children }) {
|
||||
export function Error({ children }) {
|
||||
return <span className={styles.error}>{children}</span>;
|
||||
}
|
||||
|
||||
@ -2,6 +2,6 @@ import styles from './Input.module.css';
|
||||
|
||||
type InputProps = JSX.IntrinsicElements['input'];
|
||||
|
||||
export default function Input(props: InputProps) {
|
||||
export function Input(props: InputProps) {
|
||||
return <input className={styles.input} {...props} />;
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import Image from 'next/image';
|
||||
import logo from 'public/assets/images/logo-primary.svg';
|
||||
|
||||
export default function Logo() {
|
||||
export function Logo() {
|
||||
return <Image src={logo} alt="logo" width={154} />;
|
||||
}
|
||||
|
||||
5
apps/web/elements/index.js
Normal file
5
apps/web/elements/index.js
Normal file
@ -0,0 +1,5 @@
|
||||
export * from './Button';
|
||||
export * from './Error';
|
||||
export * from './H';
|
||||
export * from './Input';
|
||||
export * from './Logo';
|
||||
@ -1,4 +1,4 @@
|
||||
import Login from '@/components/Login';
|
||||
import { Login } from '@/components';
|
||||
import { publicRuntimeConfig } from '@/config/runtime';
|
||||
import Head from 'next/head';
|
||||
|
||||
@ -13,7 +13,7 @@ function PageHead() {
|
||||
);
|
||||
}
|
||||
|
||||
export default function Home() {
|
||||
export default function Page() {
|
||||
return (
|
||||
<>
|
||||
<PageHead />
|
||||
|
||||
24
apps/web/pages/telegram.jsx
Normal file
24
apps/web/pages/telegram.jsx
Normal file
@ -0,0 +1,24 @@
|
||||
import { Login } from '@/components';
|
||||
import { publicRuntimeConfig } from '@/config/runtime';
|
||||
import Head from 'next/head';
|
||||
|
||||
const { APP_DESCRIPTION } = publicRuntimeConfig;
|
||||
|
||||
function PageHead() {
|
||||
return (
|
||||
<Head>
|
||||
<title>{`Вход - ${APP_DESCRIPTION}`}</title>
|
||||
<meta name="description" content={APP_DESCRIPTION} />
|
||||
</Head>
|
||||
);
|
||||
}
|
||||
|
||||
export default function Page() {
|
||||
return (
|
||||
<>
|
||||
<PageHead />
|
||||
Telegram
|
||||
<Login />
|
||||
</>
|
||||
);
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user