-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove disableStyles prop from all components, import css files …
…last (#1102) Breaking Change: removed disableStyles prop from all components
- Loading branch information
Showing
57 changed files
with
157 additions
and
606 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,27 @@ | ||
import PropTypes from 'prop-types'; | ||
import React, { useEffect } from 'react'; | ||
import React from 'react'; | ||
import 'fundamental-styles/dist/segmented-button.css'; | ||
|
||
/** Group a series of buttons together on a single line with the segmented button. | ||
* Only one of the options can be active at a time, the others remain or become inactive. | ||
* The option can be activated by clicking on it. | ||
* This type of button is comparable to a radio button group. */ | ||
const ButtonSegmented = React.forwardRef(({ children, disableStyles, ...props }, ref) => { | ||
|
||
useEffect(() => { | ||
if (!disableStyles) { | ||
require('fundamental-styles/dist/segmented-button.css'); | ||
} | ||
}, []); | ||
|
||
return ( | ||
<div | ||
{...props} | ||
aria-label='Group label' | ||
className='fd-segmented-button' | ||
ref={ref} | ||
role='group'> | ||
{children} | ||
</div> | ||
); | ||
}); | ||
const ButtonSegmented = React.forwardRef(({ children, ...props }, ref) => ( | ||
<div | ||
{...props} | ||
aria-label='Group label' | ||
className='fd-segmented-button' | ||
ref={ref} | ||
role='group'> | ||
{children} | ||
</div>) | ||
); | ||
|
||
ButtonSegmented.displayName = 'ButtonSegmented'; | ||
|
||
ButtonSegmented.propTypes = { | ||
/** Node(s) to render within the component */ | ||
children: PropTypes.node, | ||
/** Internal use only */ | ||
disableStyles: PropTypes.bool | ||
children: PropTypes.node | ||
}; | ||
|
||
export default ButtonSegmented; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.