Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Improve Guides layout

Damian Legawiec2ca2decc0adf
diff --git a/guides/src/components/Header.js b/guides/src/components/Header.js
index c9c2463f18..074f8212db 100644
--- a/guides/src/components/Header.js
+++ b/guides/src/components/Header.js
@@ -18,7 +18,6 @@ import IconGithub from 'react-feather/dist/icons/github'
import IconBurger from 'react-feather/dist/icons/menu'
import IconClose from 'react-feather/dist/icons/x-circle'
import IconSearch from 'react-feather/dist/icons/search'
-import IconContact from 'react-feather/dist/icons/message-circle'
/**
* Component
diff --git a/guides/src/components/Layout.js b/guides/src/components/Layout.js
index 3a91e59f58..1d534f7573 100644
--- a/guides/src/components/Layout.js
+++ b/guides/src/components/Layout.js
@@ -43,7 +43,18 @@ export default class Layout extends React.Component {
nav={this.props.nav}
/>
- <div className="z-3 relative ph4 items-center mw9 center h-100">
+ <div
+ className={cx(
+ 'z-3 relative items-center center h-100',
+ this.props.nav && 'mw9'
+ )}
+ css={{
+ '@media (min-width: 60rem)': {
+ paddingLeft: '2rem',
+ paddingRight: '2rem'
+ }
+ }}
+ >
{this.props.nav && this.props.activeSection != 'api' && (
<Sidebar
nav={this.props.nav}
diff --git a/guides/src/components/Toc.js b/guides/src/components/Toc.js
index 237b6721a9..568751a1a0 100644
--- a/guides/src/components/Toc.js
+++ b/guides/src/components/Toc.js
@@ -13,7 +13,7 @@ const styleToc = css`
max-height: calc(100% - 120px);
overflow-y: auto;
overflow-x: hidden;
- margin-left: 50rem;
+ margin-left: 51rem;
`
/**
@@ -34,7 +34,8 @@ const Toc = ({ headings }) => (
<nav>
{headings.map(heading => {
- const slug = getSlugHref(heading.value)
+ const title = heading.value.replace(/(<([^>]+)>)/gi, '')
+ const slug = getSlugHref(title)
const margin = `ml${getMarginDepth(heading.depth)}`
if (heading.depth >= 4) return
@@ -42,10 +43,10 @@ const Toc = ({ headings }) => (
return (
<a
key={slug}
- className={`db gray hover-spree-green mb1 pointer link ${margin}`}
+ className={`db gray hover-spree-green mb1 pointer link f6 ${margin}`}
href={slug}
>
- <span dangerouslySetInnerHTML={{ __html: heading.value }} />
+ {title}
</a>
)
})}