Skip to content
This repository has been archived by the owner on May 18, 2024. It is now read-only.

button cursor changes #386

Merged
merged 1 commit into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/ui-toolkit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@groww-tech/ui-toolkit",
"version": "0.5.1",
"version": "0.5.2",
"description": "A lightning nature UI",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
Expand Down
4 changes: 3 additions & 1 deletion packages/ui-toolkit/src/components/atoms/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const Button = (props: Props) => {
backgroundAccentSubtle: (isAccent && !isDisabled) || (isAccent && isDisabled && isLoading),
contentDisabled: isDisabled,
borderPrimary: !isAccent,
btn96ButtonDisable: isDisabled
btn96ButtonDisable: isDisabled && !isLoading
});

const tertiaryButtonClasses = cn({
Expand All @@ -64,6 +64,8 @@ const Button = (props: Props) => {
});

const fontClasses = cn({
'cur-po': !isLoading && !isDisabled,
btn96LoaderCursor: isLoading || isDisabled,
bodySmallHeavy: size === BUTTON_SIZES.SMALL,
bodyBaseHeavy: size === BUTTON_SIZES.BASE,
bodyLargeHeavy: size === BUTTON_SIZES.LARGE,
Expand Down
5 changes: 4 additions & 1 deletion packages/ui-toolkit/src/components/atoms/Button/button.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.btn96DefaultClass {
border-radius: 8px;
flex-shrink: 0;
cursor: default;
}


Expand Down Expand Up @@ -148,4 +147,8 @@
width: 100%;
z-index: 1000;
bottom: 0;
}

.btn96LoaderCursor {
cursor: default;
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ const ToggleSwitch = (props: Props) => {
'cur-po': !isDisabled
});


const onToggleSwitch = (e: React.MouseEvent<HTMLDivElement, MouseEvent> | React.ChangeEvent<HTMLInputElement>) => {
if (!isDisabled) {
onChange(e);

} else {
e.stopPropagation();
}
};

return (
<div className={baseClasses}>
<div className={labelClasses}>
Expand All @@ -55,12 +65,12 @@ const ToggleSwitch = (props: Props) => {
<div
className='sw348reactSwitchDivision'
data-test-id={dataTestId.length ? dataTestId : null}
onClick={(e) => onChange(e)}
onClick={(e) => onToggleSwitch(e)}
>
<input
style={inputStyle}
checked={isActive}
onChange={(e) => onChange(e)}
onChange={(e) => onToggleSwitch(e)}
className="sw348reactSwitchCheckbox"
id="reactSwitchId"
type="checkbox"
Expand Down