diff --git a/gui/src/components/Header.tsx b/gui/src/components/Header.tsx new file mode 100644 index 0000000..77ff659 --- /dev/null +++ b/gui/src/components/Header.tsx @@ -0,0 +1,14 @@ +import React from 'react' +import { AiOutlineLeft } from 'react-icons/ai'; +import { useNavigate } from 'react-router-dom'; + +type HeaderProps = { + title?: React.ReactNode +} + +export const Header: React.FC = ({ title }) => { + const navigate = useNavigate(); + return <> +

{title}

+ +} diff --git a/gui/src/main.css b/gui/src/main.css index c485c46..50fd673 100644 --- a/gui/src/main.css +++ b/gui/src/main.css @@ -40,3 +40,7 @@ body { .flex-auto-all > * { @apply flex-auto; } + +.full-card { + @apply card m-2 h-full; +} diff --git a/gui/src/pages/Home.tsx b/gui/src/pages/Home.tsx index d4b9197..225f52a 100644 --- a/gui/src/pages/Home.tsx +++ b/gui/src/pages/Home.tsx @@ -29,7 +29,7 @@ export const Home: React.FC = () => { } return <> -
+

{t('欢迎!')}

{t('配置')} diff --git a/gui/src/pages/Settings.tsx b/gui/src/pages/Settings.tsx index 402a6fc..e080b6e 100644 --- a/gui/src/pages/Settings.tsx +++ b/gui/src/pages/Settings.tsx @@ -3,19 +3,17 @@ import { Loading } from 'components/Loading'; import { usePromise, usePromiseLazy } from 'hooks/usePromise'; import React, { useState } from 'react' import { useTranslation } from 'react-i18next'; -import { AiOutlineLeft } from 'react-icons/ai'; -import { useNavigate } from 'react-router-dom'; import { Config, getConfig, getProfile, Profile, setConfig, setProfile } from 'services/config'; import { composeLoadable } from 'utils/composeLoadable'; import classNames from 'classnames'; import { useLogin } from 'services/s3si'; import { STAT_INK } from 'constant'; +import { Header } from 'components/Header'; const Page: React.FC<{ children?: React.ReactNode }> = ({ children }) => { const { t } = useTranslation(); - const navigate = useNavigate(); - return
-

{t('配置')}

+ return
+
{children}
}