Skip to content

Commit 71e7aa3

Browse files
committed
fix(devtools): fix solidjs importing setStyleProperty
1 parent 028d4b8 commit 71e7aa3

File tree

3 files changed

+21
-14
lines changed

3 files changed

+21
-14
lines changed

packages/pacer-devtools/src/components/Shell.tsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { createMemo, createSignal, onCleanup, onMount } from 'solid-js'
2+
import * as goober from 'goober'
23
import { Header, HeaderLogo, MainPanel } from '@tanstack/devtools-ui'
34
import { useStyles } from '../styles/use-styles'
45
import { usePacerDevtoolsState } from '../PacerContextProvider'
@@ -27,6 +28,11 @@ export function Shell() {
2728
return null
2829
})
2930

31+
const leftPanelWidthClass = () =>
32+
goober.css`
33+
width: ${leftPanelWidth()}px;
34+
`
35+
3036
let dragStartX = 0
3137
let dragStartWidth = 0
3238

@@ -74,14 +80,7 @@ export function Shell() {
7480
</Header>
7581

7682
<div class={styles().mainContainer}>
77-
<div
78-
class={styles().leftPanel}
79-
style={{
80-
width: `${leftPanelWidth()}px`,
81-
'min-width': '150px',
82-
'max-width': '800px',
83-
}}
84-
>
83+
<div class={`${styles().leftPanel} ${leftPanelWidthClass()}`}>
8584
<UtilList
8685
selectedKey={selectedKey}
8786
setSelectedKey={setSelectedKey}
@@ -94,7 +93,7 @@ export function Shell() {
9493
onMouseDown={handleMouseDown}
9594
/>
9695

97-
<div class={styles().rightPanel} style={{ flex: 1 }}>
96+
<div class={styles().rightPanel}>
9897
<div class={styles().panelHeader}>Details</div>
9998
<DetailsPanel
10099
selectedInstance={selectedInstance}

packages/pacer-devtools/src/components/StateHeader.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export function StateHeader(props: StateHeaderProps) {
8585
return (
8686
<div class={styles().stateHeader}>
8787
<div class={styles().stateTitle}>{entry.type}</div>
88-
<div style={{ display: 'flex', 'align-items': 'center', gap: '16px' }}>
88+
<div class={styles().stateHeaderRow}>
8989
<div class={styles().infoGrid}>
9090
<div class={styles().infoLabel}>Key</div>
9191
<div class={styles().infoValueMono}>{key}</div>
@@ -94,10 +94,7 @@ export function StateHeader(props: StateHeaderProps) {
9494
{new Date(updatedAt).toLocaleTimeString()} ({getRelativeTime()})
9595
</div>
9696
</div>
97-
<div
98-
class={styles().infoValueMono}
99-
style={{ 'margin-left': 'auto', 'font-weight': 'bold' }}
100-
>
97+
<div class={`${styles().infoValueMono} ${styles().reductionBadge}`}>
10198
{reductionPercentage}% reduction
10299
</div>
103100
</div>

packages/pacer-devtools/src/styles/use-styles.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ const stylesFactory = (theme: 'light' | 'dark') => {
6767
overflow: hidden;
6868
min-height: 0;
6969
flex-shrink: 0;
70+
min-width: 150px;
71+
max-width: 800px;
7072
`,
7173
rightPanel: css`
7274
background: ${t(colors.gray[100], colors.darkGray[800])};
@@ -267,6 +269,15 @@ const stylesFactory = (theme: 'light' | 'dark') => {
267269
border-radius: 9999px;
268270
background: ${colors.purple[400]};
269271
`,
272+
stateHeaderRow: css`
273+
display: flex;
274+
align-items: center;
275+
gap: 16px;
276+
`,
277+
reductionBadge: css`
278+
margin-left: auto;
279+
font-weight: ${font.weight.bold};
280+
`,
270281
infoGrid: css`
271282
display: grid;
272283
grid-template-columns: auto 1fr;

0 commit comments

Comments
 (0)