Skip to content

Commit

Permalink
Merge pull request #154 from artsy/fix-orientation
Browse files Browse the repository at this point in the history
Correct orientation interaction docs and add usage examples to ssr demo
  • Loading branch information
zephraph committed Sep 2, 2020
2 parents aaff8f4 + 14c497c commit b828429
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -348,8 +348,8 @@ const ExampleAppMedia = createMedia({
interactions: {
hover: "(hover: hover)",
notHover: "(hover: none)",
landscape: "(orientation: landscape)",
portrait: "(orientation: portrait)",
landscape: "not all and (orientation: landscape)",
portrait: "not all and (orientation: portrait)",
},
})

Expand Down
10 changes: 10 additions & 0 deletions examples/ssr-rendering/src/App.tsx
Expand Up @@ -4,6 +4,16 @@ import { Media, MediaContextProvider } from "./Media"
export const App = () => {
return (
<MediaContextProvider>
<Media interaction="hover">
media has hover interaction capabilities
</Media>
<Media interaction="notHover">
media lacks hover interaction capabilities
</Media>

<Media interaction="landscape">landscape</Media>
<Media interaction="portrait">portrait</Media>

<Media at="sm">Hello mobile!</Media>
<Media greaterThan="sm">Hello desktop!</Media>
</MediaContextProvider>
Expand Down
6 changes: 6 additions & 0 deletions examples/ssr-rendering/src/Media.tsx
@@ -1,6 +1,12 @@
import { createMedia } from "@artsy/fresnel"

const ExampleAppMedia = createMedia({
interactions: {
landscape: "not all and (orientation: landscape)",
portrait: "not all and (orientation: portrait)",
hover: "(hover: hover)",
notHover: "(hover: none)",
},
breakpoints: {
sm: 0,
md: 768,
Expand Down

0 comments on commit b828429

Please sign in to comment.