fix: switch space bug (#692)

This commit is contained in:
fuscodev
2025-01-30 22:14:11 +01:00
committed by GitHub
parent 85d18b8cc8
commit f8b93ce93f

View File

@ -13,6 +13,7 @@ interface SwitchSpaceProps {
export function SwitchSpace({ spaceName, spaceSlug }: SwitchSpaceProps) { export function SwitchSpace({ spaceName, spaceSlug }: SwitchSpaceProps) {
const navigate = useNavigate(); const navigate = useNavigate();
const [opened, { close, open }] = useDisclosure(false);
const handleSelect = (value: string) => { const handleSelect = (value: string) => {
if (value) { if (value) {
@ -27,6 +28,7 @@ export function SwitchSpace({ spaceName, spaceSlug }: SwitchSpaceProps) {
position="bottom" position="bottom"
withArrow withArrow
shadow="md" shadow="md"
opened={opened}
> >
<Popover.Target> <Popover.Target>
<Button <Button
@ -35,6 +37,7 @@ export function SwitchSpace({ spaceName, spaceSlug }: SwitchSpaceProps) {
justify="space-between" justify="space-between"
rightSection={<IconChevronDown size={18} />} rightSection={<IconChevronDown size={18} />}
color="gray" color="gray"
onClick={open}
> >
<Avatar <Avatar
size={20} size={20}