mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 21:10:38 +03:00
Minor UI improvements
This commit is contained in:
parent
f1ac63b61a
commit
3b423b33ff
|
@ -4,6 +4,7 @@ import { toast } from 'react-toastify';
|
||||||
|
|
||||||
import Checkbox from '../../components/Common/Checkbox';
|
import Checkbox from '../../components/Common/Checkbox';
|
||||||
import ConceptTooltip from '../../components/Common/ConceptTooltip';
|
import ConceptTooltip from '../../components/Common/ConceptTooltip';
|
||||||
|
import Divider from '../../components/Common/Divider';
|
||||||
import MiniButton from '../../components/Common/MiniButton';
|
import MiniButton from '../../components/Common/MiniButton';
|
||||||
import SubmitButton from '../../components/Common/SubmitButton';
|
import SubmitButton from '../../components/Common/SubmitButton';
|
||||||
import TextArea from '../../components/Common/TextArea';
|
import TextArea from '../../components/Common/TextArea';
|
||||||
|
@ -15,6 +16,7 @@ import { useRSForm } from '../../context/RSFormContext';
|
||||||
import { useUsers } from '../../context/UsersContext';
|
import { useUsers } from '../../context/UsersContext';
|
||||||
import { LibraryItemType } from '../../models/library';
|
import { LibraryItemType } from '../../models/library';
|
||||||
import { IRSFormCreateData } from '../../models/rsform';
|
import { IRSFormCreateData } from '../../models/rsform';
|
||||||
|
import RSFormStats from './elements/RSFormStats';
|
||||||
|
|
||||||
interface EditorRSFormProps {
|
interface EditorRSFormProps {
|
||||||
onDestroy: () => void
|
onDestroy: () => void
|
||||||
|
@ -81,9 +83,9 @@ function EditorRSForm({ onDestroy, onClaim, onShare, isModified, setIsModified,
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<form onSubmit={handleSubmit} className='flex-grow max-w-[40rem] min-w-[30rem] px-4 py-2 mt-4 border'>
|
<div>
|
||||||
<div className='relative w-full'>
|
<div className='relative flex items-start justify-center w-full'>
|
||||||
<div className='absolute top-0 right-0 flex'>
|
<div className='absolute flex mt-1'>
|
||||||
<MiniButton
|
<MiniButton
|
||||||
tooltip='Поделиться схемой'
|
tooltip='Поделиться схемой'
|
||||||
icon={<ShareIcon size={5} color='text-primary'/>}
|
icon={<ShareIcon size={5} color='text-primary'/>}
|
||||||
|
@ -114,6 +116,8 @@ function EditorRSForm({ onDestroy, onClaim, onShare, isModified, setIsModified,
|
||||||
</ConceptTooltip>
|
</ConceptTooltip>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div className='flex w-full'>
|
||||||
|
<form onSubmit={handleSubmit} className='flex-grow max-w-[40rem] min-w-[30rem] px-4 py-2'>
|
||||||
<div className='flex flex-col gap-3 mt-2'>
|
<div className='flex flex-col gap-3 mt-2'>
|
||||||
<TextInput id='title' label='Полное название' type='text'
|
<TextInput id='title' label='Полное название' type='text'
|
||||||
required
|
required
|
||||||
|
@ -125,7 +129,8 @@ function EditorRSForm({ onDestroy, onClaim, onShare, isModified, setIsModified,
|
||||||
required
|
required
|
||||||
value={alias}
|
value={alias}
|
||||||
disabled={!isEditable}
|
disabled={!isEditable}
|
||||||
dimensions='max-w-sm'
|
dense
|
||||||
|
dimensions='w-full'
|
||||||
onChange={event => setAlias(event.target.value)}
|
onChange={event => setAlias(event.target.value)}
|
||||||
/>
|
/>
|
||||||
<TextArea id='comment' label='Комментарий'
|
<TextArea id='comment' label='Комментарий'
|
||||||
|
@ -135,6 +140,7 @@ function EditorRSForm({ onDestroy, onClaim, onShare, isModified, setIsModified,
|
||||||
/>
|
/>
|
||||||
<div className='flex justify-between whitespace-nowrap'>
|
<div className='flex justify-between whitespace-nowrap'>
|
||||||
<Checkbox id='common' label='Общедоступная схема'
|
<Checkbox id='common' label='Общедоступная схема'
|
||||||
|
tooltip='Общедоступные схемы видны всем пользователям и могут быть изменены'
|
||||||
value={common}
|
value={common}
|
||||||
dimensions='w-fit'
|
dimensions='w-fit'
|
||||||
disabled={!isEditable}
|
disabled={!isEditable}
|
||||||
|
@ -181,7 +187,10 @@ function EditorRSForm({ onDestroy, onClaim, onShare, isModified, setIsModified,
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
);
|
{schema && <Divider vertical />}
|
||||||
|
<RSFormStats stats={schema?.stats}/>
|
||||||
|
</div>
|
||||||
|
</div>);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default EditorRSForm;
|
export default EditorRSForm;
|
||||||
|
|
|
@ -30,7 +30,6 @@ import EditorConstituenta from './EditorConstituenta';
|
||||||
import EditorItems from './EditorItems';
|
import EditorItems from './EditorItems';
|
||||||
import EditorRSForm from './EditorRSForm';
|
import EditorRSForm from './EditorRSForm';
|
||||||
import EditorTermGraph from './EditorTermGraph';
|
import EditorTermGraph from './EditorTermGraph';
|
||||||
import RSFormStats from './elements/RSFormStats';
|
|
||||||
import RSTabsMenu from './elements/RSTabsMenu';
|
import RSTabsMenu from './elements/RSTabsMenu';
|
||||||
|
|
||||||
export enum RSTabID {
|
export enum RSTabID {
|
||||||
|
@ -420,7 +419,7 @@ function RSTabs() {
|
||||||
</TabList>
|
</TabList>
|
||||||
|
|
||||||
<div className='overflow-y-auto' style={{ maxHeight: panelHeight}}>
|
<div className='overflow-y-auto' style={{ maxHeight: panelHeight}}>
|
||||||
<TabPanel className='flex gap-4 w-fit'>
|
<TabPanel>
|
||||||
<EditorRSForm
|
<EditorRSForm
|
||||||
isModified={isModified}
|
isModified={isModified}
|
||||||
setIsModified={setIsModified}
|
setIsModified={setIsModified}
|
||||||
|
@ -429,7 +428,6 @@ function RSTabs() {
|
||||||
onClaim={onClaimSchema}
|
onClaim={onClaimSchema}
|
||||||
onShare={onShareSchema}
|
onShare={onShareSchema}
|
||||||
/>
|
/>
|
||||||
{schema.stats && <RSFormStats stats={schema.stats}/>}
|
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
|
|
||||||
<TabPanel>
|
<TabPanel>
|
||||||
|
|
|
@ -3,12 +3,15 @@ import LabeledText from '../../../components/Common/LabeledText';
|
||||||
import { type IRSFormStats } from '../../../models/rsform';
|
import { type IRSFormStats } from '../../../models/rsform';
|
||||||
|
|
||||||
interface RSFormStatsProps {
|
interface RSFormStatsProps {
|
||||||
stats: IRSFormStats
|
stats?: IRSFormStats
|
||||||
}
|
}
|
||||||
|
|
||||||
function RSFormStats({ stats }: RSFormStatsProps) {
|
function RSFormStats({ stats }: RSFormStatsProps) {
|
||||||
|
if (!stats) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<div className='flex flex-col gap-1 px-4 py-2 mt-4 border min-w-[16rem]'>
|
<div className='flex flex-col gap-1 px-4 py-2 mt-7 min-w-[16rem]'>
|
||||||
<LabeledText id='count_all'
|
<LabeledText id='count_all'
|
||||||
label='Всего конституент '
|
label='Всего конституент '
|
||||||
text={stats.count_all}
|
text={stats.count_all}
|
||||||
|
|
|
@ -56,7 +56,7 @@ function RegisterPage() {
|
||||||
return (
|
return (
|
||||||
<div className='flex justify-center w-full py-2'>
|
<div className='flex justify-center w-full py-2'>
|
||||||
{ user &&
|
{ user &&
|
||||||
<b>{`Вы вошли в систему как ${user.username}. Если хотите зарегистрировать нового пользователя, выйдите из системы (меню в правом верхнем углу экрана)`}</b>}
|
<b>{`Вы вошли в систему как ${user.username}`}</b>}
|
||||||
{ !user &&
|
{ !user &&
|
||||||
<Form
|
<Form
|
||||||
title='Регистрация'
|
title='Регистрация'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user