MCPcopy Index your code
hub / github.com/adobe/react-spectrum / SearchMenuWrapper

Function SearchMenuWrapper

packages/dev/s2-docs/src/SearchMenuWrapper.tsx:15–43  ·  view source on GitHub ↗
({children}: {children: ReactNode})

Source from the content-addressed store, hash-verified

13);
14
15export default function SearchMenuWrapper({children}: {children: ReactNode}) {
16 let {colorScheme} = useSettings();
17 return (
18 <>
19 <div className={style({display: {default: 'none', lg: 'flex'}})}>
20 <ButtonContext
21 value={{
22 onHoverStart: () => preloadSearchMenu(),
23 onPress: () => window.dispatchEvent(new CustomEvent('show-search-menu'))
24 }}>
25 {children}
26 </ButtonContext>
27 </div>
28 <div className={style({display: {default: 'flex', lg: 'none'}})}>
29 <DialogTrigger>
30 {children}
31 <S2Modal size="fullscreenTakeover">
32 <Provider
33 colorScheme={colorScheme}
34 background="layer-2"
35 styles={style({height: 'full'})}>
36 <MobileSearchMenu initialTag="components" />
37 </Provider>
38 </S2Modal>
39 </DialogTrigger>
40 </div>
41 </>
42 );
43}
44
45export function SearchMenuButton(props: ButtonProps) {
46 return <Button {...props} />;

Callers

nothing calls this directly

Calls 2

useSettingsFunction · 0.90
preloadSearchMenuFunction · 0.90

Tested by

no test coverage detected