From 8f451035f7ec8037c38a61ecb1d449cf3b4f3ef7 Mon Sep 17 00:00:00 2001 From: goodm2ice Date: Fri, 25 Feb 2022 11:39:06 +0500 Subject: [PATCH] =?UTF-8?q?=D0=9B=D0=BE=D0=B3=D0=BE=D1=82=D0=B8=D0=BF=20?= =?UTF-8?q?=D0=B2=D1=8B=D0=BD=D0=B5=D1=81=D0=B5=D0=BD=20=D0=B2=20public,?= =?UTF-8?q?=20=D1=81=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD=20=D0=BA=D0=BE=D0=BC?= =?UTF-8?q?=D0=BF=D0=BE=D0=BD=D0=B5=D0=BD=D1=82=20=D0=B4=D0=BB=D1=8F=20?= =?UTF-8?q?=D1=83=D0=B4=D0=BE=D0=B1=D1=81=D1=82=D0=B2=D0=B0=20=D0=B8=D1=81?= =?UTF-8?q?=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- {src => public}/images/logo_32.png | Bin src/App.js | 14 +++++++------- src/components/PageHeader.tsx | 9 +++++---- src/images/Logo.tsx | 7 +++++++ src/pages/Login.jsx | 4 ++-- src/pages/Register.jsx | 4 ++-- 6 files changed, 23 insertions(+), 15 deletions(-) rename {src => public}/images/logo_32.png (100%) create mode 100644 src/images/Logo.tsx diff --git a/src/images/logo_32.png b/public/images/logo_32.png similarity index 100% rename from src/images/logo_32.png rename to public/images/logo_32.png diff --git a/src/App.js b/src/App.js index f568f6c..ecc71fa 100644 --- a/src/App.js +++ b/src/App.js @@ -6,15 +6,15 @@ import { import { ConfigProvider } from 'antd' import locale from 'antd/lib/locale/ru_RU' -import { OpenAPI } from './services/api' -import { getUserToken } from './utils/storage' -import { PrivateRoute } from './components/Private' +import { OpenAPI } from '@api' +import { getUserToken } from '@utils/storage' +import { PrivateRoute } from '@components/Private' -import Main from './pages/Main' -import Login from './pages/Login' -import Register from './pages/Register' +import Main from '@pages/Main' +import Login from '@pages/Login' +import Register from '@pages/Register' -import './styles/App.less' +import '@styles/App.less' //OpenAPI.BASE = 'http://localhost:3000' OpenAPI.TOKEN = async () => getUserToken() diff --git a/src/components/PageHeader.tsx b/src/components/PageHeader.tsx index 6af290c..52f7658 100644 --- a/src/components/PageHeader.tsx +++ b/src/components/PageHeader.tsx @@ -1,11 +1,12 @@ import { memo } from 'react' -import { Layout } from 'antd' import { Link } from 'react-router-dom' +import { Layout } from 'antd' +import { BasicProps } from 'antd/lib/layout/layout' -import logo from '@images/logo_32.png' import { headerHeight } from '@utils' import { UserMenu } from './UserMenu' -import { BasicProps } from 'antd/lib/layout/layout' + +import Logo from '@images/Logo' export type PageHeaderProps = BasicProps & { title?: string @@ -17,7 +18,7 @@ export const PageHeader: React.FC = memo(({ title = 'Монит - {'АСБ'} + {children}

{title}

diff --git a/src/images/Logo.tsx b/src/images/Logo.tsx new file mode 100644 index 0000000..769e4d6 --- /dev/null +++ b/src/images/Logo.tsx @@ -0,0 +1,7 @@ +import { memo } from 'react' + +export const Logo = memo, HTMLImageElement>>((props) => ( + {'АСБ'} +)) + +export default Logo diff --git a/src/pages/Login.jsx b/src/pages/Login.jsx index 462b42a..cdb27b4 100644 --- a/src/pages/Login.jsx +++ b/src/pages/Login.jsx @@ -10,9 +10,9 @@ import { invokeWebApiWrapperAsync } from '@components/factory' import { loginRules, passwordRules } from '@utils/validationRules' import '@styles/index.css' -import logo from '@images/logo_32.png' +import Logo from '@images/Logo' -const logoIcon = {'АСБ'} +const logoIcon = export const Login = memo(() => { const history = useHistory() diff --git a/src/pages/Register.jsx b/src/pages/Register.jsx index d429199..34ae670 100644 --- a/src/pages/Register.jsx +++ b/src/pages/Register.jsx @@ -21,7 +21,7 @@ import { phoneRules } from '@utils/validationRules' -import logo from '@images/logo_32.png' +import Logo from '@images/Logo' const surnameRules = [...nameRules, { required: true, message: 'Пожалуйста, введите фамилию!' }] const regEmailRules = [{ required: true, message: 'Пожалуйста, введите email!' }, ...emailRules] @@ -37,7 +37,7 @@ const confirmPasswordRules = [ }) ] -const logoIcon = {'АСБ'} +const logoIcon = const showPasswordIcon = visible => (visible ? : ) const createInput = (name, placeholder, rules, isPassword, dependencies) => (