({children}: {children: ReactNode})
| 13 | ); |
| 14 | |
| 15 | export 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 | |
| 45 | export function SearchMenuButton(props: ButtonProps) { |
| 46 | return <Button {...props} />; |
nothing calls this directly
no test coverage detected