/home/vianto5/heredit.mx/wp-content/plugins/code-snippets/js/components/common
NameSizeModeActions
cloud/-0755rm
icons/-0755rm
ListTable/-0755rm
snippets/-0755rm
Badge.tsx8600644editdlrm
Button.tsx9290644editdlrm
ConfirmDialog.tsx10590644editdlrm
CopyToClipboardButton.tsx23400644editdlrm
KebabMenu.tsx61940644editdlrm
LoadingStatusNotices.tsx9430644editdlrm
Notice.tsx13540644editdlrm
ScreenMetaSlot.tsx12900644editdlrm
SnippetViewToggle.tsx14650644editdlrm
SubmitButton.tsx9820644editdlrm
SubnavTabs.tsx22540644editdlrm
Toolbar.tsx52110644editdlrm
Tooltip.tsx14280644editdlrm
TooltipButton.tsx8540644editdlrm
UpsellBanner.tsx13370644editdlrm
UpsellDialog.tsx24200644editdlrm
Edit: /home/vianto5/heredit.mx/wp-content/plugins/code-snippets/js/components/common/ScreenMetaSlot.tsx (1290B)
import React, { useEffect } from 'react' const SLOT_ID = 'snippets-screen-meta-slot' export interface ScreenMetaSlotProps { hidden?: boolean } /** * Relocates the WordPress Screen Options and Help tabs (and their panels) * from above the page content into this slot, so they appear directly below * the page's subnavigation bar. The slot div is rendered empty by React and * never reconciled with children, so adopting the foreign nodes is safe. * The nodes are returned to the top of the page when the slot unmounts. * * Stays mounted (with `hidden`) rather than being conditionally rendered by * the caller: unmounting hands the adopted nodes back to their native, * visible position at the top of the page instead of hiding them. */ export const ScreenMetaSlot: React.FC = ({ hidden = false }) => { useEffect(() => { const slot = document.getElementById(SLOT_ID) const meta = document.getElementById('screen-meta') const links = document.getElementById('screen-meta-links') if (!slot || !meta || !links) { return undefined } const parent = meta.parentElement slot.append(meta, links) return () => { parent?.prepend(meta, links) } }, []) return