Skip to content

Commit

Permalink
uses profile title for PDFButton filename
Browse files Browse the repository at this point in the history
  • Loading branch information
davelandry committed Aug 7, 2020
1 parent 845188c commit 01d97aa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/cms/src/components/sections/Hero.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ import {hot} from "react-hot-loader/root";
import PropTypes from "prop-types";
import {Dialog} from "@blueprintjs/core";

import {strip} from "d3plus-text";
const filename = str => strip(str.replace(/<[^>]+>/g, ""))
.replace(/^\-/g, "")
.replace(/\-$/g, "");

import stripHTML from "../../utils/formatters/stripHTML";
import groupMeta from "../../utils/groupMeta";

Expand Down Expand Up @@ -221,7 +226,7 @@ class Hero extends Component {
return (
<header className="cp-section cp-hero">
<div className="cp-section-inner cp-hero-inner">
<PDFButton className="cp-hero-pdf" />
<PDFButton className="cp-hero-pdf" filename={filename(profile.title)} />
{/* caption */}
<div className="cp-section-content cp-hero-caption">
{heading}
Expand Down

0 comments on commit 01d97aa

Please sign in to comment.