feat(MED-122): don't use math.random on ssr
This commit is contained in:
@@ -674,11 +674,6 @@ const SidebarMenuSkeleton: React.FC<
|
|||||||
showIcon?: boolean;
|
showIcon?: boolean;
|
||||||
}
|
}
|
||||||
> = ({ className, showIcon = false, ...props }) => {
|
> = ({ className, showIcon = false, ...props }) => {
|
||||||
// Random width between 50 to 90%.
|
|
||||||
const width = React.useMemo(() => {
|
|
||||||
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
data-sidebar="menu-skeleton"
|
data-sidebar="menu-skeleton"
|
||||||
@@ -696,7 +691,7 @@ const SidebarMenuSkeleton: React.FC<
|
|||||||
data-sidebar="menu-skeleton-text"
|
data-sidebar="menu-skeleton-text"
|
||||||
style={
|
style={
|
||||||
{
|
{
|
||||||
'--skeleton-width': width,
|
'--skeleton-width': '70%',
|
||||||
} as React.CSSProperties
|
} as React.CSSProperties
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user