Button: Add ability to opt-out of upper case transform (#4690)

This commit is contained in:
zubiden 2024-06-18 16:30:33 +02:00 committed by Alexander Zinchuk
parent 0eaced14db
commit 4cef8b62c1
3 changed files with 9 additions and 1 deletions

View File

@ -165,7 +165,7 @@ const StarsBalanceModal = ({
<StarTopupOption option={option} starsCount={starsCount} onClick={handleClick} /> <StarTopupOption option={option} starsCount={starsCount} onClick={handleClick} />
))} ))}
{!areOptionsExtended && ( {!areOptionsExtended && (
<Button className={styles.moreOptions} isText onClick={markOptionsExtended}> <Button className={styles.moreOptions} noForcedUpperCase isText onClick={markOptionsExtended}>
{lang('Stars.Purchase.ShowMore')} {lang('Stars.Purchase.ShowMore')}
<Icon className={styles.iconDown} name="down" /> <Icon className={styles.iconDown} name="down" />
</Button> </Button>

View File

@ -43,6 +43,7 @@
overflow: hidden; overflow: hidden;
transition: background-color 0.15s, color 0.15s; transition: background-color 0.15s, color 0.15s;
text-decoration: none !important; text-decoration: none !important;
text-transform: uppercase;
--premium-gradient: linear-gradient(88.39deg, #6C93FF -2.56%, #976FFF 51.27%, #DF69D1 107.39%); --premium-gradient: linear-gradient(88.39deg, #6C93FF -2.56%, #976FFF 51.27%, #DF69D1 107.39%);
@ -53,6 +54,10 @@
transition: none !important; transition: none !important;
} }
&.no-upper-case {
text-transform: none;
}
&.disabled { &.disabled {
cursor: var(--custom-cursor, default); cursor: var(--custom-cursor, default);

View File

@ -47,6 +47,7 @@ export type OwnProps = {
isRectangular?: boolean; isRectangular?: boolean;
withPremiumGradient?: boolean; withPremiumGradient?: boolean;
noPreventDefault?: boolean; noPreventDefault?: boolean;
noForcedUpperCase?: boolean;
shouldStopPropagation?: boolean; shouldStopPropagation?: boolean;
style?: string; style?: string;
onClick?: (e: ReactMouseEvent<HTMLButtonElement, MouseEvent>) => void; onClick?: (e: ReactMouseEvent<HTMLButtonElement, MouseEvent>) => void;
@ -102,6 +103,7 @@ const Button: FC<OwnProps> = ({
isRectangular, isRectangular,
noPreventDefault, noPreventDefault,
shouldStopPropagation, shouldStopPropagation,
noForcedUpperCase,
style, style,
}) => { }) => {
// eslint-disable-next-line no-null/no-null // eslint-disable-next-line no-null/no-null
@ -134,6 +136,7 @@ const Button: FC<OwnProps> = ({
isShiny && 'shiny', isShiny && 'shiny',
withPremiumGradient && 'premium', withPremiumGradient && 'premium',
isRectangular && 'rectangular', isRectangular && 'rectangular',
noForcedUpperCase && 'no-upper-case',
); );
const handleClick = useLastCallback((e: ReactMouseEvent<HTMLButtonElement, MouseEvent>) => { const handleClick = useLastCallback((e: ReactMouseEvent<HTMLButtonElement, MouseEvent>) => {