mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 13:00:39 +03:00
UI fixes
This commit is contained in:
parent
de86365e86
commit
a38cca9c0d
|
@ -13,7 +13,9 @@ extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'className' | 'child
|
||||||
function Button({
|
function Button({
|
||||||
id, text, icon, tooltip,
|
id, text, icon, tooltip,
|
||||||
dense, disabled,
|
dense, disabled,
|
||||||
borderClass = 'border rounded', colorClass = 'clr-btn-default', widthClass = 'w-fit h-fit',
|
borderClass = 'border rounded',
|
||||||
|
colorClass = 'clr-btn-default',
|
||||||
|
widthClass = 'w-fit h-fit',
|
||||||
loading, onClick,
|
loading, onClick,
|
||||||
...props
|
...props
|
||||||
}: ButtonProps) {
|
}: ButtonProps) {
|
||||||
|
|
|
@ -109,8 +109,8 @@ function EditorConstituenta({ activeID, onShowAST, onCreateCst, onOpenEdit, onDe
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='flex items-start w-full gap-2'>
|
<div className='flex items-stretch w-full gap-2 mb-2'>
|
||||||
<form onSubmit={handleSubmit} className='flex-grow min-w-[50rem] max-w-min px-4 py-2 mb-2 border'>
|
<form onSubmit={handleSubmit} className='flex-grow min-w-[50rem] max-w-min max-h-fit px-4 py-2 border'>
|
||||||
<div className='flex items-start justify-between'>
|
<div className='flex items-start justify-between'>
|
||||||
<button type='submit'
|
<button type='submit'
|
||||||
title='Сохранить изменения'
|
title='Сохранить изменения'
|
||||||
|
|
|
@ -60,12 +60,13 @@ function RSTabsMenu({showUploadDialog, showCloneDialog}: RSTabsMenuProps) {
|
||||||
}, [schemaMenu]);
|
}, [schemaMenu]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='flex items-center w-fit'>
|
<div className='flex items-stretch w-fit'>
|
||||||
<div ref={schemaMenu.ref}>
|
<div ref={schemaMenu.ref}>
|
||||||
<Button
|
<Button
|
||||||
tooltip='Действия'
|
tooltip='Действия'
|
||||||
icon={<MenuIcon size={5}/>}
|
icon={<MenuIcon size={5}/>}
|
||||||
borderClass=''
|
borderClass=''
|
||||||
|
widthClass='h-full w-fit'
|
||||||
dense
|
dense
|
||||||
onClick={schemaMenu.toggle}
|
onClick={schemaMenu.toggle}
|
||||||
/>
|
/>
|
||||||
|
@ -107,6 +108,7 @@ function RSTabsMenu({showUploadDialog, showCloneDialog}: RSTabsMenuProps) {
|
||||||
<Button
|
<Button
|
||||||
tooltip={'измнение: ' + (isEditable ? '[доступно]' : '[запрещено]')}
|
tooltip={'измнение: ' + (isEditable ? '[доступно]' : '[запрещено]')}
|
||||||
borderClass=''
|
borderClass=''
|
||||||
|
widthClass='h-full w-fit'
|
||||||
icon={<PenIcon size={5} color={isEditable ? 'text-green' : 'text-red'}/>}
|
icon={<PenIcon size={5} color={isEditable ? 'text-green' : 'text-red'}/>}
|
||||||
dense
|
dense
|
||||||
onClick={editMenu.toggle}
|
onClick={editMenu.toggle}
|
||||||
|
@ -143,6 +145,7 @@ function RSTabsMenu({showUploadDialog, showCloneDialog}: RSTabsMenuProps) {
|
||||||
? <EyeIcon color='text-primary' size={5}/>
|
? <EyeIcon color='text-primary' size={5}/>
|
||||||
: <EyeOffIcon size={5}/>
|
: <EyeOffIcon size={5}/>
|
||||||
}
|
}
|
||||||
|
widthClass='h-full w-fit'
|
||||||
borderClass=''
|
borderClass=''
|
||||||
dense
|
dense
|
||||||
onClick={toggleTracking}
|
onClick={toggleTracking}
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import Card from '../../../components/Common/Card';
|
|
||||||
import Divider from '../../../components/Common/Divider';
|
import Divider from '../../../components/Common/Divider';
|
||||||
import LabeledText from '../../../components/Common/LabeledText';
|
import LabeledText from '../../../components/Common/LabeledText';
|
||||||
import { type IRSFormStats } from '../../../utils/models';
|
import { type IRSFormStats } from '../../../utils/models';
|
||||||
|
@ -9,7 +8,7 @@ interface RSFormStatsProps {
|
||||||
|
|
||||||
function RSFormStats({ stats }: RSFormStatsProps) {
|
function RSFormStats({ stats }: RSFormStatsProps) {
|
||||||
return (
|
return (
|
||||||
<Card>
|
<div className='px-4 py-2 border'>
|
||||||
<LabeledText id='count_all'
|
<LabeledText id='count_all'
|
||||||
label='Всего конституент '
|
label='Всего конституент '
|
||||||
text={stats.count_all}
|
text={stats.count_all}
|
||||||
|
@ -28,12 +27,12 @@ function RSFormStats({ stats }: RSFormStatsProps) {
|
||||||
label='Невычислимы '
|
label='Невычислимы '
|
||||||
text={stats.count_incalc}
|
text={stats.count_incalc}
|
||||||
/>}
|
/>}
|
||||||
<Divider />
|
<Divider margins='my-1' />
|
||||||
<LabeledText id='count_termin'
|
<LabeledText id='count_termin'
|
||||||
label='Термины '
|
label='Термины '
|
||||||
text={stats.count_termin}
|
text={stats.count_termin}
|
||||||
/>
|
/>
|
||||||
<Divider />
|
<Divider margins='my-1' />
|
||||||
{ stats.count_base > 0 &&
|
{ stats.count_base > 0 &&
|
||||||
<LabeledText id='count_base'
|
<LabeledText id='count_base'
|
||||||
label='Базисные множества '
|
label='Базисные множества '
|
||||||
|
@ -74,7 +73,7 @@ function RSFormStats({ stats }: RSFormStatsProps) {
|
||||||
label='Теормы '
|
label='Теормы '
|
||||||
text={stats.count_theorem}
|
text={stats.count_theorem}
|
||||||
/>}
|
/>}
|
||||||
</Card>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ interface ViewSideConstituentsProps {
|
||||||
}
|
}
|
||||||
|
|
||||||
function ViewSideConstituents({ expression, activeID, onOpenEdit }: ViewSideConstituentsProps) {
|
function ViewSideConstituents({ expression, activeID, onOpenEdit }: ViewSideConstituentsProps) {
|
||||||
const { darkMode, noNavigation } = useConceptTheme();
|
const { darkMode } = useConceptTheme();
|
||||||
const { schema } = useRSForm();
|
const { schema } = useRSForm();
|
||||||
|
|
||||||
const [filterMatch, setFilterMatch] = useLocalStorage('side-filter-match', CstMatchMode.ALL);
|
const [filterMatch, setFilterMatch] = useLocalStorage('side-filter-match', CstMatchMode.ALL);
|
||||||
|
@ -139,21 +139,13 @@ function ViewSideConstituents({ expression, activeID, onOpenEdit }: ViewSideCons
|
||||||
], []
|
], []
|
||||||
);
|
);
|
||||||
|
|
||||||
const maxHeight = useMemo(
|
|
||||||
() => {
|
|
||||||
// TODO: calculate hieght based on left editor column height
|
|
||||||
return !noNavigation ?
|
|
||||||
'max-h-[calc(100vh-10.3rem)]'
|
|
||||||
: 'max-h-[calc(100vh-10.3rem)] ';
|
|
||||||
}, [noNavigation]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`${maxHeight} min-h-[40rem] overflow-y-scroll border flex-grow w-full`}>
|
<div className='max-h-[calc(100vh-10.3rem)] min-h-[40rem] overflow-y-scroll border flex-grow w-full'>
|
||||||
<div className='sticky top-0 left-0 right-0 z-10 flex items-center justify-between w-full gap-1 px-2 py-1 bg-white border-b-2 border-gray-400 rounded dark:bg-gray-700 dark:border-gray-300'>
|
<div className='sticky top-0 left-0 right-0 z-10 flex items-center justify-between w-full gap-1 px-2 py-1 bg-white border-b rounded clr-bg-pop clr-border'>
|
||||||
<div className='flex items-center justify-between w-full'>
|
<div className='flex items-center justify-between w-full'>
|
||||||
<MatchModePicker value={filterMatch} onChange={setFilterMatch}/>
|
<MatchModePicker value={filterMatch} onChange={setFilterMatch}/>
|
||||||
<input type='text'
|
<input type='text'
|
||||||
className='w-full px-2 outline-none dark:bg-gray-700 hover:text-clip'
|
className='w-full px-2 bg-white outline-none hover:text-clip clr-bg-pop clr-border'
|
||||||
placeholder='наберите текст фильтра'
|
placeholder='наберите текст фильтра'
|
||||||
value={filterText}
|
value={filterText}
|
||||||
onChange={event => { setFilterText(event.target.value); }}
|
onChange={event => { setFilterText(event.target.value); }}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user