@@ -40,6 +40,7 @@ export const Link: React.FC<LinkProps> = (props) => {
4040 children,
4141 linkProps,
4242 justLink,
43+ isDisabled,
4344 noUnderline,
4445 ...rest
4546 } = props ;
@@ -51,22 +52,26 @@ export const Link: React.FC<LinkProps> = (props) => {
5152 as = { nextAs }
5253 justLink = { justLink }
5354 isExternal = { ( rest as any ) . isExternal }
55+ isDisabled = { isDisabled }
5456 { ...linkProps }
5557 >
5658 { justLink ? (
5759 children
5860 ) : (
5961 < ChakraLink
60- as = { asHelper ( href ) }
61- href = { href }
62- isExternal = { ( rest as any ) . isExternal || ( ! nextAs && external ( href ) ) }
6362 { ...( noUnderline && {
63+ _hover : { textDecoration : 'none !important' }
64+ } ) }
65+ isExternal = { ( rest as any ) . isExternal || ( ! nextAs && external ( href ) ) }
66+ { ...( isDisabled && {
67+ cursor : 'not-allowed' ,
68+ opacity : '0.4' ,
6469 _hover : {
65- textDecoration : 'none !important '
70+ textDecoration : 'none'
6671 }
6772 } ) }
68- { ...rest }
6973 aria-current = { isActive ? 'page' : undefined }
74+ { ...rest }
7075 >
7176 { children }
7277 </ ChakraLink >
@@ -76,19 +81,29 @@ export const Link: React.FC<LinkProps> = (props) => {
7681} ;
7782
7883export const LinkButton : React . FC < LinkButtonProps > = ( props ) => {
79- const { nextAs, href, children, linkProps, isExternal, ...rest } = props ;
84+ const {
85+ nextAs,
86+ href,
87+ children,
88+ isDisabled,
89+ linkProps,
90+ isExternal,
91+ ...rest
92+ } = props ;
8093 const isActive = useIsActive ( href ) ;
8194
8295 return (
8396 < LinkingComponent
8497 isExternal = { isExternal }
8598 href = { href }
8699 as = { nextAs }
100+ isDisabled = { isDisabled }
87101 { ...linkProps }
88102 >
89103 < Button
90104 as = { asHelper ( href ) }
91105 aria-current = { isActive ? 'page' : undefined }
106+ isDisabled = { isDisabled }
92107 { ...rest }
93108 >
94109 { children }
@@ -98,20 +113,30 @@ export const LinkButton: React.FC<LinkButtonProps> = (props) => {
98113} ;
99114
100115export const LinkIconButton : React . FC < LinkButtonIconProps > = ( props ) => {
101- const { nextAs, href, children, linkProps, isExternal, ...rest } = props ;
116+ const {
117+ nextAs,
118+ href,
119+ children,
120+ isDisabled,
121+ linkProps,
122+ isExternal,
123+ ...rest
124+ } = props ;
102125 const isActive = useIsActive ( href ) ;
103126
104127 return (
105128 < LinkingComponent
106129 isExternal = { isExternal }
107130 href = { href }
108131 as = { nextAs }
132+ isDisabled = { isDisabled }
109133 { ...linkProps }
110134 >
111135 < IconButton
112136 as = { asHelper ( href ) }
113137 // ADD DISABLED
114138 aria-current = { isActive ? 'page' : undefined }
139+ isDisabled = { isDisabled }
115140 { ...rest }
116141 >
117142 { children }
0 commit comments