Skip to content

Instantly share code, notes, and snippets.

@kenakingkong
Created November 25, 2020 23:07
Show Gist options
  • Save kenakingkong/7247961935433431325b38d81f79472d to your computer and use it in GitHub Desktop.
Save kenakingkong/7247961935433431325b38d81f79472d to your computer and use it in GitHub Desktop.
excerpt from src/components/layout.js
// excerpt from src/components/layout.js
import { Media } from "../media"
...
<main>
{/* Tablet/Desktop */}
<Media greaterThan="sm">
<div className="my-container">
<BoxImage />
<FluidGrid>{children}</FluidGrid>
<Name name={data.site.siteMetadata.name}/>
</div>
</Media>
{/* Mobile */}
<Media lessThan="md">
{isHome && <BoxImage />}
{!isHome && <FluidGrid>{children}</FluidGrid>}
{isHome && <Name name={data.site.siteMetadata.name} />}
</Media>
</main>
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment