Refactoring: remove redundant flex classnames

This commit is contained in:
IRBorisov 2023-12-19 11:18:28 +03:00
parent 930c185908
commit c138315deb
12 changed files with 21 additions and 23 deletions

View File

@ -10,7 +10,7 @@ Styling conventions
- layer: z-position
- outer layout: fixed bottom-1/2 left-0 -translate-x-1/2
- rectangle: mt-3 min-w-fit min-w-10 flex-grow shrink-0
- inner layout: px-3 py-2 flex flex-col gap-3 justify-start items-center
- inner layout: px-3 py-2 flex flex-col gap-3 justify-between items-center
- overflow behavior: overflow-scroll
- border: borer-2 outline-none shadow-md
- colors: clr-controls

View File

@ -20,7 +20,7 @@ function Dropdown({
layer='z-modal-tooltip'
position='mt-3'
className={clsx(
'flex flex-col items-stretch',
'flex flex-col',
'border rounded-md shadow-lg',
'text-sm',
'clr-input',

View File

@ -19,7 +19,7 @@ function TextArea({
<div className={clsx(
{
'flex flex-col gap-2': !dense,
'flex justify-stretch items-center gap-3': dense
'flex items-center gap-3': dense
},
dense && className,
)}>

View File

@ -26,7 +26,7 @@ function TextInput({
<div className={clsx(
{
'flex flex-col gap-2': !dense,
'flex justify-stretch items-center gap-3': dense,
'flex items-center gap-3': dense,
},
dense && className
)}>

View File

@ -12,23 +12,23 @@ function InfoLibraryItem({ item }: InfoLibraryItemProps) {
const intl = useIntl();
return (
<div className='flex flex-col gap-1'>
<div className='flex justify-start'>
<div className='flex'>
<label className='font-semibold'>Владелец:</label>
<span className='min-w-[200px] ml-2 overflow-ellipsis overflow-hidden whitespace-nowrap'>
{getUserLabel(item?.owner ?? null)}
</span>
</div>
<div className='flex justify-start'>
<div className='flex'>
<label className='font-semibold'>Отслеживают:</label>
<span id='subscriber-count' className='ml-2'>
{ item?.subscribers.length ?? 0 }
</span>
</div>
<div className='flex justify-start'>
<div className='flex'>
<label className='font-semibold'>Дата обновления:</label>
<span className='ml-2'>{item && new Date(item?.time_update).toLocaleString(intl.locale)}</span>
</div>
<div className='flex justify-start'>
<div className='flex'>
<label className='font-semibold'>Дата создания:</label>
<span className='ml-8'>{item && new Date(item?.time_create).toLocaleString(intl.locale)}</span>
</div>

View File

@ -88,7 +88,7 @@ function TemplateTab({ state, partialUpdate }: TemplateTabProps) {
return (
<>
<div className='flex justify-stretch'>
<div className='flex'>
<SelectSingle
placeholder='Выберите категорию'
className='flex-grow border-none'
@ -102,7 +102,7 @@ function TemplateTab({ state, partialUpdate }: TemplateTabProps) {
/>
<SelectSingle
placeholder='Выберите источник'
className='min-w-[12rem]'
className='w-[12rem]'
options={templateSelector}
value={state.templateID ? { value: state.templateID, label: templates.find(item => item.id == state.templateID)!.title }: null}
onChange={data => partialUpdate({templateID: (data ? data.value : undefined)})}

View File

@ -144,10 +144,10 @@ function DlgEditWordForms({ hideWindow, target, onSave }: DlgEditWordFormsProps)
<Label text='Параметры словоформы' />
</div>
<div className='flex justify-stretch'>
<div className='flex'>
<TextArea
placeholder='Введите текст'
className='min-w-[20rem] min-h-[5rem] flex-grow'
className='min-w-[20rem] min-h-[5rem]'
rows={2}
value={inputText}
onChange={event => setInputText(event.target.value)}

View File

@ -45,7 +45,7 @@ function SearchPanel({ total, filtered, query, setQuery, strategy, setFilter }:
<div className={clsx(
'sticky top-0',
'w-full max-h-[2.3rem]',
'pr-40 flex items-stretch',
'pr-40 flex',
'border-b',
'clr-input'
)}>

View File

@ -21,7 +21,7 @@ function ManualsPage() {
return (
<div
className='flex items-start justify-start w-full max-w-[90rem] gap-2'
className='flex items-start w-full max-w-[90rem] gap-2'
style={{minHeight: mainHeight}}
>
<TopicsList

View File

@ -186,13 +186,11 @@ function EditorRSExpression({
/> : null}
{(parseData && parseData.errors.length > 0) ?
<div className='flex-grow text-sm border overflow-y-auto max-h-[4.5rem] min-h-[4.5rem]'>
<ParsingResult
data={parseData}
disabled={disabled}
onShowError={onShowError}
/>
</div> : null}
/>: null}
</div>
</>);
}

View File

@ -15,7 +15,7 @@ function ParsingResult({ data, disabled, onShowError }: ParsingResultProps) {
const warningsCount = data.errors.length - errorCount;
return (
<div className='px-2 pt-1 text-sm'>
<div className='px-2 pt-1 text-sm border overflow-y-auto h-[4.5rem]'>
<p>Ошибок: <b>{errorCount}</b> | Предупреждений: <b>{warningsCount}</b></p>
{data.errors.map(
(error, index) => {

View File

@ -75,7 +75,7 @@ function ConstituentsSearch({ schema, activeID, activeExpression, setFiltered }:
}, [sourceMenu, setFilterSource]);
return (
<div className='flex items-stretch border-b clr-input'>
<div className='flex border-b clr-input'>
<ConceptSearch noBorder
className='min-w-[6rem] pr-2 flex-grow'
value={filterText}