Skip to content

Commit

Permalink
Merge pull request #1807 from sushi-labs/cmdk-fix
Browse files Browse the repository at this point in the history
fix(apps/web): "no network found" on initial render
  • Loading branch information
matthewlilley authored Jan 28, 2025
2 parents 80f2550 + a9fef5c commit 1b01e48
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion apps/storybook/stories/popover.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ export const PopoverWithMenu = {
<PopoverContent className="!p-0 !overflow-x-hidden !overflow-y-scroll scroll">
<Command>
<CommandInput placeholder="Search network" />
<CommandEmpty>No network found.</CommandEmpty>
<CommandGroup>
<CommandItem value="Item 0">Command Item 0</CommandItem>
<CommandItem value="Item 1">Command Item 1</CommandItem>
<CommandItem value="Item 2">Command Item 2</CommandItem>
<CommandItem value="Item 3">Command Item 3</CommandItem>
</CommandGroup>
<CommandEmpty>No network found.</CommandEmpty>
</Command>
</PopoverContent>
</Popover>
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/lib/wagmi/components/network-selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ const NetworkSelector = <T extends number | string>({
testdata-id="network-selector-input"
placeholder="Search network"
/>
<CommandEmpty>No network found.</CommandEmpty>
<CommandGroup>
{networks.map((network) => {
const name = getNetworkName(
Expand Down Expand Up @@ -110,6 +109,7 @@ const NetworkSelector = <T extends number | string>({
)
})}
</CommandGroup>
<CommandEmpty>No network found.</CommandEmpty>
</Command>
</PopoverContent>
</Popover>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export const DesktopNetworkSelector: FC<DesktopNetworkSelector> = ({
placeholder="Search network"
/>
</div>
<CommandEmpty className="p-2 mx-auto">No network found.</CommandEmpty>
<CommandGroup className="overflow-y-auto px-3 pb-3">
{networks.map((network) => {
const name = getNetworkName(network)
Expand Down Expand Up @@ -79,6 +78,7 @@ export const DesktopNetworkSelector: FC<DesktopNetworkSelector> = ({
)
})}
</CommandGroup>
<CommandEmpty className="p-2 mx-auto">No network found.</CommandEmpty>
</Command>
)
}
2 changes: 1 addition & 1 deletion apps/web/src/ui/pool/TableFiltersNetwork.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ export const TableFiltersNetwork: FC<{
testdata-id="network-selector-input"
placeholder="Search network"
/>
<CommandEmpty>No network found.</CommandEmpty>
<CommandGroup>
{SUPPORTED_NETWORKS.map((_network) => {
const name = getNetworkName(_network)
Expand Down Expand Up @@ -130,6 +129,7 @@ export const TableFiltersNetwork: FC<{
)
})}
</CommandGroup>
<CommandEmpty>No network found.</CommandEmpty>
</Command>
</PopoverContent>
</Popover>
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/ui/sidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ const Sidebar: FC<Omit<SidebarContainerProps, 'children' | 'shiftContent'>> = ({
testdata-id="network-selector-input"
placeholder="Search..."
/>
<CommandEmpty>No network found.</CommandEmpty>
</div>
<CommandGroup className="overflow-y-auto">
{SUPPORTED_NETWORKS.map((network) => {
Expand Down Expand Up @@ -209,6 +208,7 @@ const Sidebar: FC<Omit<SidebarContainerProps, 'children' | 'shiftContent'>> = ({
)
})}
</CommandGroup>
<CommandEmpty>No network found.</CommandEmpty>
</Command>
</div>
</nav>
Expand Down

0 comments on commit 1b01e48

Please sign in to comment.