Skip to content

Commit

Permalink
simplify orchestra
Browse files Browse the repository at this point in the history
  • Loading branch information
clementroche committed Nov 23, 2023
1 parent 152bc98 commit 3e25913
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 22 deletions.
16 changes: 6 additions & 10 deletions libs/orchestra/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { broadcast } from 'libs/zustand-broadcast'
import { useEffect, useState } from 'react'
import { create } from 'zustand'
import { createJSONStorage, persist } from 'zustand/middleware'
import s from './orchestra.module.scss'

// avoid to display debug tools on orchestra page
let isOrchestraPage = false
Expand All @@ -28,7 +27,10 @@ export function useOrchestra() {
return isVisible && values
}

export function OrchestraToggle({ icon, title, id }) {
// to be added to debug pages
export function OrchestraToggle({ children, title, id }) {
isOrchestraPage = true

return (
<button
onClick={() => {
Expand All @@ -39,15 +41,9 @@ export function OrchestraToggle({ icon, title, id }) {
})
}}
title={title}
style={{ fontSize: '64px' }}
>
{icon}
{children}
</button>
)
}

// to be added to debug pages
export function OrchestraPage({ children }) {
isOrchestraPage = true

return <div className={s.orchestra}>{children}</div>
}
5 changes: 0 additions & 5 deletions libs/orchestra/orchestra.module.scss

This file was deleted.

22 changes: 15 additions & 7 deletions pages/_debug/orchestra/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
import { OrchestraPage, OrchestraToggle } from 'libs/orchestra'
import { OrchestraToggle } from 'libs/orchestra'
import { forwardRef } from 'react'

const Orchestra = forwardRef(function Orchestra({}) {
return (
<OrchestraPage>
<OrchestraToggle icon="⚙️" title="studio" id="studio" />
<OrchestraToggle icon="📈" title="performance" id="stats" />
<OrchestraToggle icon="🌐" title="grid" id="grid" />
<OrchestraToggle icon="🚧" title="dev" id="dev" />
</OrchestraPage>
<>
<OrchestraToggle title="studio" id="studio">
⚙️
</OrchestraToggle>
<OrchestraToggle title="performance" id="stats">
📈
</OrchestraToggle>
<OrchestraToggle title="grid" id="grid">
🌐
</OrchestraToggle>
<OrchestraToggle title="dev" id="dev">
🚧
</OrchestraToggle>
</>
)
})

Expand Down

1 comment on commit 3e25913

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"⚡️ Lighthouse report for the changes in this commit:

🟢 Performance: 100
🟢 Accessibility: 97
🟢 Best practices: 92
🟠 SEO: 75
🔴 PWA: 40

Lighthouse ran on https://satus-nk8254omz-studio-freight.vercel.app/"

Please sign in to comment.