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