Various style fixes (#4977)

This commit is contained in:
zubiden 2024-09-11 02:07:08 +02:00 committed by Alexander Zinchuk
parent 3e896c4335
commit da6f094d41
11 changed files with 30 additions and 20 deletions

View File

@ -249,6 +249,11 @@
> .PickerSelectedItem { > .PickerSelectedItem {
flex-shrink: 0; flex-shrink: 0;
} }
&::after {
content: "";
flex-grow: 1;
}
} }
.NothingFound { .NothingFound {

View File

@ -79,14 +79,10 @@
.Checkbox-main { .Checkbox-main {
&::after { &::after {
left: 0.125rem; left: 0.125rem;
background-color: var(--color-primary); background-color: var(--accent-color);
.Message.own & { .theme-dark & {
background-color: var(--accent-color); background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEzLjkuOEw1LjggOC45IDIuMSA1LjJjLS40LS40LTEuMS0uNC0xLjYgMC0uNC40LS40IDEuMSAwIDEuNkw1IDExLjJjLjQuNCAxLjEuNCAxLjYgMGw4LjktOC45Yy40LS40LjQtMS4xIDAtMS42LS41LS40LTEuMi0uNC0xLjYuMXoiIGZpbGw9IiM3NjZhYzgiLz48L3N2Zz4=);
.theme-dark & {
background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEzLjkuOEw1LjggOC45IDIuMSA1LjJjLS40LS40LTEuMS0uNC0xLjYgMC0uNC40LS40IDEuMSAwIDEuNkw1IDExLjJjLjQuNCAxLjEuNCAxLjYgMGw4LjktOC45Yy40LS40LjQtMS4xIDAtMS42LS41LS40LTEuMi0uNC0xLjYuMXoiIGZpbGw9IiM3NjZhYzgiLz48L3N2Zz4=);
}
} }
} }
} }

View File

@ -298,6 +298,7 @@ const Poll: FC<OwnProps & StateProps> = ({
onChange={handleCheckboxChange} onChange={handleCheckboxChange}
disabled={message.isScheduled || isSubmitting} disabled={message.isScheduled || isSubmitting}
loadingOptions={isSubmitting ? chosenOptions : undefined} loadingOptions={isSubmitting ? chosenOptions : undefined}
isRound
/> />
) )
: ( : (

View File

@ -189,7 +189,6 @@ const StarsBalanceModal = ({
</Transition> </Transition>
</div> </div>
<TabList <TabList
big
activeTab={selectedTabIndex} activeTab={selectedTabIndex}
tabs={TRANSACTION_TABS} tabs={TRANSACTION_TABS}
onSwitchTab={setSelectedTabIndex} onSwitchTab={setSelectedTabIndex}

View File

@ -709,7 +709,7 @@ const Profile: FC<OwnProps & StateProps> = ({
> >
{renderContent()} {renderContent()}
</Transition> </Transition>
<TabList big activeTab={renderingActiveTab} tabs={tabs} onSwitchTab={handleSwitchTab} /> <TabList activeTab={renderingActiveTab} tabs={tabs} onSwitchTab={handleSwitchTab} />
</div> </div>
)} )}

View File

@ -323,7 +323,7 @@ const BoostStatistics = ({
> >
{renderContent()} {renderContent()}
</Transition> </Transition>
<TabList big activeTab={renderingActiveTab} tabs={tabs} onSwitchTab={setActiveTab} /> <TabList activeTab={renderingActiveTab} tabs={tabs} onSwitchTab={setActiveTab} />
</div> </div>
) : ( ) : (
<div className={styles.section}> <div className={styles.section}>

View File

@ -12,6 +12,14 @@
opacity: 0.5; opacity: 0.5;
} }
&.round {
.Checkbox-main {
&::before, &::after {
border-radius: 50%;
}
}
}
&.withIcon { &.withIcon {
padding-inline-start: 1rem; padding-inline-start: 1rem;
.Checkbox-main { .Checkbox-main {

View File

@ -38,6 +38,7 @@ type OwnProps = {
isLoading?: boolean; isLoading?: boolean;
withCheckedCallback?: boolean; withCheckedCallback?: boolean;
onlyInput?: boolean; onlyInput?: boolean;
isRound?: boolean;
className?: string; className?: string;
onChange?: (e: ChangeEvent<HTMLInputElement>, nestedOptionList?: IRadioOption) => void; onChange?: (e: ChangeEvent<HTMLInputElement>, nestedOptionList?: IRadioOption) => void;
onCheck?: (isChecked: boolean) => void; onCheck?: (isChecked: boolean) => void;
@ -66,14 +67,15 @@ const Checkbox: FC<OwnProps> = ({
className, className,
rightIcon, rightIcon,
onlyInput, onlyInput,
onChange, isRound,
onCheck,
onClickLabel,
nestedCheckbox, nestedCheckbox,
nestedCheckboxCount, nestedCheckboxCount,
nestedOptionList, nestedOptionList,
leftElement, leftElement,
values = [], values = [],
onChange,
onCheck,
onClickLabel,
}) => { }) => {
const lang = useOldLang(); const lang = useOldLang();
// eslint-disable-next-line no-null/no-null // eslint-disable-next-line no-null/no-null
@ -119,6 +121,7 @@ const Checkbox: FC<OwnProps> = ({
permissionGroup && 'permission-group', permissionGroup && 'permission-group',
Boolean(leftElement) && 'avatar', Boolean(leftElement) && 'avatar',
onlyInput && 'onlyInput', onlyInput && 'onlyInput',
isRound && 'round',
className, className,
); );

View File

@ -24,6 +24,7 @@ type OwnProps = {
disabled?: boolean; disabled?: boolean;
nestedCheckbox?: boolean; nestedCheckbox?: boolean;
loadingOptions?: string[]; loadingOptions?: string[];
isRound?: boolean;
onChange: (value: string[]) => void; onChange: (value: string[]) => void;
}; };
@ -34,6 +35,7 @@ const CheckboxGroup: FC<OwnProps> = ({
disabled, disabled,
nestedCheckbox, nestedCheckbox,
loadingOptions, loadingOptions,
isRound,
onChange, onChange,
}) => { }) => {
const [values, setValues] = useState<string[]>(selected || []); const [values, setValues] = useState<string[]>(selected || []);
@ -93,6 +95,7 @@ const CheckboxGroup: FC<OwnProps> = ({
nestedCheckboxCount={getCheckedNestedCount(option.nestedOptions ?? [])} nestedCheckboxCount={getCheckedNestedCount(option.nestedOptions ?? [])}
nestedOptionList={option} nestedOptionList={option}
values={values} values={values}
isRound={isRound}
/> />
); );
})} })}

View File

@ -18,10 +18,6 @@
scrollbar-width: none; scrollbar-width: none;
scrollbar-color: rgba(0, 0, 0, 0); scrollbar-color: rgba(0, 0, 0, 0);
&.big {
font-size: 1rem;
}
&::-webkit-scrollbar { &::-webkit-scrollbar {
height: 0; height: 0;
} }

View File

@ -29,7 +29,6 @@ type OwnProps = {
tabs: readonly TabWithProperties[]; tabs: readonly TabWithProperties[];
areFolders?: boolean; areFolders?: boolean;
activeTab: number; activeTab: number;
big?: boolean;
className?: string; className?: string;
onSwitchTab: (index: number) => void; onSwitchTab: (index: number) => void;
contextRootElementSelector?: string; contextRootElementSelector?: string;
@ -40,7 +39,7 @@ const TAB_SCROLL_THRESHOLD_PX = 16;
const SCROLL_DURATION = IS_IOS ? 450 : IS_ANDROID ? 400 : 300; const SCROLL_DURATION = IS_IOS ? 450 : IS_ANDROID ? 400 : 300;
const TabList: FC<OwnProps> = ({ const TabList: FC<OwnProps> = ({
tabs, areFolders, activeTab, big, onSwitchTab, tabs, areFolders, activeTab, onSwitchTab,
contextRootElementSelector, className, contextRootElementSelector, className,
}) => { }) => {
// eslint-disable-next-line no-null/no-null // eslint-disable-next-line no-null/no-null
@ -77,7 +76,7 @@ const TabList: FC<OwnProps> = ({
return ( return (
<div <div
className={buildClassName('TabList', 'no-scrollbar', big && 'big', className)} className={buildClassName('TabList', 'no-scrollbar', className)}
ref={containerRef} ref={containerRef}
dir={lang.isRtl ? 'rtl' : undefined} dir={lang.isRtl ? 'rtl' : undefined}
> >