mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-29 21:49:50 +01:00
fix: no session search result overlap
This commit is contained in:
1 parent
e294f2e286
commit
16500793a5
1 file changed
+32
-41
@@ -8,7 +8,6 @@ import {
|
|||||||
import {
|
import {
|
||||||
AlertDialog,
|
AlertDialog,
|
||||||
Button,
|
Button,
|
||||||
Card,
|
|
||||||
DropdownMenu,
|
DropdownMenu,
|
||||||
Flex,
|
Flex,
|
||||||
Heading,
|
Heading,
|
||||||
@@ -110,7 +109,7 @@ export default function Page({
|
|||||||
const search = debounce(async () => {
|
const search = debounce(async () => {
|
||||||
if (!input.current) return;
|
if (!input.current) return;
|
||||||
|
|
||||||
setSearchResults(await searchPlayersAcrossRegions(input.current.value, 9));
|
setSearchResults(await searchPlayersAcrossRegions(input.current.value, 15));
|
||||||
setSearching(false);
|
setSearching(false);
|
||||||
}, 500);
|
}, 500);
|
||||||
|
|
||||||
@@ -269,46 +268,38 @@ export default function Page({
|
|||||||
<TextField.Slot>
|
<TextField.Slot>
|
||||||
<MagnifyingGlassIcon />
|
<MagnifyingGlassIcon />
|
||||||
</TextField.Slot>
|
</TextField.Slot>
|
||||||
|
|
||||||
{showSearch && (
|
|
||||||
<Card
|
|
||||||
mt="2"
|
|
||||||
style={{
|
|
||||||
position: 'absolute',
|
|
||||||
top: '100%',
|
|
||||||
left: 0,
|
|
||||||
width: '100%',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{searching && (
|
|
||||||
<Flex justify="center">
|
|
||||||
<Text color="gray">Searching...</Text>
|
|
||||||
</Flex>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{!searching && searchResults.length === 0 && (
|
|
||||||
<Flex justify="center">
|
|
||||||
<Text color="gray">No players found</Text>
|
|
||||||
</Flex>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{!searching && searchResults.length > 0 && (
|
|
||||||
<Flex direction="column" gap="2">
|
|
||||||
{searchResults.map((player) => (
|
|
||||||
<Button
|
|
||||||
key={player.account_id}
|
|
||||||
variant="ghost"
|
|
||||||
onClick={() => track(player.account_id)}
|
|
||||||
>
|
|
||||||
{player.nickname} (
|
|
||||||
{UNLOCALIZED_REGION_NAMES_SHORT[player.region]})
|
|
||||||
</Button>
|
|
||||||
))}
|
|
||||||
</Flex>
|
|
||||||
)}
|
|
||||||
</Card>
|
|
||||||
)}
|
|
||||||
</TextField.Root>
|
</TextField.Root>
|
||||||
|
|
||||||
|
{showSearch && (
|
||||||
|
<Flex mt="2">
|
||||||
|
{searching && (
|
||||||
|
<Flex justify="center">
|
||||||
|
<Text color="gray">Searching...</Text>
|
||||||
|
</Flex>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{!searching && searchResults.length === 0 && (
|
||||||
|
<Flex justify="center">
|
||||||
|
<Text color="gray">No players found</Text>
|
||||||
|
</Flex>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{!searching && searchResults.length > 0 && (
|
||||||
|
<Flex direction="column" gap="2">
|
||||||
|
{searchResults.map((player) => (
|
||||||
|
<Button
|
||||||
|
key={player.account_id}
|
||||||
|
variant="ghost"
|
||||||
|
onClick={() => track(player.account_id)}
|
||||||
|
>
|
||||||
|
{player.nickname} (
|
||||||
|
{UNLOCALIZED_REGION_NAMES_SHORT[player.region]})
|
||||||
|
</Button>
|
||||||
|
))}
|
||||||
|
</Flex>
|
||||||
|
)}
|
||||||
|
</Flex>
|
||||||
|
)}
|
||||||
</Flex>
|
</Flex>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user