Button: Remove 'smaller' size in some components (#6169)

This commit is contained in:
zubiden 2025-08-29 08:57:58 +02:00 committed by Alexander Zinchuk
parent fd4bf1797e
commit 4c950b34d8
40 changed files with 18 additions and 52 deletions

View File

@ -77,7 +77,7 @@ const AuthRegister: FC<StateProps> = ({
autoComplete="family-name"
/>
{isButtonShown && (
<Button size="smaller" type="submit" ripple isLoading={authIsLoading}>{lang('Next')}</Button>
<Button type="submit" ripple isLoading={authIsLoading}>{lang('Next')}</Button>
)}
</form>
</div>

View File

@ -109,7 +109,6 @@ const CountryPickerModal: FC<OwnProps> = ({
<div className={styles.footer}>
<Button
size="smaller"
onClick={handleSubmit}
>
{lang('SelectCountries.OK')}

View File

@ -112,7 +112,6 @@ const InviteLink: FC<OwnProps> = ({
</div>
{withShare && (
<Button
size="smaller"
disabled={isDisabled}
onClick={handleShare}
className={styles.share}

View File

@ -155,7 +155,7 @@ const PasswordForm: FC<OwnProps> = ({
</div>
{description && <p className="description">{description}</p>}
{onSubmit && (canSubmit || shouldShowSubmit) && (
<Button size="smaller" type="submit" ripple={!noRipple} isLoading={isLoading} disabled={!canSubmit}>
<Button type="submit" ripple={!noRipple} isLoading={isLoading} disabled={!canSubmit}>
{submitLabel}
</Button>
)}

View File

@ -110,7 +110,6 @@ const PrivacySettingsNoticeModal = ({ isOpen, isReadDate, user }: OwnProps & Sta
)}
</p>
<Button
size="smaller"
onClick={isReadDate ? handleShowReadTime : handleShowLastSeen}
className={styles.button}
>
@ -126,7 +125,6 @@ const PrivacySettingsNoticeModal = ({ isOpen, isReadDate, user }: OwnProps & Sta
</p>
<Button
withPremiumGradient
size="smaller"
onClick={handleOpenPremium}
className={styles.button}
>

View File

@ -239,7 +239,6 @@ const StickerSetModal: FC<OwnProps & StateProps> = ({
</div>
<div className="button-wrapper">
<Button
size="smaller"
fluid
color={isAdded ? 'danger' : 'primary'}
onClick={handleButtonClick}

View File

@ -69,7 +69,6 @@ function PaidMessagePrice({
<Button
color="primary"
fluid
size="smaller"
noForcedUpperCase
className="settings-unlock-button"
onClick={handleUnlockWithPremium}

View File

@ -50,7 +50,6 @@ const PickerModal = ({
withPremiumGradient={withPremiumGradient}
onClick={onConfirm || modalProps.onClose}
color="primary"
size="smaller"
disabled={isConfirmDisabled}
>
{confirmButtonText || lang('Confirm')}

View File

@ -405,7 +405,6 @@ const ChatExtra: FC<OwnProps & StateProps> = ({
>
<Button
className={styles.openAppButton}
size="smaller"
onClick={handleOpenApp}
>
{oldLang('ProfileBotOpenApp')}

View File

@ -57,7 +57,6 @@ const EmptyFolder: FC<OwnProps & StateProps> = ({
fluid
pill
onClick={handleEditFolder}
size="smaller"
isRtl={lang.isRtl}
>
<Icon name="settings" />

View File

@ -54,7 +54,6 @@ const EmptyForum: FC<OwnProps & StateProps> = ({
ripple={!isMobile}
fluid
onClick={handleCreateTopic}
size="smaller"
isRtl={lang.isRtl}
>
<div className={styles.buttonText}>

View File

@ -57,10 +57,10 @@ const UnconfirmedSession = ({ sessions, onHeightChange }: OwnProps) => {
{lang('UnconfirmedAuthSingle', locationString)}
</p>
<div className={styles.buttons}>
<Button fluid isText size="smaller" className={styles.button} onClick={handleAccept}>
<Button fluid isText className={styles.button} onClick={handleAccept}>
{lang('UnconfirmedAuthConfirm')}
</Button>
<Button fluid isText size="smaller" color="danger" onClick={handleReject} className={styles.button}>
<Button fluid isText color="danger" onClick={handleReject} className={styles.button}>
{lang('UnconfirmedAuthDeny')}
</Button>
</div>

View File

@ -118,7 +118,6 @@ const PublicPostsSearchLauncher = ({
<Button
className={styles.paidSearchButton}
color="primary"
size="smaller"
disabled={!searchQuery}
noForcedUpperCase
onClick={handlePaidSearchClick}
@ -164,7 +163,6 @@ const PublicPostsSearchLauncher = ({
<Button
className={styles.searchButton}
color="primary"
size="smaller"
noForcedUpperCase
disabled={!searchQuery}
onClick={handleSearchClick}
@ -209,7 +207,6 @@ const PublicPostsSearchLauncher = ({
<Button
className={styles.subscribePremiumButton}
color="primary"
size="smaller"
noForcedUpperCase
onClick={handleSubscribePremiumClick}
>

View File

@ -405,7 +405,6 @@ const SettingsPrivacy: FC<OwnProps & StateProps> = ({
<Button
color="primary"
fluid
size="smaller"
noForcedUpperCase
className="settings-unlock-button"
onClick={handleAgeVerification}

View File

@ -213,7 +213,6 @@ const SettingsFoldersMain: FC<OwnProps & StateProps> = ({
// TODO: Refactor button component to handle icon placemenet with props
className="settings-button with-icon"
color="primary"
size="smaller"
pill
fluid
onClick={handleCreateFolder}

View File

@ -339,7 +339,6 @@ const Giveaway = ({
<Button
className={styles.button}
color="adaptive"
size="smaller"
onClick={handleShowInfoClick}
>
{lang('BoostingHowItWork')}

View File

@ -167,7 +167,6 @@ const AboutAdsModal = ({ modal, minLevelToRestrictAds }: OwnProps & StateProps)
>
{regularAdContent}
<Button
size="smaller"
onClick={handleClose}
>
{oldLang('RevenueSharingAdsUnderstood')}

View File

@ -111,7 +111,6 @@ const ChatlistAlready: FC<OwnProps> = ({ invite, folder }) => {
/>
</div>
<Button
size="smaller"
onClick={handleButtonClick}
>
<div className={styles.buttonText}>

View File

@ -76,7 +76,6 @@ const ChatlistDelete: FC<OwnProps> = ({
</>
)}
<Button
size="smaller"
onClick={handleButtonClick}
>
<div className={styles.buttonText}>

View File

@ -82,7 +82,6 @@ const ChatlistNew: FC<OwnProps> = ({ invite }) => {
</div>
<Button
onClick={handleButtonClick}
size="smaller"
disabled={!selectedPeerIds.length}
>
<div className={styles.buttonText}>

View File

@ -70,7 +70,7 @@ const TableAboutModal = ({
{withSeparator && <Separator className={styles.separator} />}
{footer}
{buttonText && (
<Button size="smaller" onClick={onButtonClick || onClose}>{buttonText}</Button>
<Button onClick={onButtonClick || onClose}>{buttonText}</Button>
)}
</Modal>
);

View File

@ -103,7 +103,6 @@ const TableInfoModal = ({
{buttonText && (
<Button
className={!footer ? styles.noFooter : undefined}
size="smaller"
onClick={onButtonClick || onClose}
>
{buttonText}

View File

@ -75,7 +75,6 @@ const FrozenAccountModal = ({
<div className={styles.footer}>
<Button
className={styles.buttonAppeal}
size="smaller"
onClick={handleAppeal}
noForcedUpperCase
>
@ -83,7 +82,6 @@ const FrozenAccountModal = ({
</Button>
<Button
isText
size="smaller"
onClick={handleClose}
noForcedUpperCase
>

View File

@ -250,7 +250,7 @@ const GiftInfoModal = ({
const renderFooterButton = useLastCallback(() => {
if (canBuyGift) {
return (
<Button noForcedUpperCase size="smaller" onClick={handleBuyGift}>
<Button noForcedUpperCase onClick={handleBuyGift}>
{lang('ButtonBuyGift', {
stars: resellPrice?.currency === TON_CURRENCY_CODE
? formatTonAsIcon(lang, resellPrice.amount, { shouldConvertFromNanos: true })
@ -262,7 +262,7 @@ const GiftInfoModal = ({
if (canFocusUpgrade) {
return (
<Button size="smaller" onClick={handleFocusUpgraded}>
<Button onClick={handleFocusUpgraded}>
{lang('GiftInfoViewUpgraded')}
</Button>
);
@ -270,7 +270,7 @@ const GiftInfoModal = ({
if (canManage && savedGift?.alreadyPaidUpgradeStars && !savedGift.upgradeMsgId) {
return (
<Button size="smaller" isShiny onClick={handleOpenUpgradeModal}>
<Button isShiny onClick={handleOpenUpgradeModal}>
{lang('GiftInfoUpgradeForFree')}
<Icon name="arrow-down-circle" className={styles.upgradeIcon} />
</Button>
@ -279,7 +279,7 @@ const GiftInfoModal = ({
if (canManage && savedGift.canUpgrade && !savedGift.upgradeMsgId) {
return (
<Button size="smaller" isShiny onClick={handleOpenUpgradeModal}>
<Button isShiny onClick={handleOpenUpgradeModal}>
{lang('GiftInfoUpgrade')}
<Icon name="arrow-down-circle" className={styles.upgradeIcon} />
</Button>
@ -287,7 +287,7 @@ const GiftInfoModal = ({
}
return (
<Button size="smaller" onClick={handleClose}>
<Button onClick={handleClose}>
{lang('OK')}
</Button>
);

View File

@ -163,7 +163,7 @@ const GiftResalePriceComposerModal = ({
{lang('OnlyAcceptTONDescription')}
</div>
<Button noForcedUpperCase disabled={!isPriceCorrect} size="smaller" onClick={handleSellGift}>
<Button noForcedUpperCase disabled={!isPriceCorrect} onClick={handleSellGift}>
{isPriceCorrect && lang('ButtonSellGift', {
stars: isPriceInTon ? formatTonAsIcon(lang, price)
: formatStarsAsIcon(lang, price, { asFont: true }),

View File

@ -138,7 +138,6 @@ const GiftStatusInfoModal = ({
return (
<div className={styles.footer}>
<Button
size="smaller"
onClick={onWearClick}
>
{lang('UniqueStatusWearButton')}

View File

@ -132,7 +132,7 @@ const GiftUpgradeModal = ({ modal, recipient }: OwnProps & StateProps) => {
const footer = (
<div className={styles.footer}>
{!gift && (
<Button className={styles.footerButton} size="smaller" onClick={handleClose}>
<Button className={styles.footerButton} onClick={handleClose}>
{lang('OK')}
</Button>
)}
@ -143,7 +143,7 @@ const GiftUpgradeModal = ({ modal, recipient }: OwnProps & StateProps) => {
onCheck={setShouldKeepOriginalDetails}
checked={shouldKeepOriginalDetails}
/>
<Button className={styles.footerButton} size="smaller" isShiny onClick={handleUpgrade}>
<Button className={styles.footerButton} isShiny onClick={handleUpgrade}>
{gift.alreadyPaidUpgradeStars
? lang('GeneralConfirm')
: lang('GiftUpgradeButton', {

View File

@ -133,7 +133,7 @@ const GiftWithdrawModal = ({ modal, hasPassword, passwordHint }: OwnProps & Stat
{!hasPassword && (
<>
<span className={styles.noPassword}>{lang('ErrorPasswordMissing')}</span>
<Button className="mt-2" size="smaller" onClick={handleSetUpPassword}>{lang('SetUp2FA')}</Button>
<Button className="mt-2" onClick={handleSetUpPassword}>{lang('SetUp2FA')}</Button>
</>
)}
{hasPassword && !exportDelay && (

View File

@ -152,7 +152,6 @@ const InviteViaLinkModal: FC<OwnProps & StateProps> = ({
<Button
withPremiumGradient
isShiny
size="smaller"
onClick={handleOpenPremiumModal}
>
{lang('InvitePremiumBlockedSubscribe')}
@ -185,7 +184,6 @@ const InviteViaLinkModal: FC<OwnProps & StateProps> = ({
{canSendInviteLink && (
<Button
className={styles.sendInvites}
size="smaller"
onClick={handleSendInviteLink}
disabled={!selectedMemberIds.length}
>

View File

@ -351,7 +351,6 @@ const PaidReactionModal = ({
label={oldLang('StarsReactionShowMeInTopSenders')}
/>
<Button
size="smaller"
onClick={handleSend}
>
{lang('SendPaidReaction', { amount: starsAmount }, {

View File

@ -163,7 +163,6 @@ const PreparedMessageModal: FC<OwnProps & StateProps> = ({
{lang('WebAppShareMessageInfo', { user: getUserFullName(bot) })}
</p>
<Button
size="smaller"
onClick={handleOpenClick}
>
{lang('BotShareMessageShare')}

View File

@ -219,7 +219,6 @@ const ReportModal = ({
noReplaceNewlines
/>
<Button
size="smaller"
onClick={sendMessageReportHandler}
disabled={!renderingSection.isOptional ? !text.length : undefined}
>

View File

@ -198,7 +198,7 @@ const StarPaymentModal = ({
<div className={styles.description}>
{renderText(descriptionText, ['simple_markdown', 'emoji'])}
</div>
<Button className={styles.paymentButton} size="smaller" onClick={handlePayment} isLoading={isLoading}>
<Button className={styles.paymentButton} onClick={handlePayment} isLoading={isLoading}>
{lang(isBotSubscription ? 'StarsSubscribeBotButtonMonth' : 'StarsPay', {
amount: formatStarsAsIcon(lang, amount!, { asFont: true }),
}, {

View File

@ -217,7 +217,6 @@ const StarsSubscriptionModal: FC<OwnProps & StateProps> = ({
)}
{buttonState !== 'hidden' && (
<Button
size="smaller"
color={buttonState === 'cancel' ? 'danger' : 'primary'}
isText={buttonState === 'cancel'}
onClick={handleButtonClick}

View File

@ -282,7 +282,6 @@ const SuggestMessageModal = ({
<Button
className={styles.offerButton}
onClick={handleOffer}
size="smaller"
disabled={isDisabled}
>
{isInSuggestChangesMode ? lang('ButtonUpdateTerms')

View File

@ -126,7 +126,7 @@ const SuggestedStatusModal = ({ modal, currentUser, bot }: OwnProps & StateProps
withEmojiStatus
/>
)}
<Button size="smaller" onClick={handleSetStatus}>
<Button onClick={handleSetStatus}>
{lang('GeneralConfirm')}
</Button>
</Modal>

View File

@ -799,7 +799,7 @@ const Profile: FC<OwnProps & StateProps> = ({
{!isCurrentUserPremium && (
<>
{}
<Button className="show-more-channels" size="smaller" onClick={() => openPremiumModal()}>
<Button className="show-more-channels" onClick={() => openPremiumModal()}>
{oldLang('UnlockSimilar')}
<Icon name="unlock-badge" />
</Button>
@ -838,7 +838,7 @@ const Profile: FC<OwnProps & StateProps> = ({
{!isCurrentUserPremium && (
<>
{}
<Button className="show-more-bots" size="smaller" onClick={() => openPremiumModal()}>
<Button className="show-more-bots" onClick={() => openPremiumModal()}>
{lang('UnlockMoreSimilarBots')}
<Icon name="unlock-badge" />
</Button>

View File

@ -255,7 +255,6 @@ const MonetizationStatistics = ({
{renderAvailableReward()}
<Button
size="smaller"
type="button"
onClick={verificationMonetizationHandler}
disabled={!canWithdraw}

View File

@ -110,7 +110,6 @@ const StealthModeModal = ({ isOpen, stealthMode, isCurrentUserPremium }: StatePr
</ListItem>
<Button
className={styles.button}
size="smaller"
disabled={isOnCooldown}
isShiny={!isCurrentUserPremium}
withPremiumGradient={!isCurrentUserPremium}

View File

@ -28,7 +28,6 @@ const ShowMoreButton: FC<OwnProps> = ({
<Button
className="ShowMoreButton"
color="translucent"
size="smaller"
isText
isLoading={isLoading}
isRtl={lang.isRtl}