Skip to content

Commit

Permalink
fix(packages/viewer): update className description and apply it to th…
Browse files Browse the repository at this point in the history
…e outermost container

This fixes the dark/light mode toggle when setting modes via the viewers classname.
  • Loading branch information
Schlomoh committed Nov 24, 2024
1 parent de4c3d7 commit 3c5c3c1
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions packages/viewer/src/vectreal-viewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ interface VectrealViewerProps extends PropsWithChildren {
model?: Object3D;

/**
* An optional className to apply to the canvas element of the viewer.
* An optional className to apply to the outermost container of the viewer.
*/
className?: string;

Expand Down Expand Up @@ -132,15 +132,11 @@ const VectrealViewer = ({ model, ...props }: VectrealViewerProps) => {
} = props;

return (
<div className={cn('vctrl-viewer', styles['viewer'])}>
<div className={cn('vctrl-viewer', styles['viewer'], className)}>
{model && (
<Suspense fallback={<SpinnerWrapper loader={loader} />}>
<Canvas
className={cn(
'vctrl-viewer-canvas',
styles['viewer-canvas'],
className,
)}
className={cn('vctrl-viewer-canvas', styles['viewer-canvas'])}
dpr={[1, 1.5]}
shadows
style={{ backgroundColor: envOptions?.backgroundColor }}
Expand Down

0 comments on commit 3c5c3c1

Please sign in to comment.