Skip to content

Commit

Permalink
feat(accordion): Add possibility to provide semantic options and defa…
Browse files Browse the repository at this point in the history
…ult theme - refs #153783
  • Loading branch information
avoinea committed Sep 29, 2022
1 parent dcb963b commit 9c7e210
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
7 changes: 6 additions & 1 deletion src/components/manage/Blocks/Accordion/AccordionEdit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@ export default (props) => {
}, [data.collapsed]);

return (
<Accordion fluid styled className={data.styles?.theme}>
<Accordion
className={
data.styles ? data.styles.theme : accordionConfig?.defaults?.theme
}
{...accordionConfig.options}
>
<React.Fragment>
<Accordion.Title
as={data.title_size}
Expand Down
7 changes: 4 additions & 3 deletions src/components/manage/Blocks/Accordion/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,12 @@ const View = (props) => {
{panels.map(([id, panel], index) => {
return accordionBlockHasValue(panel) ? (
<Accordion
fluid
styled
key={id}
exclusive={!data.exclusive}
className={data.styles?.theme}
className={
data.styles ? data.styles.theme : accordionConfig?.defaults?.theme
}
{...accordionConfig.options}
>
<React.Fragment>
<Accordion.Title
Expand Down
6 changes: 6 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ const applyConfig = (config) => {
schema: extendedSchema(config),
stylesSchema: AccordionStylingSchema,
enableStyling: true,
// See https://react.semantic-ui.com/modules/accordion/
options: {
styled: 'styled',
fluid: 'fluid',
},
defaults: {},
security: {
addPermission: [],
view: [],
Expand Down

0 comments on commit 9c7e210

Please sign in to comment.