Skip to content

Commit

Permalink
Added util function for voteColors.
Browse files Browse the repository at this point in the history
  • Loading branch information
patcon committed Sep 23, 2024
1 parent 08760d9 commit 3e9871c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 7 additions & 0 deletions .storybook/utils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import * as globals from "../polis/client-report/src/components/globals";

export const getVoteColors = () => ({
agree: globals.brandColors.agree,
disagree: globals.brandColors.disagree,
pass: globals.brandColors.pass,
})
7 changes: 2 additions & 5 deletions stories/client-report/framework/legend.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React from 'react'
import '../../../polis/client-report/src/index.css';

import Legend from '../../../polis/client-report/src/components/framework/legend'
import { getVoteColors } from '../../../.storybook/utils'

export default {
title: 'Client-Report/Legend',
Expand All @@ -13,9 +14,5 @@ const Template = (args) => <Legend {...args} />

export const Default = Template.bind({})
Default.args = {
voteColors: {
"agree": "rgb(46, 204, 113)",
"disagree": "rgb(231, 76, 60)",
"pass": "rgb(230,230,230)"
},
voteColors: getVoteColors(),
}

0 comments on commit 3e9871c

Please sign in to comment.