Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@sryan-mp
Last active June 10, 2021 22:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sryan-mp/15bd9aa8cf84d7a3c6edd208ada3ef0c to your computer and use it in GitHub Desktop.
Save sryan-mp/15bd9aa8cf84d7a3c6edd208ada3ef0c to your computer and use it in GitHub Desktop.
SidebarButton.js
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