-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add poll embed component, you can now embed a poll by clicking the 'p…
…oll' button in the embed toolbar
- Loading branch information
Showing
8 changed files
with
49 additions
and
17 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
32 changes: 32 additions & 0 deletions
32
dispatch/static/manager/src/js/vendor/dispatch-editor/embeds/PollEmbed.js
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,32 @@ | ||
import React from 'react' | ||
|
||
import PollSelectInput from '../../../components/inputs/selects/PollSelectInput' | ||
import { FormInput } from '../../../components/inputs' | ||
|
||
function PollEmbedComponent(props) { | ||
return ( | ||
<div className='o-embed o-embed--poll'> | ||
<form> | ||
<FormInput label='Poll'> | ||
<PollSelectInput | ||
fill={true} | ||
selected={props.data.poll} | ||
onChange={selected => { | ||
props.updateField('poll',selected) | ||
props.stopEditing() | ||
} | ||
} /> | ||
</FormInput> | ||
</form> | ||
</div> | ||
) | ||
} | ||
|
||
export default { | ||
type: 'poll', | ||
component: PollEmbedComponent, | ||
defaultData: { | ||
poll:'', | ||
widget_id: 'poll' | ||
} | ||
} |
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