aboutsummaryrefslogtreecommitdiffstats
path: root/packages/forms/src/button/index.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/forms/src/button/index.tsx')
-rw-r--r--packages/forms/src/button/index.tsx70
1 files changed, 32 insertions, 38 deletions
diff --git a/packages/forms/src/button/index.tsx b/packages/forms/src/button/index.tsx
index 48fb61635..c9ae47d55 100644
--- a/packages/forms/src/button/index.tsx
+++ b/packages/forms/src/button/index.tsx
@@ -227,44 +227,38 @@ class ButtonComponent extends Component<IProps> {
227 </> 227 </>
228 ); 228 );
229 229
230 let wrapperComponent: JSX.Element; 230 const wrapperComponent = !href ? (
231 231 <button
232 if (!href) { 232 id={id}
233 wrapperComponent = ( 233 type={type}
234 <button 234 onClick={onClick}
235 id={id} 235 className={classnames({
236 type={type} 236 [`${classes.button}`]: true,
237 onClick={onClick} 237 [`${classes[buttonType as ButtonType]}`]: true,
238 className={classnames({ 238 [`${classes.disabled}`]: disabled,
239 [`${classes.button}`]: true, 239 [`${className}`]: className,
240 [`${classes[buttonType as ButtonType]}`]: true, 240 })}
241 [`${classes.disabled}`]: disabled, 241 disabled={disabled}
242 [`${className}`]: className, 242 data-type="franz-button"
243 })} 243 >
244 disabled={disabled} 244 {content}
245 data-type="franz-button" 245 </button>
246 > 246 ) : (
247 {content} 247 <a
248 </button> 248 href={href}
249 ); 249 target={target}
250 } else { 250 onClick={onClick}
251 wrapperComponent = ( 251 className={classnames({
252 <a 252 [`${classes.button}`]: true,
253 href={href} 253 [`${classes[buttonType as ButtonType]}`]: true,
254 target={target} 254 [`${className}`]: className,
255 onClick={onClick} 255 })}
256 className={classnames({ 256 rel={target === '_blank' ? 'noopener' : ''}
257 [`${classes.button}`]: true, 257 data-type="franz-button"
258 [`${classes[buttonType as ButtonType]}`]: true, 258 >
259 [`${className}`]: className, 259 {content}
260 })} 260 </a>
261 rel={target === '_blank' ? 'noopener' : ''} 261 );
262 data-type="franz-button"
263 >
264 {content}
265 </a>
266 );
267 }
268 262
269 return wrapperComponent; 263 return wrapperComponent;
270 } 264 }