Skip to content

Commit

Permalink
docs: Auto detect hasPointer on mobile (#6647)
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackySoul authored and actions-user committed Feb 29, 2024
1 parent 34bcade commit 3213d06
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion styleguide/Components/Preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,10 @@ class Preview extends PreviewParent {
);

let width;
let hasPointer = undefined; // по умолчанию берем автоматическое определение
if (viewWidth >= BREAKPOINTS.SMALL_TABLET) {
width = styleGuideContext.width;
hasPointer = styleGuideContext.hasPointer;
} else {
width = viewWidth - 32;
}
Expand Down Expand Up @@ -161,7 +163,12 @@ class Preview extends PreviewParent {
appearanceOptions={styleGuideContext.appearanceOptions}
themeName={styleGuideContext.themeName}
>
<Config {...styleGuideContext} layout={appRootLayout} exampleId={exampleId}>
<Config
{...styleGuideContext}
hasPointer={hasPointer}
layout={appRootLayout}
exampleId={exampleId}
>
{layout ? <Layout>{example}</Layout> : example}
</Config>
</Frame>
Expand Down

0 comments on commit 3213d06

Please sign in to comment.