Skip to content

Instantly share code, notes, and snippets.

@tastycode
Last active April 20, 2018 16:55
Show Gist options
  • Save tastycode/ecd28068002531a133c5e0e43b611419 to your computer and use it in GitHub Desktop.
Save tastycode/ecd28068002531a133c5e0e43b611419 to your computer and use it in GitHub Desktop.
The arduous way
// types.js
const REPORTER_PENDING_REPORT_UPDATE = "[reporter] pending report update"
// actions/reporter.js
export function reporterPendingReportUpdate() {
return { type: types.REPORTER_PENDING_REPORT_UPDATE }
}
// components/PromptHarm.js
import reporterActions from 'actions/reporter'
const PromptHarm = ({reporterPendingReportUpdate}) => ( <PromptContainer>
<PromptText>Is anyone at risk of immediate harm to themselves or others?</PromptText>
<PromptButtonsContainer>
<PromptButton onClick={reporterPendingReportUpdate} text="YES"/>
<PromptButton text="CANCEL"/>
</PromptButtonsContainer>
</PromptContainer>
)
connect(bindStateToProps, reporterActions)(PromptHarm)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment