Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions core/__tests__/__snapshots__/Library.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ exports[`Library renders 1`] = `
class="nanolgtq4w"
>
<a
class="nano19oao6z"
href="/"
aria-current="page"
class="nano19oao6z active"
href="#/"
>
Kit
</a>
Expand All @@ -33,7 +34,16 @@ exports[`Library renders 1`] = `
</style>
<div
class="nano1pfbsnd"
/>
>
<div
class="nano1moj4mh"
height="192"
width="256"
/>
<style>
.nano1moj4mh{display:grid}.nano1moj4mh{grid-template-columns:repeat(auto-fit, minmax(256px, 1fr))}.nano1moj4mh{grid-auto-rows:192px}
</style>
</div>
<style>
.nano1pfbsnd{flex:1 1 auto;height:100vh;overflow-y:auto;-webkit-overflow-scrolling:touch}
</style>
Expand Down
32 changes: 16 additions & 16 deletions core/__tests__/__snapshots__/Matrix.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ exports[`Matrix renders all examples 1`] = `
w="512"
>
<svg
class="sc-eqIVtm gaFCZx"
class="sc-cHGsZl dgyxZK"
height="128"
stroke-width="2"
value="0.2"
Expand Down Expand Up @@ -47,7 +47,7 @@ exports[`Matrix renders all examples 1`] = `
w="512"
>
<svg
class="sc-eqIVtm cZnNKo"
class="sc-cHGsZl kHqkDi"
height="128"
stroke-width="2"
value="0.2"
Expand Down Expand Up @@ -84,7 +84,7 @@ exports[`Matrix renders all examples 1`] = `
w="512"
>
<svg
class="sc-eqIVtm dzHqn"
class="sc-cHGsZl iyNBzh"
height="128"
stroke-width="2"
value="0.2"
Expand Down Expand Up @@ -121,7 +121,7 @@ exports[`Matrix renders all examples 1`] = `
w="512"
>
<svg
class="sc-eqIVtm kiJDuI"
class="sc-cHGsZl dEoevi"
height="128"
stroke-width="2"
value="0.2"
Expand Down Expand Up @@ -165,7 +165,7 @@ exports[`Matrix renders all examples 1`] = `
w="512"
>
<svg
class="sc-eqIVtm gaFCZx"
class="sc-cHGsZl dgyxZK"
height="128"
stroke-width="2"
value="0.25"
Expand Down Expand Up @@ -202,7 +202,7 @@ exports[`Matrix renders all examples 1`] = `
w="512"
>
<svg
class="sc-eqIVtm cZnNKo"
class="sc-cHGsZl kHqkDi"
height="128"
stroke-width="2"
value="0.25"
Expand Down Expand Up @@ -239,7 +239,7 @@ exports[`Matrix renders all examples 1`] = `
w="512"
>
<svg
class="sc-eqIVtm dzHqn"
class="sc-cHGsZl iyNBzh"
height="128"
stroke-width="2"
value="0.25"
Expand Down Expand Up @@ -276,7 +276,7 @@ exports[`Matrix renders all examples 1`] = `
w="512"
>
<svg
class="sc-eqIVtm kiJDuI"
class="sc-cHGsZl dEoevi"
height="128"
stroke-width="2"
value="0.25"
Expand Down Expand Up @@ -320,7 +320,7 @@ exports[`Matrix renders all examples 1`] = `
w="512"
>
<svg
class="sc-eqIVtm gaFCZx"
class="sc-cHGsZl dgyxZK"
height="128"
stroke-width="2"
value="0.3333333333333333"
Expand Down Expand Up @@ -357,7 +357,7 @@ exports[`Matrix renders all examples 1`] = `
w="512"
>
<svg
class="sc-eqIVtm cZnNKo"
class="sc-cHGsZl kHqkDi"
height="128"
stroke-width="2"
value="0.3333333333333333"
Expand Down Expand Up @@ -394,7 +394,7 @@ exports[`Matrix renders all examples 1`] = `
w="512"
>
<svg
class="sc-eqIVtm dzHqn"
class="sc-cHGsZl iyNBzh"
height="128"
stroke-width="2"
value="0.3333333333333333"
Expand Down Expand Up @@ -431,7 +431,7 @@ exports[`Matrix renders all examples 1`] = `
w="512"
>
<svg
class="sc-eqIVtm kiJDuI"
class="sc-cHGsZl dEoevi"
height="128"
stroke-width="2"
value="0.3333333333333333"
Expand Down Expand Up @@ -475,7 +475,7 @@ exports[`Matrix renders all examples 1`] = `
w="512"
>
<svg
class="sc-eqIVtm gaFCZx"
class="sc-cHGsZl dgyxZK"
height="128"
stroke-width="2"
value="0.75"
Expand Down Expand Up @@ -512,7 +512,7 @@ exports[`Matrix renders all examples 1`] = `
w="512"
>
<svg
class="sc-eqIVtm cZnNKo"
class="sc-cHGsZl kHqkDi"
height="128"
stroke-width="2"
value="0.75"
Expand Down Expand Up @@ -549,7 +549,7 @@ exports[`Matrix renders all examples 1`] = `
w="512"
>
<svg
class="sc-eqIVtm dzHqn"
class="sc-cHGsZl iyNBzh"
height="128"
stroke-width="2"
value="0.75"
Expand Down Expand Up @@ -586,7 +586,7 @@ exports[`Matrix renders all examples 1`] = `
w="512"
>
<svg
class="sc-eqIVtm kiJDuI"
class="sc-cHGsZl dEoevi"
height="128"
stroke-width="2"
value="0.75"
Expand Down
4 changes: 1 addition & 3 deletions core/examples/Library.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ import {

const Demo = props => (
<Provider>
<Library
useFrame={false}
basename="/Library">
<Library useFrame={false}>

{/* renders in iframe when useFrame is true */}
<Head>
Expand Down
9 changes: 3 additions & 6 deletions core/src/Library.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import React from 'react'
import PropTypes from 'prop-types'
import nano from 'nano-style'
import {
BrowserRouter,
StaticRouter,
HashRouter,
Route,
NavLink,
Link,
Expand Down Expand Up @@ -64,16 +63,14 @@ const NavItem = nano(NavLink)({
}
})

const Router = typeof document !== 'undefined' ? BrowserRouter : StaticRouter

export class Library extends React.Component {
render() {
const { basename, ...props } = this.props

return (
<Router basename={basename} context={{}}>
<HashRouter basename={basename}>
<LibraryApp {...props} />
</Router>
</HashRouter>
)
}
}
Expand Down