Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const iframe = window.parent.document.getElementById('storybook-preview-iframe');
const [base, search] = iframe.src.split('?');
const currentQuery = qs.parse(search, { ignoreQueryPrefix: true });
iframe.src = `${base}?${qs.stringify({ ...currentQuery, ...queryObj })}`;
}
let contentDensity;
try {
const iframe = window.parent.document.getElementById('storybook-preview-iframe');
const currentQuery = qs.parse(iframe.src.split('?')[1]);
contentDensity =
currentQuery['sap-ui-compactSize'] && currentQuery['sap-ui-compactSize'] !== 'false'
? ContentDensity.Compact
: ContentDensity.Cozy;
} catch (e) {
contentDensity = ContentDensity.Cozy;
}
return (
{getStory(context)}
);
}
});
wrapper: (getStory, context) => {
function setQueryParam(queryObj) {
const iframe = window.parent.document.getElementById('storybook-preview-iframe');
const [base, search] = iframe.src.split('?');
const currentQuery = qs.parse(search, { ignoreQueryPrefix: true });
iframe.src = `${base}?${qs.stringify({ ...currentQuery, ...queryObj })}`;
}
let contentDensity;
try {
const iframe = window.parent.document.getElementById('storybook-preview-iframe');
const currentQuery = qs.parse(iframe.src.split('?')[1]);
contentDensity =
currentQuery['sap-ui-compactSize'] && currentQuery['sap-ui-compactSize'] !== 'false'
? ContentDensity.Compact
: ContentDensity.Cozy;
} catch (e) {
contentDensity = ContentDensity.Cozy;
}
return (
{getStory(context)}
);
}
});
const themeContext = useMemo(() => {
return {
theme,
contentDensity: isCompactSize ? ContentDensity.Compact : ContentDensity.Cozy,
parameters: sap_fiori_3
};
}, [theme, isCompactSize]);
const renderHideHeaderButton = () => {
if (!showHideHeaderButton || renderHeaderContentProp === null) return null;
const { contentDensity } = theme as JSSTheme;
return (
<button style="{">
);
};
</button>