Skip to content

Commit

Permalink
fix: client error render
Browse files Browse the repository at this point in the history
  • Loading branch information
nonzzz committed Dec 17, 2024
1 parent 437e3d2 commit 1d771a0
Show file tree
Hide file tree
Showing 6 changed files with 348 additions and 334 deletions.
4 changes: 3 additions & 1 deletion src/client/components/checkbox/checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ function CheckboxComponent(props: CheckboxProps) {
}
}
} else {
setSelfChecked(checked)
if (checked !== selfChecked) {
setSelfChecked(checked)
}
}

const handleChange = useCallback((e: React.ChangeEvent) => {
Expand Down
2 changes: 1 addition & 1 deletion src/client/components/search-modules.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export function SearchModules<F extends Module>(props: SearchModulesProps<F>) {
<ModuleItem name={module.parent.label} stylex={{ fontStyle: 'bold' }} />
{module.children.map((child) => (
<ModuleItem
key={child.label}
key={child.filename}
name={child.label}
size={child[extra]}
pointer={availableMap[child.label]}
Expand Down
58 changes: 26 additions & 32 deletions src/client/components/side-bar/side-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ export function Sidebar({ onVisibleChange = noop }: SidebarProps) {
<div key={button} stylex={{ padding: '5px', boxSizing: 'border-box' }}>
<Button
onClick={() => handleToggleMode(button)}
// onClick={() => toggleSize(button === 'Gzipped' ? 'gzipSize' : button === 'Stat' ? 'statSize' : 'parsedSize')}
auto
type={mode === button ? 'secondary' : 'default'}
scale={0.7}
Expand All @@ -137,41 +136,36 @@ export function Sidebar({ onVisibleChange = noop }: SidebarProps) {
))}
</div>
</div>
{IS_CUSTOM_SIDE_BAR
? (
<div>
{IS_CUSTOM_SIDE_BAR && (
<div id="customSideBar">
{createElement(ui.SideBar ? ui.SideBar : 'div', null)}
</div>
)
: (
<>
<div>
<Text p b h3>Filter by entrypoints:</Text>
<Select
ref={selectRef}
multiple
scale={0.75}
placeholder="Select endpoints"
width="95.5%"
onChange={handleFilterByEntrypoints}
options={entrypointChunks.map((chunk) => ({ value: chunk.label, label: chunk.label }))}
/>
</div>
<div>
<Text p b h3>Search modules:</Text>
<SearchModules extra={userMode} files={allChunks} />
</div>
<div>
<Text p b h3>Show Chunks:</Text>
<FileList
files={allChunks}
extra={userMode}
scence={scence}
onChange={(v) => updateScence(new Set(v))}
/>
</div>
</>
)}
<Text p b h3>Filter by entrypoints:</Text>
<Select
ref={selectRef}
multiple
scale={0.75}
placeholder="Select endpoints"
width="95.5%"
onChange={handleFilterByEntrypoints}
options={entrypointChunks.map((chunk) => ({ value: chunk.label, label: chunk.label }))}
/>
</div>
<div>
<Text p b h3>Search modules:</Text>
<SearchModules extra={userMode} files={allChunks} />
</div>
<div>
<Text p b h3>Show Chunks:</Text>
<FileList
files={allChunks}
extra={userMode}
scence={scence}
onChange={(v) => updateScence(new Set(v))}
/>
</div>
</Drawer.Content>
</Drawer>
</>
Expand Down
Loading

0 comments on commit 1d771a0

Please sign in to comment.