mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-11-15 06:45:36 +08:00
feat(proxies): mount tooltip portal within rootElement
This commit is contained in:
parent
9621001b42
commit
554b361184
@ -11,6 +11,7 @@ import {
|
|||||||
favNightTheme,
|
favNightTheme,
|
||||||
setCurTheme,
|
setCurTheme,
|
||||||
setLatestConnectionMsg,
|
setLatestConnectionMsg,
|
||||||
|
setRootElement,
|
||||||
useTwemoji,
|
useTwemoji,
|
||||||
useWsRequest,
|
useWsRequest,
|
||||||
} from '~/signals'
|
} from '~/signals'
|
||||||
@ -33,6 +34,7 @@ export const App: ParentComponent = ({ children }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
ref={(el) => setRootElement(el)}
|
||||||
class={twMerge(
|
class={twMerge(
|
||||||
'relative flex h-screen flex-col overscroll-y-none subpixel-antialiased',
|
'relative flex h-screen flex-col overscroll-y-none subpixel-antialiased',
|
||||||
useTwemoji() ? 'font-twemoji' : 'font-no-twemoji',
|
useTwemoji() ? 'font-twemoji' : 'font-no-twemoji',
|
||||||
|
@ -8,7 +8,7 @@ import {
|
|||||||
formatProxyType,
|
formatProxyType,
|
||||||
getLatencyClassName,
|
getLatencyClassName,
|
||||||
} from '~/helpers'
|
} from '~/helpers'
|
||||||
import { curTheme, useProxies } from '~/signals'
|
import { rootElement, useProxies } from '~/signals'
|
||||||
|
|
||||||
export const ProxyNodeCard = (props: {
|
export const ProxyNodeCard = (props: {
|
||||||
proxyName: string
|
proxyName: string
|
||||||
@ -79,8 +79,8 @@ export const ProxyNodeCard = (props: {
|
|||||||
</div>
|
</div>
|
||||||
</Tooltip.Trigger>
|
</Tooltip.Trigger>
|
||||||
|
|
||||||
<Tooltip.Portal>
|
<Tooltip.Portal mount={rootElement()}>
|
||||||
<Tooltip.Content data-theme={curTheme()} class="z-50 bg-transparent">
|
<Tooltip.Content class="z-50">
|
||||||
<Tooltip.Arrow class="text-neutral" />
|
<Tooltip.Arrow class="text-neutral" />
|
||||||
|
|
||||||
<div class="flex flex-col items-center gap-2 rounded-box bg-neutral p-2.5 text-neutral-content">
|
<div class="flex flex-col items-center gap-2 rounded-box bg-neutral p-2.5 text-neutral-content">
|
||||||
|
3
src/signals/global.ts
Normal file
3
src/signals/global.ts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
export const [rootElement, setRootElement] = createSignal(
|
||||||
|
document.createElement('div'),
|
||||||
|
)
|
@ -1,5 +1,6 @@
|
|||||||
export * from './config'
|
export * from './config'
|
||||||
export * from './connections'
|
export * from './connections'
|
||||||
|
export * from './global'
|
||||||
export * from './logs'
|
export * from './logs'
|
||||||
export * from './proxies'
|
export * from './proxies'
|
||||||
export * from './request'
|
export * from './request'
|
||||||
|
Loading…
Reference in New Issue
Block a user