Small UI fixes

This commit is contained in:
Ivan 2024-07-19 20:42:54 +03:00
parent 3996673d9f
commit 5922c28fa7
5 changed files with 8 additions and 5 deletions

View File

@ -15,16 +15,16 @@ interface DataLoaderProps extends CProps.AnimatedDiv {
children: React.ReactNode; children: React.ReactNode;
} }
function DataLoader({ id, isLoading, hasNoData, error, children, ...restProps }: DataLoaderProps) { function DataLoader({ id, isLoading, hasNoData, error, className, children, ...restProps }: DataLoaderProps) {
return ( return (
<AnimatePresence mode='wait'> <AnimatePresence mode='wait'>
{!isLoading && !error && !hasNoData ? ( {!isLoading && !error && !hasNoData ? (
<AnimateFade id={id} key={`${id}-data`} {...restProps}> <AnimateFade id={id} key={`${id}-data`} className={className} {...restProps}>
{children} {children}
</AnimateFade> </AnimateFade>
) : null} ) : null}
{!isLoading && !error && hasNoData ? ( {!isLoading && !error && hasNoData ? (
<AnimateFade key={`${id}-no-data`} {...restProps}> <AnimateFade key={`${id}-no-data`} className='w-full text-center p-1' {...restProps}>
Данные не загружены Данные не загружены
</AnimateFade> </AnimateFade>
) : null} ) : null}

View File

@ -11,7 +11,7 @@ import { RSFormLoader } from '@/models/RSFormLoader';
function useRSFormDetails({ target, version }: { target?: string; version?: string }) { function useRSFormDetails({ target, version }: { target?: string; version?: string }) {
const { loading: userLoading } = useAuth(); const { loading: userLoading } = useAuth();
const [schema, setInnerSchema] = useState<IRSForm | undefined>(undefined); const [schema, setInnerSchema] = useState<IRSForm | undefined>(undefined);
const [loading, setLoading] = useState(true); const [loading, setLoading] = useState(target != undefined);
const [error, setError] = useState<ErrorData>(undefined); const [error, setError] = useState<ErrorData>(undefined);
function setSchema(data?: IRSFormData) { function setSchema(data?: IRSFormData) {

View File

@ -45,7 +45,7 @@ function ViewSideLocation({ folderTree, active, setActive: setActive, toggleFold
animate={{ ...animateSideView.animate }} animate={{ ...animateSideView.animate }}
exit={{ ...animateSideView.exit }} exit={{ ...animateSideView.exit }}
> >
<div className='h-[2.08rem] flex justify-between items-center pr-1'> <div className='h-[2.08rem] flex justify-between items-center pr-1 pl-[0.125rem]'>
<BadgeHelp <BadgeHelp
topic={HelpTopic.UI_LIBRARY} topic={HelpTopic.UI_LIBRARY}
className={clsx(PARAMETER.TOOLTIP_WIDTH, 'text-sm')} className={clsx(PARAMETER.TOOLTIP_WIDTH, 'text-sm')}

View File

@ -62,6 +62,7 @@ function LoginPage() {
autoFocus autoFocus
required required
allowEnter allowEnter
spellCheck={false}
value={username} value={username}
onChange={event => setUsername(event.target.value)} onChange={event => setUsername(event.target.value)}
/> />

View File

@ -95,6 +95,7 @@ function FormSignup() {
autoComplete='username' autoComplete='username'
required required
label='Имя пользователя (логин)' label='Имя пользователя (логин)'
spellCheck={false}
pattern={patterns.login} pattern={patterns.login}
title='Минимум 3 знака. Латинские буквы и цифры. Не может начинаться с цифры' title='Минимум 3 знака. Латинские буквы и цифры. Не может начинаться с цифры'
value={username} value={username}
@ -128,6 +129,7 @@ function FormSignup() {
id='email' id='email'
autoComplete='email' autoComplete='email'
required required
spellCheck={false}
label='Электронная почта (email)' label='Электронная почта (email)'
title='электронная почта в корректном формате, например: i.petrov@mycompany.ru.com' title='электронная почта в корректном формате, например: i.petrov@mycompany.ru.com'
value={email} value={email}