File tree Expand file tree Collapse file tree 2 files changed +4
-14
lines changed
packages/unity-bootstrap-theme/stories/molecules/cookie-consent Expand file tree Collapse file tree 2 files changed +4
-14
lines changed Original file line number Diff line number Diff line change 11import React , { useEffect } from "react" ;
22import { allCookieConsentJS } from "../../../src/js/cookie-consent-full-screen.js" ;
3+ import "../../../src/css/cookie-consent-full-screen.css" ;
34
45export default {
56 title : "Molecules/Cookie Consent" ,
7+ // Forces reload of the story to keep css and js from persisting between stories
68 decorators : [
79 ( storyFn , context ) => {
810 useEffect ( ( ) => {
@@ -25,13 +27,6 @@ export default {
2527export const FullScreenBannerCookieConsent = ( ) => {
2628 useEffect ( ( ) => {
2729 allCookieConsentJS ( ) ;
28- const loadCSS = async ( ) => {
29- const cssModule = await import ( "../../../src/css/cookie-consent-full-screen.css" , {
30- assert : { type : 'css' }
31- } ) ;
32- document . adoptedStyleSheets = [ cssModule . default ] ;
33- } ;
34- loadCSS ( ) ;
3530 } , [ ] ) ;
3631
3732 return (
Original file line number Diff line number Diff line change 11import React , { useEffect } from "react" ;
22import { allCookieConsentJS } from "../../../src/js/cookie-consent" ;
3+ import "../../../src/css/cookie-consent.css" ;
34
45export default {
56 title : "Molecules/Cookie Consent" ,
7+ // Forces reload of the story to keep css and js from persisting between stories
68 decorators : [
79 ( storyFn , context ) => {
810 useEffect ( ( ) => {
@@ -23,13 +25,6 @@ export default {
2325export const MaxWidthCookieConsent = ( ) => {
2426 useEffect ( ( ) => {
2527 allCookieConsentJS ( ) ;
26- const loadCSS = async ( ) => {
27- const cssModule = await import ( "../../../src/css/cookie-consent.css" , {
28- assert : { type : 'css' }
29- } ) ;
30- document . adoptedStyleSheets = [ cssModule . default ] ;
31- } ;
32- loadCSS ( ) ;
3328 } , [ ] ) ;
3429
3530 return (
You can’t perform that action at this time.
0 commit comments