-
-
Notifications
You must be signed in to change notification settings - Fork 701
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Nilesh <[email protected]>
- Loading branch information
1 parent
27bd755
commit f2df63e
Showing
3 changed files
with
152 additions
and
130 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Refactor ContentsTagsModal -@Tishasoumya-02 |
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
68 changes: 68 additions & 0 deletions
68
src/components/manage/Contents/ContentsTagsModal.stories.jsx
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 |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import { injectIntl } from 'react-intl'; | ||
import React from 'react'; | ||
import ContentsTagsModalComponent from './ContentsTagsModal'; | ||
import { RealStoreWrapper as Wrapper } from '@plone/volto/storybook'; | ||
import { bool } from 'prop-types'; | ||
|
||
const IntlContentTagsModalComponent = injectIntl(ContentsTagsModalComponent); | ||
|
||
function StoryComponent(args) { | ||
return ( | ||
<Wrapper | ||
customStore={{ | ||
content: { | ||
update: { | ||
loading: false, | ||
loaded: true, | ||
}, | ||
}, | ||
intl: { | ||
locale: 'en', | ||
messages: {}, | ||
}, | ||
}} | ||
> | ||
<div id="toolbar" style={{ display: 'none' }} /> | ||
<IntlContentTagsModalComponent | ||
{...args} | ||
onOk={() => {}} | ||
onCancel={() => {}} | ||
items={[ | ||
{ | ||
...args, | ||
url: '/blog', | ||
}, | ||
]} | ||
/> | ||
</Wrapper> | ||
); | ||
} | ||
|
||
export const ContentTagsModal = StoryComponent.bind({}); | ||
|
||
ContentTagsModal.args = { | ||
subjects: ['plone 6 ', 'plone 5', 'plone'], | ||
open: true, | ||
}; | ||
|
||
export default { | ||
title: 'Public components/Contents/Content Tags Modal', | ||
component: ContentTagsModal, | ||
decorators: [ | ||
(Story) => ( | ||
<div className="ui segment form attached" style={{ width: '400px' }}> | ||
<Story /> | ||
</div> | ||
), | ||
], | ||
argTypes: { | ||
subjects: { | ||
context: 'json', | ||
description: 'Added tags', | ||
}, | ||
open: { | ||
context: bool, | ||
description: 'open/close modal', | ||
}, | ||
}, | ||
}; |