UI fixes for small screens

This commit is contained in:
IRBorisov 2023-10-14 21:17:21 +03:00
parent 2bc14c24bd
commit af25c0eef9
8 changed files with 23 additions and 15 deletions

View File

@ -38,7 +38,7 @@ function Root() {
overflowY: showScroll ? 'scroll': 'auto' overflowY: showScroll ? 'scroll': 'auto'
}} }}
> >
<main className='w-full h-full' style={{minHeight: mainHeight}}> <main className='w-full h-full min-w-fit' style={{minHeight: mainHeight}}>
<Outlet /> <Outlet />
</main> </main>
{!noNavigation && !noFooter && <Footer />} {!noNavigation && !noFooter && <Footer />}

View File

@ -13,7 +13,7 @@ function NavigationButton({ id, icon, description, onClick, text }: NavigationBu
type='button' type='button'
onClick={onClick} onClick={onClick}
tabIndex={-1} tabIndex={-1}
className={`flex items-center h-full gap-1 ${text ? 'px-2' : 'px-4'} mr-1 min-w-fit small-caps whitespace-nowrap clr-btn-nav`} className={`flex items-center h-full gap-1 ${text ? 'px-2' : 'px-4'} mr-1 small-caps whitespace-nowrap clr-btn-nav`}
> >
{icon && <span>{icon}</span>} {icon && <span>{icon}</span>}
{text && <span className='font-semibold'>{text}</span>} {text && <span className='font-semibold'>{text}</span>}

View File

@ -106,6 +106,13 @@
} }
} }
::selection {
background: var(--cl-prim-bg-60);
.dark & {
background: var(--cd-prim-bg-60);
}
}
[data-color-scheme="dark"] { [data-color-scheme="dark"] {
color-scheme: dark; color-scheme: dark;
} }

View File

@ -136,8 +136,8 @@ function EditorConstituenta({
} }
return ( return (
<div className='flex w-full max-w-[1500px] gap-2 justify-stretch'> <div className='flex max-w-[1500px] gap-2'>
<form onSubmit={handleSubmit} className='min-w-[50rem] max-w-min px-4 py-2'> <form onSubmit={handleSubmit} className='min-w-[50rem] max-w-[50rem] px-4 py-2'>
<div className='relative w-full'> <div className='relative w-full'>
<div className='absolute top-0 right-0 flex items-start justify-between w-full'> <div className='absolute top-0 right-0 flex items-start justify-between w-full'>
{activeCst && {activeCst &&
@ -162,7 +162,7 @@ function EditorConstituenta({
icon={<PenIcon size={4} color={isEnabled ? 'text-primary' : ''} />} icon={<PenIcon size={4} color={isEnabled ? 'text-primary' : ''} />}
/> />
</div> </div>
<div className='flex justify-end min-w-fit'> <div className='flex justify-end'>
<MiniButton <MiniButton
tooltip='Сохранить изменения' tooltip='Сохранить изменения'
disabled={!isModified || !isEnabled} disabled={!isModified || !isEnabled}

View File

@ -367,7 +367,7 @@ function EditorTermGraph({ onOpenEdit, onCreateCst, onDeleteCst }: EditorTermGra
initial={getOptions()} initial={getOptions()}
onConfirm={handleChangeOptions} onConfirm={handleChangeOptions}
/>} />}
<div className='flex flex-col border min-w-[13.5rem] max-w-[13.5rem] px-2 pb-2 text-sm select-none h-fit'> <div className='flex flex-col border min-w-[13.5rem] max-w-[13.5rem] px-2 pb-2 mt-4 text-sm select-none h-fit'>
{hoverCst && {hoverCst &&
<div className='relative'> <div className='relative'>
<InfoConstituenta <InfoConstituenta
@ -440,8 +440,9 @@ function EditorTermGraph({ onOpenEdit, onCreateCst, onDeleteCst }: EditorTermGra
/> />
</div> </div>
<Divider margins='mt-3 mb-2' /> {dismissed.length > 0 && <Divider margins='mt-3 mb-2' />}
{dismissed.length > 0 &&
<div className='flex flex-col overflow-y-auto'> <div className='flex flex-col overflow-y-auto'>
<p className='text-center'><b>Скрытые конституенты</b></p> <p className='text-center'><b>Скрытые конституенты</b></p>
<div className='flex flex-wrap justify-center gap-2 py-2'> <div className='flex flex-wrap justify-center gap-2 py-2'>
@ -469,14 +470,14 @@ function EditorTermGraph({ onOpenEdit, onCreateCst, onDeleteCst }: EditorTermGra
</>); </>);
})} })}
</div> </div>
</div> </div>}
</div> </div>
<div className='w-full h-full overflow-auto'> <div className='w-full h-full overflow-auto'>
<div <div
className='relative' className='relative'
style={{width: canvasWidth, height: canvasHeight}} style={{width: canvasWidth, height: canvasHeight}}
> >
<div className='relative top-0 right-0 flex mt-1 ml-2 z-pop flex-start'> <div className='relative top-4 right-0 flex mt-1 ml-2 z-pop flex-start'>
<div className='px-1 py-1' id='items-graph-help' > <div className='px-1 py-1' id='items-graph-help' >
<HelpIcon color='text-primary' size={5} /> <HelpIcon color='text-primary' size={5} />
</div> </div>

View File

@ -372,7 +372,7 @@ function RSTabs() {
onSelect={onSelectTab} onSelect={onSelectTab}
defaultFocus={true} defaultFocus={true}
selectedTabClassName='clr-selected' selectedTabClassName='clr-selected'
className='flex flex-col items-center w-full' className='flex flex-col w-full items-center'
> >
<TabList className='flex items-start border-b-2 border-x-2 select-none justify-stretch w-fit clr-controls h-[1.9rem] small-caps font-semibold'> <TabList className='flex items-start border-b-2 border-x-2 select-none justify-stretch w-fit clr-controls h-[1.9rem] small-caps font-semibold'>
<RSTabsMenu <RSTabsMenu
@ -406,7 +406,7 @@ function RSTabs() {
{schema.stats && <RSFormStats stats={schema.stats}/>} {schema.stats && <RSFormStats stats={schema.stats}/>}
</TabPanel> </TabPanel>
<TabPanel className='w-full'> <TabPanel>
<EditorItems <EditorItems
onOpenEdit={onOpenCst} onOpenEdit={onOpenCst}
onCreateCst={promptCreateCst} onCreateCst={promptCreateCst}
@ -414,7 +414,7 @@ function RSTabs() {
/> />
</TabPanel> </TabPanel>
<TabPanel className='flex justify-center w-full'> <TabPanel>
<EditorConstituenta <EditorConstituenta
isModified={isModified} isModified={isModified}
setIsModified={setIsModified} setIsModified={setIsModified}

View File

@ -206,8 +206,8 @@ function ViewSideConstituents({ expression, baseHeight, activeID, onOpenEdit }:
() => { () => {
const siblingHeight = `${baseHeight} - ${LOCAL_NAVIGATION_H}` const siblingHeight = `${baseHeight} - ${LOCAL_NAVIGATION_H}`
return (noNavigation ? return (noNavigation ?
`calc(min(100vh - 7.2rem, ${siblingHeight}))` `calc(min(100vh - 8.2rem, ${siblingHeight}))`
: `calc(min(100vh - 10.7rem, ${siblingHeight}))`); : `calc(min(100vh - 11.7rem, ${siblingHeight}))`);
}, [noNavigation, baseHeight]); }, [noNavigation, baseHeight]);
return (<> return (<>

View File

@ -61,7 +61,7 @@ function EditorPassword() {
return ( return (
<div className='flex py-2 border-l-2 max-w-[14rem]'> <div className='flex py-2 border-l-2 max-w-[14rem]'>
<form onSubmit={handleSubmit} className='flex flex-col justify-between px-6 min-w-fit'> <form onSubmit={handleSubmit} className='flex flex-col justify-between px-6'>
<div className='flex flex-col gap-3'> <div className='flex flex-col gap-3'>
<TextInput id='old_password' <TextInput id='old_password'
type='password' type='password'