Skip to content

Commit

Permalink
fix(ui): logo link and dark theme flikering
Browse files Browse the repository at this point in the history
  • Loading branch information
itsjavi committed Sep 3, 2023
1 parent 0a92a8a commit 3d40a7c
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 1 deletion.
7 changes: 7 additions & 0 deletions packages/docs/canvas.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
<link rel="icon" type="image/svg+xml" href="/logo.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>StoryLite - Design System (React) - IFRAME</title>
<script>
// Render blocking JS to fix theme flickering:
const slParams = window.localStorage.getItem('storylite.parameters')
if (slParams) {
document.documentElement.dataset.theme = JSON.parse(slParams)?.theme?.value ?? 'auto'
}
</script>
</head>
<body>
<div id="root"></div>
Expand Down
7 changes: 7 additions & 0 deletions packages/docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
<link rel="icon" type="image/svg+xml" href="/logo.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>StoryLite - Design System (React)</title>
<script>
// Render blocking JS to fix theme flickering:
const slParams = window.localStorage.getItem('storylite.parameters')
if (slParams) {
document.documentElement.dataset.theme = JSON.parse(slParams)?.theme?.value ?? 'auto'
}
</script>
</head>
<body>
<div id="root"></div>
Expand Down
7 changes: 7 additions & 0 deletions packages/examples/react/canvas.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
<link rel="icon" type="image/svg+xml" href="/logo.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>StoryLite - Design System (React) - IFRAME</title>
<script>
// Render blocking JS to fix theme flickering:
const slParams = window.localStorage.getItem('storylite.parameters')
if (slParams) {
document.documentElement.dataset.theme = JSON.parse(slParams)?.theme?.value ?? 'auto'
}
</script>
</head>
<body>
<div id="root"></div>
Expand Down
7 changes: 7 additions & 0 deletions packages/examples/react/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
<link rel="icon" type="image/svg+xml" href="/logo.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>StoryLite - Design System (React)</title>
<script>
// Render blocking JS to fix theme flickering:
const slParams = window.localStorage.getItem('storylite.parameters')
if (slParams) {
document.documentElement.dataset.theme = JSON.parse(slParams)?.theme?.value ?? 'auto'
}
</script>
</head>
<body>
<div id="root"></div>
Expand Down
3 changes: 2 additions & 1 deletion packages/storylite/src/components/sidebar/SidebarTitle.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { useStoryLiteStore } from '@/app/stores/global'
import { STORYLITE_BASE_PATH } from '@/services/router'
import { Link } from '@/services/router/router.component'

export function SidebarTitle() {
const config = useStoryLiteStore(state => state.config)

return (
<div className={'storylite-sidebar-title'}>
<Link to={'/'}>{config.title}</Link>
<Link to={STORYLITE_BASE_PATH}>{config.title}</Link>
</div>
)
}

0 comments on commit 3d40a7c

Please sign in to comment.