Skip to content

Commit

Permalink
fix: support ssr for sandwich
Browse files Browse the repository at this point in the history
  • Loading branch information
Penggeor committed Mar 20, 2024
1 parent 3bd513d commit 641056c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"typecheck": "tsc"
},
"dependencies": {
"@boombox/storage": "^1.0.2",
"@boombox/storage": "^1.1.0",
"@docusaurus/core": "^3.0.0",
"@docusaurus/plugin-content-blog": "^3.0.0",
"@docusaurus/preset-classic": "^3.0.0",
Expand Down
9 changes: 5 additions & 4 deletions src/pages/sandwich/index.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
import React, { useState, useEffect } from 'react'
import useDocusaurusContext from '@docusaurus/useDocusaurusContext'
import Layout from '@theme/Layout'
import { localStorage } from '@boombox/storage'
import styles from './index.module.scss'
import useIsBrowser from '@docusaurus/useIsBrowser'

export default function () {
const { siteConfig } = useDocusaurusContext()
const KEY = 'sandwich'
// const isBrowser = useIsBrowser()
// if (!isBrowser) return <div></div>

const KEY = 'sandwich'
type Storage = {
prefix: string
content: string
suffix: string
}

const storage = (localStorage.getItem(KEY) ?? {
const storage = (localStorage?.getItem(KEY) ?? {
prefix: '',
content: '',
suffix: '',
Expand Down

0 comments on commit 641056c

Please sign in to comment.