Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert LG-4444: OverlayContext and useOverlay #2503

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .changeset/strange-geckos-jam.md

This file was deleted.

18 changes: 0 additions & 18 deletions packages/leafygreen-provider/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,21 +121,3 @@ function Example({ children, darkMode: darkModeProp, variant }) {
return <div className={badgeVariants[theme][variant]}>{children}</div>;
}
```

## useOverlay

This hook is used to register/remove a component to the `OverlayContext`.

### Example

```js
import { useOverlay } from '@leafygreen-ui/leafygreen-provider';

const Popover = forwardRef<HTMLDivElement, PopoverProps>(
({ children }: PopoverProps, fwdRef) => {
const { id, isTopMostOverlay, ref } = useOverlay(fwdRef);

return <div ref={ref}>{children}</div>
},
);
```
15 changes: 6 additions & 9 deletions packages/leafygreen-provider/src/LeafyGreenContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import PropTypes from 'prop-types';
import { DarkModeProps } from '@leafygreen-ui/lib';

import DarkModeProvider, { useDarkModeContext } from './DarkModeContext';
import { OverlayProvider } from './OverlayContext';
import {
PopoverContextType,
PopoverProvider,
Expand Down Expand Up @@ -73,14 +72,12 @@ function LeafyGreenProvider({
contextDarkMode={darkModeState}
setDarkMode={setDarkMode}
>
<OverlayProvider>
<PopoverProvider
portalContainer={portalContainer}
scrollContainer={scrollContainer}
>
{children}
</PopoverProvider>
</OverlayProvider>
<PopoverProvider
portalContainer={portalContainer}
scrollContainer={scrollContainer}
>
{children}
</PopoverProvider>
</DarkModeProvider>
</TypographyProvider>
</UsingKeyboardProvider>
Expand Down

This file was deleted.

This file was deleted.

7 changes: 0 additions & 7 deletions packages/leafygreen-provider/src/OverlayContext/index.ts

This file was deleted.

This file was deleted.

49 changes: 0 additions & 49 deletions packages/leafygreen-provider/src/OverlayContext/useOverlay.ts

This file was deleted.

Loading
Loading