Skip to content

Commit

Permalink
Merge pull request #342 from SU-SWS/release/v2.5.7
Browse files Browse the repository at this point in the history
Release/v2.5.7
  • Loading branch information
yvonnetangsu authored Sep 5, 2024
2 parents b101d66 + cf2d40b commit 560a865
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions components/Storyblok/SbTypeform.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export type SbTypeformProps = {
id: string;
autoFocus: false;
component: string;
embedLabel?: string;
embedType: 'slider' | 'popup' | 'popover' | 'sidetab' | 'widget';
autoResize: boolean;
fullScreen: boolean;
Expand Down Expand Up @@ -42,6 +43,7 @@ export const SbTypeform = ({
const {
id,
autoFocus,
embedLabel = '',
embedType,
autoResize,
fullScreen,
Expand All @@ -62,6 +64,9 @@ export const SbTypeform = ({
const height = parseInt(embedHeight, 10);
const resize = autoResize || !height;
const opacity = transparent ? 0 : 100;
const iframeProps = {
ariaLabel: embedLabel ? embedLabel : undefined,
};

switch (embedType) {
case 'slider': {
Expand All @@ -81,6 +86,7 @@ export const SbTypeform = ({
hideHeaders={hideHeader}
transitiveSearchParams={transitiveParams}
displayAsFullScreenModal={displayAsFullScreenModal}
iframeProps={iframeProps}
>
<span className={styles.fauxCTA}>{buttonLabel}</span>
</Slider>
Expand All @@ -102,6 +108,7 @@ export const SbTypeform = ({
displayAsFullScreenModal={displayAsFullScreenModal}
autoResize={resize}
height={!resize ? embedHeight : undefined}
iframeProps={iframeProps}
/>
);
}
Expand All @@ -120,6 +127,7 @@ export const SbTypeform = ({
displayAsFullScreenModal={displayAsFullScreenModal}
autoResize={resize}
height={!resize ? embedHeight : undefined}
iframeProps={iframeProps}
/>
);
}
Expand All @@ -144,6 +152,7 @@ export const SbTypeform = ({
autoResize={resize}
height={!resize ? embedHeight : undefined}
className={styles.fauxCTA}
iframeProps={iframeProps}
>
{buttonLabel}
</PopUp>
Expand Down Expand Up @@ -173,6 +182,7 @@ export const SbTypeform = ({
opacity={opacity}
height={!resize ? embedHeight : undefined}
className='w-full'
iframeProps={iframeProps}
/>
</Container>
);
Expand Down
2 changes: 1 addition & 1 deletion components/TypeForm/Widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ const Widget = ({
return <TypeFormWidget noHeading keepSession id={id} className={cnb(className)} {...rest} />;
};

export { Widget };
export { Widget };

0 comments on commit 560a865

Please sign in to comment.