-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@enalmada/nextui-admin': patch | ||
--- | ||
|
||
column label allows string or node |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { useEffect, useState } from 'react'; | ||
import { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect'; | ||
export const useLockedBody = (initialLocked = false) => { | ||
const [locked, setLocked] = useState(initialLocked); | ||
// Do the side effect before render | ||
useIsomorphicLayoutEffect(() => { | ||
if (!locked) { | ||
return; | ||
} | ||
// Save initial body style | ||
const originalOverflow = document.body.style.overflow; | ||
const originalPaddingRight = document.body.style.paddingRight; | ||
// Lock body scroll | ||
document.body.style.overflow = 'hidden'; | ||
// Get the scrollBar width | ||
const root = document.getElementById('___gatsby'); // or root | ||
const scrollBarWidth = root ? root.offsetWidth - root.scrollWidth : 0; | ||
// Avoid width reflow | ||
if (scrollBarWidth) { | ||
document.body.style.paddingRight = `${scrollBarWidth}px`; | ||
} | ||
return () => { | ||
document.body.style.overflow = originalOverflow; | ||
if (scrollBarWidth) { | ||
document.body.style.paddingRight = originalPaddingRight; | ||
} | ||
}; | ||
}, [locked]); | ||
// Update state if initialValue changes | ||
useEffect(() => { | ||
if (locked !== initialLocked) { | ||
setLocked(initialLocked); | ||
} | ||
}, [initialLocked]); | ||
return [locked, setLocked]; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { useEffect, useLayoutEffect } from 'react'; | ||
export const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import React from 'react'; | ||
export const DotsIcon = () => { | ||
return (React.createElement("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, | ||
React.createElement("path", { className: "fill-default-400", fillRule: "evenodd", clipRule: "evenodd", d: "M12 8C13.1 8 14 7.1 14 6C14 4.9 13.1 4 12 4C10.9 4 10 4.9 10 6C10 7.1 10.9 8 12 8ZM12 10C10.9 10 10 10.9 10 12C10 13.1 10.9 14 12 14C13.1 14 14 13.1 14 12C14 10.9 13.1 10 12 10ZM12 16C10.9 16 10 16.9 10 18C10 19.1 10.9 20 12 20C13.1 20 14 19.1 14 18C14 16.9 13.1 16 12 16Z", fill: "#969696" }))); | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import React from 'react'; | ||
export const InfoIcon = () => { | ||
return (React.createElement("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, | ||
React.createElement("path", { className: "fill-default-400", d: "M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM12 17C11.45 17 11 16.55 11 16V12C11 11.45 11.45 11 12 11C12.55 11 13 11.45 13 12V16C13 16.55 12.55 17 12 17ZM13 9H11V7H13V9Z", fill: "#969696" }))); | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import React from 'react'; | ||
export const ChevronUpIcon = ({ ...props }) => { | ||
return (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", ...props }, | ||
React.createElement("path", { className: "fill-default-400", d: "m6.293 13.293 1.414 1.414L12 10.414l4.293 4.293 1.414-1.414L12 7.586z" }))); | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.