File tree Expand file tree Collapse file tree 3 files changed +12
-21
lines changed
packages/experience/src/components/Button Expand file tree Collapse file tree 3 files changed +12
-21
lines changed Original file line number Diff line number Diff line change @@ -46,12 +46,7 @@ const SocialLinkButton = ({
4646 className
4747 ) }
4848 type = "button"
49- onClick = { ( ) => {
50- if ( isLoading ) {
51- return ;
52- }
53- onClick ?.( ) ;
54- } }
49+ onClick = { onClick }
5550 >
5651 { logo && ! isLoadingActive && (
5752 < img src = { logo } alt = { target } className = { socialLinkButtonStyles . icon } />
Original file line number Diff line number Diff line change 5454 background : var (--color-brand-default );
5555 color : var (--color-static-white );
5656
57- & .disabled ,
58- & :disabled {
57+ & .disabled :not ( .loading ) ,
58+ & :disabled:not ( .loading ) {
5959 background : var (--color-bg-state-disabled );
6060 color : var (--color-type-disable );
6161 }
6464 background : var (--color-brand-pressed );
6565 }
6666
67- & .loading {
67+ & .loadingActive {
6868 background-color : var (--color-brand-loading );
6969 }
7070}
7474 background : transparent ;
7575 color : var (--color-type-primary );
7676
77- & .disabled ,
78- & :disabled {
77+ & .disabled :not ( .loading ) ,
78+ & :disabled:not ( .loading ) {
7979 border-color : var (--color-type-disable );
8080 color : var (--color-type-disable );
8181 }
9696 outline : 3px solid var (--color-overlay-brand-focused );
9797 }
9898
99- & :not (:disabled ):not (:active ):not (.loading ):hover {
99+ & :not (:disabled ):not (:active ):not (.loadingActive ):hover {
100100 background : var (--color-brand-hover );
101101 }
102102 }
106106 outline : 3px solid var (--color-overlay-neutral-focused );
107107 }
108108
109- & :not (:disabled ):not (:active ):not (.loading ):hover {
109+ & :not (:disabled ):not (:active ):not (.loadingActive ):hover {
110110 background : var (--color-overlay-neutral-hover );
111111 }
112112 }
Original file line number Diff line number Diff line change @@ -43,22 +43,18 @@ const Button = ({
4343
4444 return (
4545 < button
46- disabled = { isDisabled }
46+ disabled = { isDisabled || isLoading }
4747 className = { classNames (
4848 styles . button ,
4949 styles [ type ] ,
5050 styles [ size ] ,
5151 isDisabled && styles . disabled ,
52- isLoadingActive && styles . loading ,
52+ isLoading && styles . loading ,
53+ isLoadingActive && styles . loadingActive ,
5354 className
5455 ) }
5556 type = { htmlType }
56- onClick = { ( event ) => {
57- if ( isLoading ) {
58- return ;
59- }
60- onClick ?.( event ) ;
61- } }
57+ onClick = { onClick }
6258 { ...rest }
6359 >
6460 < span
You can’t perform that action at this time.
0 commit comments