File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3131 - name : Build docs
3232 run : pnpm run build:docs
3333
34+ - name : Run tests
35+ run : pnpm run test:run
36+
3437 - name : Show current directory files
3538 run : ls -la
3639
Original file line number Diff line number Diff line change 3434 - name : Biome format & linter
3535 run : pnpm run format
3636
37+ - name : Run tests
38+ run : pnpm run test:run
39+
3740 - name : Build library
3841 run : pnpm run build
3942
Original file line number Diff line number Diff line change @@ -179,6 +179,11 @@ <h2 id="props">Props</h2>
179179 < td > < code > navigator.language</ code > or < code > 'us'</ code > </ td >
180180 < td > < code > string</ code > < p > Language code used to generate App Store or Play Store URLs.</ p > </ td >
181181 </ tr >
182+ < tr >
183+ < td > < code > disableHtmlMargin</ code > </ td >
184+ < td > < code > false</ code > </ td >
185+ < td > < code > boolean</ code > < p > Disable HTML margin.</ p > </ td >
186+ </ tr >
182187 < tr >
183188 < td > < code > withPortal</ code > </ td >
184189 < td > < code > true</ code > </ td >
Original file line number Diff line number Diff line change 7474 "dependencies" : {
7575 "js-cookie" : " ^3.0.5" ,
7676 "ua-parser-js" : " ^2.0.3"
77- }
77+ },
78+ "packageManager" : " pnpm@9.4.0"
7879}
Original file line number Diff line number Diff line change 77 iconsRels ,
88 isStandalone ,
99 cookie ,
10- } from "./utils" ;
10+ } from ".. /utils" ;
1111
1212describe ( "utils" , ( ) => {
1313 describe ( "is_client" , ( ) => {
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ export const SmartBanner: React.FC<SmartBannerProps> = ({
3333 ignoreIosVersion = false ,
3434 onClose,
3535 onInstall,
36+ disableHtmlMargin = false ,
3637 withPortal = true ,
3738 portalTargetId,
3839 target,
@@ -91,8 +92,10 @@ export const SmartBanner: React.FC<SmartBannerProps> = ({
9192 React . useEffect ( ( ) => {
9293 if ( ! html ) return ;
9394
94- html . classList . toggle ( ClassNames . TOP , placement === "top" ) ;
95- html . classList . toggle ( ClassNames . BOTTOM , placement === "bottom" ) ;
95+ if ( ! disableHtmlMargin ) {
96+ html . classList . toggle ( ClassNames . TOP , placement === "top" ) ;
97+ html . classList . toggle ( ClassNames . BOTTOM , placement === "bottom" ) ;
98+ }
9699
97100 // return () => {
98101 // if (!html) return;
@@ -103,7 +106,7 @@ export const SmartBanner: React.FC<SmartBannerProps> = ({
103106 // ClassNames.BOTTOM
104107 // );
105108 // }
106- } , [ placement ] ) ;
109+ } , [ placement , disableHtmlMargin ] ) ;
107110
108111 const handleShow = React . useCallback ( ( show : boolean ) => {
109112 if ( html ) {
Original file line number Diff line number Diff line change @@ -97,6 +97,12 @@ export interface SmartBannerProps {
9797 */
9898 onInstall ?: ( ) => void ;
9999
100+ /**
101+ * Disable HTML margin.
102+ * @default false
103+ */
104+ disableHtmlMargin ?: boolean ;
105+
100106 /**
101107 * Whether to render the banner using a React Portal.
102108 * @default true
You can’t perform that action at this time.
0 commit comments