Skip to content

Commit

Permalink
fix:asyncapi#907: sidebar broken in playground
Browse files Browse the repository at this point in the history
  • Loading branch information
surajTade committed Oct 5, 2024
1 parent 268e0fa commit e3666ec
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions library/src/containers/AsyncApi/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,12 @@ const AsyncApiLayout: React.FunctionComponent<Props> = ({
config,
error = null,
}) => {
const [observerClassName, setObserverClassName] = useState('container:xl');

const { ref } = useResizeObserver<HTMLDivElement>({
onResize: ({ width }) => {
requestAnimationFrame(() => {
if (width === undefined) {
return;
}

const possibleClassName =
width <= 1280 ? 'container:xl' : 'container:base';
if (possibleClassName !== observerClassName) {
setObserverClassName(possibleClassName);
}
});
},
});
Expand All @@ -49,7 +41,7 @@ const AsyncApiLayout: React.FunctionComponent<Props> = ({
<SpecificationContext.Provider value={asyncapi}>
<section className="aui-root">
<div
className={`${observerClassName} relative md:flex bg-white leading-normal`}
className={`w-full relative md:flex bg-white leading-normal`}
id={config.schemaID ?? undefined}
ref={ref}
>
Expand Down

0 comments on commit e3666ec

Please sign in to comment.