mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 21:10:38 +03:00
classnames refactoring + small ui fixes
This commit is contained in:
parent
f8364d1a06
commit
bcbe35b436
|
@ -76,7 +76,7 @@ function Checkbox({
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
{label ? <span className={clsx('text-start text-sm whitespace-nowrap', cursor)}>{label}</span> : null}
|
{label ? <span className={clsx('text-start text-sm whitespace-nowrap select-text', cursor)}>{label}</span> : null}
|
||||||
</button>
|
</button>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,7 +84,7 @@ function CheckboxTristate({
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
{label ? <span className={clsx('text-start text-sm whitespace-nowrap', cursor)}>{label}</span> : null}
|
{label ? <span className={clsx('text-start text-sm whitespace-nowrap select-text', cursor)}>{label}</span> : null}
|
||||||
</button>
|
</button>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,12 @@
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
|
|
||||||
import { classnames } from '@/utils/constants';
|
|
||||||
|
|
||||||
import { CProps } from '../props';
|
import { CProps } from '../props';
|
||||||
|
|
||||||
export interface FlexColumnProps extends CProps.Div {}
|
export interface FlexColumnProps extends CProps.Div {}
|
||||||
|
|
||||||
function FlexColumn({ className, children, ...restProps }: FlexColumnProps) {
|
function FlexColumn({ className, children, ...restProps }: FlexColumnProps) {
|
||||||
return (
|
return (
|
||||||
<div className={clsx(classnames.flex_col, className)} {...restProps}>
|
<div className={clsx('cc-column', className)} {...restProps}>
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -12,13 +12,13 @@ function Label({ text, className, ...restProps }: LabelProps) {
|
||||||
}
|
}
|
||||||
if (restProps.htmlFor) {
|
if (restProps.htmlFor) {
|
||||||
return (
|
return (
|
||||||
<label className={clsx('text-sm font-medium whitespace-nowrap', className)} {...restProps}>
|
<label className={clsx('cc-label', className)} {...restProps}>
|
||||||
{text}
|
{text}
|
||||||
</label>
|
</label>
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return (
|
return (
|
||||||
<span className={clsx('text-sm font-medium whitespace-nowrap', className)} {...restProps}>
|
<span className={clsx('cc-label', className)} {...restProps}>
|
||||||
{text}
|
{text}
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
|
|
|
@ -13,7 +13,6 @@ import { useConceptNavigation } from '@/context/NavigationContext';
|
||||||
import { ILibraryItem } from '@/models/library';
|
import { ILibraryItem } from '@/models/library';
|
||||||
import { cloneTitle } from '@/models/libraryAPI';
|
import { cloneTitle } from '@/models/libraryAPI';
|
||||||
import { IRSFormCreateData } from '@/models/rsform';
|
import { IRSFormCreateData } from '@/models/rsform';
|
||||||
import { classnames } from '@/utils/constants';
|
|
||||||
|
|
||||||
interface DlgCloneLibraryItemProps extends Pick<ModalProps, 'hideWindow'> {
|
interface DlgCloneLibraryItemProps extends Pick<ModalProps, 'hideWindow'> {
|
||||||
base: ILibraryItem;
|
base: ILibraryItem;
|
||||||
|
@ -63,7 +62,7 @@ function DlgCloneLibraryItem({ hideWindow, base }: DlgCloneLibraryItemProps) {
|
||||||
canSubmit={canSubmit}
|
canSubmit={canSubmit}
|
||||||
submitText='Создать'
|
submitText='Создать'
|
||||||
onSubmit={handleSubmit}
|
onSubmit={handleSubmit}
|
||||||
className={clsx('px-6 py-2', classnames.flex_col)}
|
className={clsx('px-6 py-2', 'cc-column')}
|
||||||
>
|
>
|
||||||
<TextInput
|
<TextInput
|
||||||
id='dlg_full_name'
|
id='dlg_full_name'
|
||||||
|
|
|
@ -13,7 +13,6 @@ import { HelpTopic } from '@/models/miscellaneous';
|
||||||
import { CstType, ICstCreateData, IRSForm } from '@/models/rsform';
|
import { CstType, ICstCreateData, IRSForm } from '@/models/rsform';
|
||||||
import { generateAlias, validateNewAlias } from '@/models/rsformAPI';
|
import { generateAlias, validateNewAlias } from '@/models/rsformAPI';
|
||||||
import { inferTemplatedType, substituteTemplateArgs } from '@/models/rslangAPI';
|
import { inferTemplatedType, substituteTemplateArgs } from '@/models/rslangAPI';
|
||||||
import { classnames } from '@/utils/constants';
|
|
||||||
|
|
||||||
import ArgumentsTab, { IArgumentsState } from './ArgumentsTab';
|
import ArgumentsTab, { IArgumentsState } from './ArgumentsTab';
|
||||||
import ConstituentaTab from './ConstituentaTab';
|
import ConstituentaTab from './ConstituentaTab';
|
||||||
|
@ -138,7 +137,7 @@ function DlgConstituentaTemplate({ hideWindow, schema, onCreate, insertAfter }:
|
||||||
<ArgumentsTab schema={schema} state={substitutes} partialUpdate={updateSubstitutes} />
|
<ArgumentsTab schema={schema} state={substitutes} partialUpdate={updateSubstitutes} />
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
|
|
||||||
<TabPanel className={classnames.flex_col} style={{ display: activeTab === TabID.CONSTITUENTA ? '' : 'none' }}>
|
<TabPanel className='cc-column' style={{ display: activeTab === TabID.CONSTITUENTA ? '' : 'none' }}>
|
||||||
<ConstituentaTab state={constituenta} partialUpdate={updateConstituenta} />
|
<ConstituentaTab state={constituenta} partialUpdate={updateConstituenta} />
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|
|
@ -11,7 +11,6 @@ import TextInput from '@/components/ui/TextInput';
|
||||||
import usePartialUpdate from '@/hooks/usePartialUpdate';
|
import usePartialUpdate from '@/hooks/usePartialUpdate';
|
||||||
import { CstType, ICstCreateData, IRSForm } from '@/models/rsform';
|
import { CstType, ICstCreateData, IRSForm } from '@/models/rsform';
|
||||||
import { generateAlias, validateNewAlias } from '@/models/rsformAPI';
|
import { generateAlias, validateNewAlias } from '@/models/rsformAPI';
|
||||||
import { classnames } from '@/utils/constants';
|
|
||||||
import { labelCstType } from '@/utils/labels';
|
import { labelCstType } from '@/utils/labels';
|
||||||
import { SelectorCstType } from '@/utils/selectors';
|
import { SelectorCstType } from '@/utils/selectors';
|
||||||
|
|
||||||
|
@ -53,7 +52,7 @@ function DlgCreateCst({ hideWindow, initial, schema, onCreate }: DlgCreateCstPro
|
||||||
canSubmit={validated}
|
canSubmit={validated}
|
||||||
onSubmit={handleSubmit}
|
onSubmit={handleSubmit}
|
||||||
submitText='Создать'
|
submitText='Создать'
|
||||||
className={clsx('w-[35rem]', 'py-2 px-6', classnames.flex_col)}
|
className={clsx('cc-column', 'w-[35rem]', 'py-2 px-6')}
|
||||||
>
|
>
|
||||||
<div className='flex self-center gap-6'>
|
<div className='flex self-center gap-6'>
|
||||||
<SelectSingle
|
<SelectSingle
|
||||||
|
|
|
@ -8,7 +8,6 @@ import TextArea from '@/components/ui/TextArea';
|
||||||
import TextInput from '@/components/ui/TextInput';
|
import TextInput from '@/components/ui/TextInput';
|
||||||
import { IVersionData, IVersionInfo } from '@/models/library';
|
import { IVersionData, IVersionInfo } from '@/models/library';
|
||||||
import { nextVersion } from '@/models/libraryAPI';
|
import { nextVersion } from '@/models/libraryAPI';
|
||||||
import { classnames } from '@/utils/constants';
|
|
||||||
|
|
||||||
interface DlgCreateVersionProps extends Pick<ModalProps, 'hideWindow'> {
|
interface DlgCreateVersionProps extends Pick<ModalProps, 'hideWindow'> {
|
||||||
versions: IVersionInfo[];
|
versions: IVersionInfo[];
|
||||||
|
@ -38,7 +37,7 @@ function DlgCreateVersion({ hideWindow, versions, onCreate }: DlgCreateVersionPr
|
||||||
canSubmit={canSubmit}
|
canSubmit={canSubmit}
|
||||||
onSubmit={handleSubmit}
|
onSubmit={handleSubmit}
|
||||||
submitText='Создать'
|
submitText='Создать'
|
||||||
className={clsx('w-[30rem]', 'py-2 px-6', classnames.flex_col)}
|
className={clsx('cc-column', 'w-[30rem]', 'py-2 px-6')}
|
||||||
>
|
>
|
||||||
<TextInput
|
<TextInput
|
||||||
id='dlg_version'
|
id='dlg_version'
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { useMemo, useState } from 'react';
|
||||||
import Checkbox from '@/components/ui/Checkbox';
|
import Checkbox from '@/components/ui/Checkbox';
|
||||||
import Modal, { ModalProps } from '@/components/ui/Modal';
|
import Modal, { ModalProps } from '@/components/ui/Modal';
|
||||||
import { IRSForm } from '@/models/rsform';
|
import { IRSForm } from '@/models/rsform';
|
||||||
import { classnames, prefixes } from '@/utils/constants';
|
import { prefixes } from '@/utils/constants';
|
||||||
|
|
||||||
import ConstituentsList from './ConstituentsList';
|
import ConstituentsList from './ConstituentsList';
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ function DlgDeleteCst({ hideWindow, selected, schema, onDelete }: DlgDeleteCstPr
|
||||||
submitText={expandOut ? 'Удалить с зависимыми' : 'Удалить'}
|
submitText={expandOut ? 'Удалить с зависимыми' : 'Удалить'}
|
||||||
hideWindow={hideWindow}
|
hideWindow={hideWindow}
|
||||||
onSubmit={handleSubmit}
|
onSubmit={handleSubmit}
|
||||||
className={clsx('max-w-[60vw] min-w-[30rem]', 'px-6', classnames.flex_col)}
|
className={clsx('cc-column', 'max-w-[60vw] min-w-[30rem]', 'px-6')}
|
||||||
>
|
>
|
||||||
<ConstituentsList
|
<ConstituentsList
|
||||||
title='Выбраны к удалению'
|
title='Выбраны к удалению'
|
||||||
|
|
|
@ -53,7 +53,7 @@ function DlgInlineSynthesis({ hideWindow, receiver, onInlineSynthesis }: DlgInli
|
||||||
<Modal
|
<Modal
|
||||||
header='Импорт концептуальной схем'
|
header='Импорт концептуальной схем'
|
||||||
submitText='Добавить конституенты'
|
submitText='Добавить конституенты'
|
||||||
className='w-[35rem] h-[30rem] px-6'
|
className='w-[40rem] h-[40rem] px-6'
|
||||||
hideWindow={hideWindow}
|
hideWindow={hideWindow}
|
||||||
canSubmit={validated}
|
canSubmit={validated}
|
||||||
onSubmit={handleSubmit}
|
onSubmit={handleSubmit}
|
||||||
|
@ -66,9 +66,9 @@ function DlgInlineSynthesis({ hideWindow, receiver, onInlineSynthesis }: DlgInli
|
||||||
onSelect={setActiveTab}
|
onSelect={setActiveTab}
|
||||||
>
|
>
|
||||||
<TabList className={clsx('mb-3 self-center', 'flex', 'border divide-x rounded-none')}>
|
<TabList className={clsx('mb-3 self-center', 'flex', 'border divide-x rounded-none')}>
|
||||||
<TabLabel label='Схема' title='Выбор импортируемой схемы' className='w-[8rem]' />
|
<TabLabel label='Схема' title='Источник конституент' className='w-[8rem]' />
|
||||||
<TabLabel label='Содержание' title='Выбор переносимого содержания' className='w-[8rem]' />
|
<TabLabel label='Содержание' title='Перечень конституент' className='w-[8rem]' />
|
||||||
<TabLabel label='Отождествления' title='Отождествление добавляемый конституент' className='w-[8rem]' />
|
<TabLabel label='Отождествления' title='Таблица отождествлений' className='w-[8rem]' />
|
||||||
</TabList>
|
</TabList>
|
||||||
|
|
||||||
<TabPanel style={{ display: activeTab === TabID.SCHEMA ? '' : 'none' }}>
|
<TabPanel style={{ display: activeTab === TabID.SCHEMA ? '' : 'none' }}>
|
||||||
|
|
|
@ -28,7 +28,7 @@ function SchemaTab({ selected, setSelected }: SchemaTabProps) {
|
||||||
disabled
|
disabled
|
||||||
dense
|
dense
|
||||||
/>
|
/>
|
||||||
<SchemaPicker rows={6} value={selected} onSelectValue={setSelected} />
|
<SchemaPicker rows={16} value={selected} onSelectValue={setSelected} />
|
||||||
</FlexColumn>
|
</FlexColumn>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ import { useLibrary } from '@/context/LibraryContext';
|
||||||
import { useConceptNavigation } from '@/context/NavigationContext';
|
import { useConceptNavigation } from '@/context/NavigationContext';
|
||||||
import { LibraryItemType } from '@/models/library';
|
import { LibraryItemType } from '@/models/library';
|
||||||
import { IRSFormCreateData } from '@/models/rsform';
|
import { IRSFormCreateData } from '@/models/rsform';
|
||||||
import { classnames, EXTEOR_TRS_FILE, limits, patterns } from '@/utils/constants';
|
import { EXTEOR_TRS_FILE, limits, patterns } from '@/utils/constants';
|
||||||
|
|
||||||
function CreateRSFormPage() {
|
function CreateRSFormPage() {
|
||||||
const router = useConceptNavigation();
|
const router = useConceptNavigation();
|
||||||
|
@ -81,7 +81,7 @@ function CreateRSFormPage() {
|
||||||
return (
|
return (
|
||||||
<AnimateFade>
|
<AnimateFade>
|
||||||
<RequireAuth>
|
<RequireAuth>
|
||||||
<form className={clsx('px-6 py-3', classnames.flex_col)} onSubmit={handleSubmit}>
|
<form className={clsx('cc-column', 'px-6 py-3')} onSubmit={handleSubmit}>
|
||||||
<h1>Создание концептуальной схемы</h1>
|
<h1>Создание концептуальной схемы</h1>
|
||||||
<Overlay position='top-[-2.4rem] right-[-1rem]'>
|
<Overlay position='top-[-2.4rem] right-[-1rem]'>
|
||||||
<input
|
<input
|
||||||
|
|
|
@ -14,7 +14,7 @@ import { useAuth } from '@/context/AuthContext';
|
||||||
import { useConceptNavigation } from '@/context/NavigationContext';
|
import { useConceptNavigation } from '@/context/NavigationContext';
|
||||||
import useQueryStrings from '@/hooks/useQueryStrings';
|
import useQueryStrings from '@/hooks/useQueryStrings';
|
||||||
import { IUserLoginData } from '@/models/library';
|
import { IUserLoginData } from '@/models/library';
|
||||||
import { classnames, resources } from '@/utils/constants';
|
import { resources } from '@/utils/constants';
|
||||||
|
|
||||||
function ProcessError({ error }: { error: ErrorData }): React.ReactElement {
|
function ProcessError({ error }: { error: ErrorData }): React.ReactElement {
|
||||||
if (axios.isAxiosError(error) && error.response && error.response.status === 400) {
|
if (axios.isAxiosError(error) && error.response && error.response.status === 400) {
|
||||||
|
@ -64,7 +64,7 @@ function LoginPage() {
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<AnimateFade>
|
<AnimateFade>
|
||||||
<form className={clsx('w-[24rem]', 'pt-12 pb-6 px-6', classnames.flex_col)} onSubmit={handleSubmit}>
|
<form className={clsx('cc-column', 'w-[24rem]', 'pt-12 pb-6 px-6')} onSubmit={handleSubmit}>
|
||||||
<img alt='Концепт Портал' src={resources.logo} className='max-h-[2.5rem] min-w-[2.5rem] mb-3' />
|
<img alt='Концепт Портал' src={resources.logo} className='max-h-[2.5rem] min-w-[2.5rem] mb-3' />
|
||||||
<TextInput
|
<TextInput
|
||||||
id='username'
|
id='username'
|
||||||
|
|
|
@ -12,7 +12,6 @@ import { useAuth } from '@/context/AuthContext';
|
||||||
import { useConceptNavigation } from '@/context/NavigationContext';
|
import { useConceptNavigation } from '@/context/NavigationContext';
|
||||||
import useQueryStrings from '@/hooks/useQueryStrings';
|
import useQueryStrings from '@/hooks/useQueryStrings';
|
||||||
import { IPasswordTokenData, IResetPasswordData } from '@/models/library';
|
import { IPasswordTokenData, IResetPasswordData } from '@/models/library';
|
||||||
import { classnames } from '@/utils/constants';
|
|
||||||
|
|
||||||
function ProcessError({ error }: { error: ErrorData }): React.ReactElement {
|
function ProcessError({ error }: { error: ErrorData }): React.ReactElement {
|
||||||
if (axios.isAxiosError(error) && error.response && error.response.status === 404) {
|
if (axios.isAxiosError(error) && error.response && error.response.status === 404) {
|
||||||
|
@ -78,7 +77,7 @@ function PasswordChangePage() {
|
||||||
isLoading={loading}
|
isLoading={loading}
|
||||||
hasNoData={!isTokenValid}
|
hasNoData={!isTokenValid}
|
||||||
>
|
>
|
||||||
<form className={clsx('w-[24rem]', 'px-6 mt-3', classnames.flex_col)} onSubmit={handleSubmit}>
|
<form className={clsx('cc-column', 'w-[24rem]', 'px-6 mt-3')} onSubmit={handleSubmit}>
|
||||||
<TextInput
|
<TextInput
|
||||||
id='new_password'
|
id='new_password'
|
||||||
type='password'
|
type='password'
|
||||||
|
|
|
@ -55,7 +55,7 @@ function ConstituentaToolbar({
|
||||||
icon={<BiPlusCircle size={'1.25rem'} className='icon-green' />}
|
icon={<BiPlusCircle size={'1.25rem'} className='icon-green' />}
|
||||||
/>
|
/>
|
||||||
<MiniButton
|
<MiniButton
|
||||||
titleHtml={prepareTooltip('Клонировать конституенту', 'Alt + V]')}
|
titleHtml={prepareTooltip('Клонировать конституенту', 'Alt + V')}
|
||||||
disabled={!isMutable || isModified}
|
disabled={!isMutable || isModified}
|
||||||
onClick={onClone}
|
onClick={onClone}
|
||||||
icon={<BiDuplicate size='1.25rem' className='icon-green' />}
|
icon={<BiDuplicate size='1.25rem' className='icon-green' />}
|
||||||
|
|
|
@ -29,6 +29,7 @@ function ControlsOverlay({ constituenta, isMutable, processing, onRename, onEdit
|
||||||
className={clsx(
|
className={clsx(
|
||||||
'pt-1 pl-[1.375rem]', // prettier: split lines
|
'pt-1 pl-[1.375rem]', // prettier: split lines
|
||||||
'text-sm font-medium whitespace-nowrap',
|
'text-sm font-medium whitespace-nowrap',
|
||||||
|
'select-text cursor-default',
|
||||||
!isMutable && !processing && 'pl-[2.8rem]'
|
!isMutable && !processing && 'pl-[2.8rem]'
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
|
|
|
@ -10,7 +10,6 @@ import SubmitButton from '@/components/ui/SubmitButton';
|
||||||
import TextArea from '@/components/ui/TextArea';
|
import TextArea from '@/components/ui/TextArea';
|
||||||
import { useRSForm } from '@/context/RSFormContext';
|
import { useRSForm } from '@/context/RSFormContext';
|
||||||
import { IConstituenta, ICstUpdateData } from '@/models/rsform';
|
import { IConstituenta, ICstUpdateData } from '@/models/rsform';
|
||||||
import { classnames } from '@/utils/constants';
|
|
||||||
import { labelCstTypification } from '@/utils/labels';
|
import { labelCstTypification } from '@/utils/labels';
|
||||||
|
|
||||||
import EditorRSExpression from '../EditorRSExpression';
|
import EditorRSExpression from '../EditorRSExpression';
|
||||||
|
@ -123,7 +122,7 @@ function FormConstituenta({
|
||||||
/>
|
/>
|
||||||
<form
|
<form
|
||||||
id={id}
|
id={id}
|
||||||
className={clsx('mt-1 w-full md:w-[47.8rem] shrink-0', 'px-4 py-1', classnames.flex_col)}
|
className={clsx('cc-column', 'mt-1 w-full md:w-[47.8rem] shrink-0', 'px-4 py-1')}
|
||||||
onSubmit={handleSubmit}
|
onSubmit={handleSubmit}
|
||||||
>
|
>
|
||||||
<RefsInput
|
<RefsInput
|
||||||
|
|
|
@ -90,7 +90,7 @@ interface RSEditorControlsProps {
|
||||||
function RSEditorControls({ isOpen, disabled, onEdit }: RSEditorControlsProps) {
|
function RSEditorControls({ isOpen, disabled, onEdit }: RSEditorControlsProps) {
|
||||||
return (
|
return (
|
||||||
<motion.div
|
<motion.div
|
||||||
className='flex-wrap text-xs sm:text-sm divide-solid'
|
className='flex-wrap text-xs select-none sm:text-sm divide-solid'
|
||||||
initial={false}
|
initial={false}
|
||||||
animate={isOpen ? 'open' : 'closed'}
|
animate={isOpen ? 'open' : 'closed'}
|
||||||
variants={animateRSControl}
|
variants={animateRSControl}
|
||||||
|
|
|
@ -20,7 +20,7 @@ import { useRSForm } from '@/context/RSFormContext';
|
||||||
import { LibraryItemType } from '@/models/library';
|
import { LibraryItemType } from '@/models/library';
|
||||||
import { HelpTopic } from '@/models/miscellaneous';
|
import { HelpTopic } from '@/models/miscellaneous';
|
||||||
import { IRSFormCreateData } from '@/models/rsform';
|
import { IRSFormCreateData } from '@/models/rsform';
|
||||||
import { classnames, limits, patterns } from '@/utils/constants';
|
import { limits, patterns } from '@/utils/constants';
|
||||||
|
|
||||||
import { useRSEdit } from '../RSEditContext';
|
import { useRSEdit } from '../RSEditContext';
|
||||||
|
|
||||||
|
@ -95,11 +95,7 @@ function FormRSForm({ id, isModified, setIsModified }: FormRSFormProps) {
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<form
|
<form id={id} className={clsx('cc-column', 'mt-1 min-w-[22rem] sm:w-[30rem]', 'py-1')} onSubmit={handleSubmit}>
|
||||||
id={id}
|
|
||||||
className={clsx('mt-1 min-w-[22rem] sm:w-[30rem]', 'py-1', classnames.flex_col)}
|
|
||||||
onSubmit={handleSubmit}
|
|
||||||
>
|
|
||||||
<TextInput
|
<TextInput
|
||||||
id='schema_title'
|
id='schema_title'
|
||||||
required
|
required
|
||||||
|
|
|
@ -14,7 +14,7 @@ import useLocalStorage from '@/hooks/useLocalStorage';
|
||||||
import { GraphColoringScheme, GraphFilterParams } from '@/models/miscellaneous';
|
import { GraphColoringScheme, GraphFilterParams } from '@/models/miscellaneous';
|
||||||
import { ConstituentaID, CstType } from '@/models/rsform';
|
import { ConstituentaID, CstType } from '@/models/rsform';
|
||||||
import { colorBgGraphNode } from '@/styling/color';
|
import { colorBgGraphNode } from '@/styling/color';
|
||||||
import { classnames, TIMEOUT_GRAPH_REFRESH } from '@/utils/constants';
|
import { TIMEOUT_GRAPH_REFRESH } from '@/utils/constants';
|
||||||
|
|
||||||
import { useRSEdit } from '../RSEditContext';
|
import { useRSEdit } from '../RSEditContext';
|
||||||
import GraphSidebar from './GraphSidebar';
|
import GraphSidebar from './GraphSidebar';
|
||||||
|
@ -222,7 +222,7 @@ function EditorTermGraph({ selected, setSelected, onOpenEdit }: EditorTermGraphP
|
||||||
</Overlay>
|
</Overlay>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
<Overlay position='top-0 left-0' className={clsx('w-[13.5rem]', classnames.flex_col)}>
|
<Overlay position='top-0 left-0' className='cc-column w-[13.5rem]'>
|
||||||
<GraphSidebar
|
<GraphSidebar
|
||||||
coloring={coloringScheme}
|
coloring={coloringScheme}
|
||||||
layout={layout}
|
layout={layout}
|
||||||
|
|
|
@ -19,7 +19,7 @@ import Tooltip from '@/components/ui/Tooltip';
|
||||||
import { useAuth } from '@/context/AuthContext';
|
import { useAuth } from '@/context/AuthContext';
|
||||||
import { useConceptNavigation } from '@/context/NavigationContext';
|
import { useConceptNavigation } from '@/context/NavigationContext';
|
||||||
import { type IUserSignupData } from '@/models/library';
|
import { type IUserSignupData } from '@/models/library';
|
||||||
import { classnames, globalIDs, patterns } from '@/utils/constants';
|
import { globalIDs, patterns } from '@/utils/constants';
|
||||||
|
|
||||||
function RegisterPage() {
|
function RegisterPage() {
|
||||||
const router = useConceptNavigation();
|
const router = useConceptNavigation();
|
||||||
|
@ -69,7 +69,7 @@ function RegisterPage() {
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<AnimateFade>
|
<AnimateFade>
|
||||||
<form className={clsx('px-6 py-3', classnames.flex_col)} onSubmit={handleSubmit}>
|
<form className={clsx('cc-column', 'px-6 py-3')} onSubmit={handleSubmit}>
|
||||||
<h1>Новый пользователь</h1>
|
<h1>Новый пользователь</h1>
|
||||||
<div className='flex gap-12'>
|
<div className='flex gap-12'>
|
||||||
<FlexColumn>
|
<FlexColumn>
|
||||||
|
|
|
@ -11,7 +11,6 @@ import TextInput from '@/components/ui/TextInput';
|
||||||
import TextURL from '@/components/ui/TextURL';
|
import TextURL from '@/components/ui/TextURL';
|
||||||
import { useAuth } from '@/context/AuthContext';
|
import { useAuth } from '@/context/AuthContext';
|
||||||
import { IRequestPasswordData } from '@/models/library';
|
import { IRequestPasswordData } from '@/models/library';
|
||||||
import { classnames } from '@/utils/constants';
|
|
||||||
|
|
||||||
function ProcessError({ error }: { error: ErrorData }): React.ReactElement {
|
function ProcessError({ error }: { error: ErrorData }): React.ReactElement {
|
||||||
if (axios.isAxiosError(error) && error.response && error.response.status === 400) {
|
if (axios.isAxiosError(error) && error.response && error.response.status === 400) {
|
||||||
|
@ -44,7 +43,7 @@ function RestorePasswordPage() {
|
||||||
return (
|
return (
|
||||||
<AnimateFade>
|
<AnimateFade>
|
||||||
{!isCompleted ? (
|
{!isCompleted ? (
|
||||||
<form className={clsx('w-[24rem]', 'px-6 mt-3', classnames.flex_col)} onSubmit={handleSubmit}>
|
<form className={clsx('cc-column', 'w-[24rem]', 'px-6 mt-3')} onSubmit={handleSubmit}>
|
||||||
<TextInput
|
<TextInput
|
||||||
id='email'
|
id='email'
|
||||||
allowEnter
|
allowEnter
|
||||||
|
|
|
@ -9,7 +9,6 @@ import TextInput from '@/components/ui/TextInput';
|
||||||
import { useBlockNavigation } from '@/context/NavigationContext';
|
import { useBlockNavigation } from '@/context/NavigationContext';
|
||||||
import { useUserProfile } from '@/context/UserProfileContext';
|
import { useUserProfile } from '@/context/UserProfileContext';
|
||||||
import { IUserUpdateData } from '@/models/library';
|
import { IUserUpdateData } from '@/models/library';
|
||||||
import { classnames } from '@/utils/constants';
|
|
||||||
|
|
||||||
function EditorProfile() {
|
function EditorProfile() {
|
||||||
const { updateUser, user, processing } = useUserProfile();
|
const { updateUser, user, processing } = useUserProfile();
|
||||||
|
@ -48,7 +47,7 @@ function EditorProfile() {
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<form onSubmit={handleSubmit} className={clsx('min-w-[18rem]', 'px-6 py-2', classnames.flex_col)}>
|
<form onSubmit={handleSubmit} className={clsx('cc-column', 'min-w-[18rem]', 'px-6 py-2')}>
|
||||||
<TextInput
|
<TextInput
|
||||||
id='username'
|
id='username'
|
||||||
autoComplete='username'
|
autoComplete='username'
|
||||||
|
|
|
@ -192,4 +192,12 @@
|
||||||
@apply clr-text-green;
|
@apply clr-text-green;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.cc-label {
|
||||||
|
@apply text-sm font-medium cursor-default select-text whitespace-nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cc-column {
|
||||||
|
@apply flex flex-col gap-3;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,14 +60,6 @@ export const youtube = {
|
||||||
intro: '0Ty9mu9sOJo'
|
intro: '0Ty9mu9sOJo'
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Tailwind CSS combinations.
|
|
||||||
* Note: using clsx in conjunction with tailwindCss is preferred to creating custom CSS
|
|
||||||
*/
|
|
||||||
export const classnames = {
|
|
||||||
flex_col: 'flex flex-col gap-3'
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constant URLs.
|
* Constant URLs.
|
||||||
*/
|
*/
|
||||||
|
@ -101,6 +93,7 @@ export const globalIDs = {
|
||||||
export const prefixes = {
|
export const prefixes = {
|
||||||
page_size: 'page_size_',
|
page_size: 'page_size_',
|
||||||
cst_list: 'cst_list_',
|
cst_list: 'cst_list_',
|
||||||
|
cst_inline_synth_list: 'cst_inline_synth_list',
|
||||||
cst_side_table: 'cst_side_table_',
|
cst_side_table: 'cst_side_table_',
|
||||||
cst_hidden_list: 'cst_hidden_list_',
|
cst_hidden_list: 'cst_hidden_list_',
|
||||||
cst_modal_list: 'cst_modal_list_',
|
cst_modal_list: 'cst_modal_list_',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user