Minor UI fixes

This commit is contained in:
IRBorisov 2023-09-18 15:25:25 +03:00
parent 5d266420e1
commit a1016d136b
4 changed files with 13 additions and 5 deletions

View File

@ -21,7 +21,7 @@ function Root() {
const { noNavigation, noFooter, viewportHeight, mainHeight, showScroll } = useConceptTheme();
return (
<NavigationState>
<div className='w-screen antialiased clr-app'>
<div className='w-screen antialiased clr-app min-w-[30rem]'>
<ConceptToaster
className='mt-[4rem] text-sm'

View File

@ -59,7 +59,7 @@ function DescribeError(error: ErrorInfo) {
function BackendError({ error }: BackendErrorProps) {
return (
<div className='py-2 text-sm font-semibold select-text text-warning'>
<div className='px-3 py-2 min-w-[15rem] text-sm font-semibold select-text text-warning'>
{DescribeError(error)}
</div>
);

View File

@ -13,7 +13,6 @@ function RequireAuth({ children }: RequireAuthProps) {
{user && children}
{!user &&
<div className='flex flex-col items-center gap-1 mt-2'>
<p><b>Данная страница доступна только зарегистрированным пользователям</b></p>
<p className='mb-2'>Пожалуйста войдите в систему</p>
<TextURL text='Войти в Портал' href='/login'/>
<TextURL text='Зарегистрироваться' href='/signup'/>

View File

@ -29,7 +29,7 @@ function LoginPage() {
const location = useLocation();
const { navigateTo, navigateHistory } = useConceptNavigation();
const search = useLocation().search;
const { user, login, loading, error, setError } = useAuth();
const { user, login, logout, loading, error, setError } = useAuth();
const [username, setUsername] = useState('');
const [password, setPassword] = useState('');
@ -61,6 +61,10 @@ function LoginPage() {
}
}
function logoutAndRedirect() {
logout(() => navigateTo('/login/'));
}
return (
<div className='flex items-start justify-center w-full pt-4 select-none' style={{minHeight: mainHeight}}>
{ user &&
@ -73,7 +77,12 @@ function LoginPage() {
<span> | </span>
<TextURL text='Справка' href='/manuals'/>
<span> | </span>
<TextURL text='Выйти' href='/logout'/>
<span
className='cursor-pointer hover:underline text-url'
onClick={logoutAndRedirect}
>
Выйти
</span>
</p>
</div>}
{ !user &&