Skip to content

Commit

Permalink
chore: Hide disclaimer for map on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
kevee committed Jan 4, 2021
1 parent c58881a commit 54fcadc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import React, { useState } from 'react'
import classnames from 'classnames'
import disclaimerStyle from './disclaimer.module.scss'

const Disclaimer = ({ text }) => {
const Disclaimer = ({ text, hideMobile }) => {
const [isOpen, setIsOpen] = useState(false)

return (
<div>
<div className={hideMobile && disclaimerStyle.hideMobile}>
<button
aria-expanded={isOpen}
type="button"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,10 @@
display: block;
}
}

.hide-mobile {
display: none;
@media (min-width: $viewport-md) {
display: block;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ const Map = ({
</svg>
<MapLegend legend={metric.legend} />
{disclaimer && (
<Disclaimer text={disclaimer.childMarkdownRemark.html} />
<Disclaimer text={disclaimer.childMarkdownRemark.html} hideMobile />
)}
</Col>
<Col width={[4, 6, 3]}>
Expand Down

0 comments on commit 54fcadc

Please sign in to comment.