Skip to content

Commit

Permalink
import value to redux
Browse files Browse the repository at this point in the history
  • Loading branch information
thomassth committed Oct 24, 2024
1 parent c5ff88c commit 69b9352
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 26 deletions.
7 changes: 6 additions & 1 deletion .storybook/decorators.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ import haiDelibTheme from '../codebases/UT-HAI/client-deliberation/src/theme'
import { Provider as ReduxProvider } from 'react-redux'
import configureStore from '../codebases/compdem/client-admin/src/store'
import { MemoryRouter } from 'react-router'
import { getAcceptedComments, getRejectedComments, getUnmoderatedComments } from './utils'

const store = configureStore()
const store = configureStore({
mod_comments_unmoderated: getUnmoderatedComments(),
mod_comments_accepted: getAcceptedComments(),
mod_comments_rejected: getRejectedComments()
})

export const withThemeUi = (Story) => (
<ThemeProvider theme={compdemAdminTheme}>
Expand Down
2 changes: 1 addition & 1 deletion codebases/compdem
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"react-dom": "^16.14.0",
"react-redux": "7.2.2",
"react-router-dom": "^5.2.0",
"redux": "^4.2.1",
"redux-thunk": "~2.3.0",
"storybook": "^8.3.2",
"storybook-branch-switcher": "^0.5.0"
Expand Down
16 changes: 8 additions & 8 deletions stories/compdem/client-admin/ModerateCommentsAccepted.stories.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import React from 'react'
import { withRedux, withThemeUi } from '../../../.storybook/decorators'
import ModerateCommentsAccepted from '../../../codebases/compdem/client-admin/src/components/conversation-admin/comment-moderation/moderate-comments-accepted'
import { getAcceptedComments } from '../../../.storybook/utils'
import React from "react";
import { withRedux, withThemeUi } from "../../../.storybook/decorators";
import ModerateCommentsAccepted from "../../../codebases/compdem/client-admin/src/components/conversation-admin/comment-moderation/moderate-comments-accepted";
import { getAcceptedComments } from "../../../.storybook/utils";

export default {
component: ModerateCommentsAccepted,
decorators: [withThemeUi, withRedux],
}
};

const Template = (args) => <ModerateCommentsAccepted {...args} />
const Template = (args) => <ModerateCommentsAccepted {...args} />;

export const Default = Template.bind({})
export const Default = Template.bind({});
Default.args = {
accepted_comments: getAcceptedComments(),
}
};
16 changes: 8 additions & 8 deletions stories/compdem/client-admin/ModerateCommentsRejected.stories.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import React from 'react'
import { withRedux, withThemeUi } from '../../../.storybook/decorators'
import { getRejectedComments } from '../../../.storybook/utils'
import ModerateCommentsRejected from '../../../codebases/compdem/client-admin/src/components/conversation-admin/comment-moderation/moderate-comments-rejected'
import React from "react";
import { withRedux, withThemeUi } from "../../../.storybook/decorators";
import ModerateCommentsRejected from "../../../codebases/compdem/client-admin/src/components/conversation-admin/comment-moderation/moderate-comments-rejected";
import { getRejectedComments } from "../../../.storybook/utils";

export default {
component: ModerateCommentsRejected,
decorators: [withThemeUi, withRedux],
}
};

const Template = (args) => <ModerateCommentsRejected {...args} />
const Template = (args) => <ModerateCommentsRejected {...args} />;

export const Default = Template.bind({})
export const Default = Template.bind({});
Default.args = {
rejected_comments: getRejectedComments(),
}
};
16 changes: 8 additions & 8 deletions stories/compdem/client-admin/ModerateCommentsTodo.stories.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import React from 'react'
import { withRedux, withThemeUi } from '../../../.storybook/decorators'
import { getUnmoderatedComments } from '../../../.storybook/utils'
import ModerateCommentsTodo from '../../../codebases/compdem/client-admin/src/components/conversation-admin/comment-moderation/moderate-comments-todo'
import React from "react";
import { withRedux, withThemeUi } from "../../../.storybook/decorators";
import { getUnmoderatedComments } from "../../../.storybook/utils";
import ModerateCommentsTodo from "../../../codebases/compdem/client-admin/src/components/conversation-admin/comment-moderation/moderate-comments-todo";

export default {
component: ModerateCommentsTodo,
decorators: [withThemeUi, withRedux],
}
};

const Template = (args) => <ModerateCommentsTodo {...args} />
const Template = (args) => <ModerateCommentsTodo {...args} />;

export const Default = Template.bind({})
export const Default = Template.bind({});
Default.args = {
unmoderated_comments: getUnmoderatedComments(),
}
};

0 comments on commit 69b9352

Please sign in to comment.