Last active
June 10, 2021 22:57
-
-
Save sryan-mp/15bd9aa8cf84d7a3c6edd208ada3ef0c to your computer and use it in GitHub Desktop.
SidebarButton.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
import React, { Component } from 'react'; | |
import { RichText, Link } from 'prismic-reactjs'; | |
import Button from 'components/button'; | |
import SlicePropType from 'utils/slice-prop-type'; | |
import slugify from 'utils/slugify'; | |
import linkResolver from 'utils/prismic-link-resolver'; | |
import mpContentDownloaded from 'utils/analytics'; | |
import * as s from './SidebarButton.module.scss'; | |
export default class SidebarButton extends Component { | |
static propTypes = SlicePropType; | |
render() { | |
const { primary } = this.props; | |
return ( | |
<div className={s.getGuide}> | |
<form action="/" method="post" onSubmit={this.handleFormSubmit}> | |
<div> | |
<div className={s.getGuide__wrapper}> | |
<h3 id={slugify(primary.title1)} className={s.getGuide__title}> | |
{primary.title1} | |
</h3> | |
<p className={s.getGuide__intro}>{RichText.render(primary.text.raw, linkResolver)}</p> | |
<Button className={s.buttonFullWidth} to={Link.url(primary.link.raw, linkResolver)} color={primary.color} onClick={()=> mpContentDownloaded()}> | |
{primary.button_text} | |
</Button> | |
</div> | |
</div> | |
</form> | |
</div> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment