Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* docs(utils): add docs to helpers * feat(utils): add pc types to utils * feat(react): make scrollbars accept a ref * chore(react):add missing dependencies * feat(react): extend sdk hook for new API * feat(joy): make scrollbars optional * refactor: cleanup types
- Loading branch information
Showing
13 changed files
with
244 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/// <reference types="@captn/utils/types" /> | ||
|
||
// NOTE: This file should not be edited |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/// <reference types="@captn/utils/types" /> | ||
|
||
// NOTE: This file should not be edited |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,30 @@ | ||
import Box from "@mui/joy/Box"; | ||
import type { CSSProperties, ReactNode } from "react"; | ||
import { CSSProperties, forwardRef, ReactNode } from "react"; | ||
import { Scrollbars } from "react-custom-scrollbars"; | ||
|
||
export function CustomScrollbars({ | ||
style, | ||
children, | ||
}: { | ||
style?: CSSProperties; | ||
children?: ReactNode; | ||
}) { | ||
return ( | ||
<Scrollbars | ||
autoHide | ||
universal | ||
style={{ ...style, overflow: "hidden" }} | ||
renderThumbVertical={properties => ( | ||
<Box | ||
{...properties} | ||
className="thumb-vertical" | ||
sx={theme => ({ | ||
bgcolor: "text.secondary", | ||
zIndex: theme.zIndex.badge + 1, | ||
})} | ||
/> | ||
)} | ||
> | ||
{children} | ||
</Scrollbars> | ||
); | ||
} | ||
export const CustomScrollbars = forwardRef< | ||
Scrollbars, | ||
{ | ||
style?: CSSProperties; | ||
children?: ReactNode; | ||
} | ||
>(({ style, children }, ref) => ( | ||
<Scrollbars | ||
ref={ref} | ||
autoHide | ||
universal | ||
style={{ ...style, overflow: "hidden" }} | ||
renderThumbVertical={properties => ( | ||
<Box | ||
{...properties} | ||
className="thumb-vertical" | ||
sx={theme => ({ | ||
bgcolor: "text.secondary", | ||
zIndex: theme.zIndex.badge + 1, | ||
})} | ||
/> | ||
)} | ||
> | ||
{children} | ||
</Scrollbars> | ||
)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.