@@ -12,9 +12,12 @@ import { FC, ReactNode } from "react";
1212
1313const Footer = loadable ( ( ) => import ( `../organism/footer` ) ) ;
1414
15- const ContentContainer = styled ( Container ) < { pageOpenedFromApp : boolean } > `
16- margin-top: ${ ( props ) =>
17- props . pageOpenedFromApp ? 0 : props . theme . spacing [ 12 ] } ;
15+ const ContentContainer = styled ( Container ) `
16+ margin-top: ${ ( props ) => props . theme . spacing [ 12 ] } ;
17+ flex: 1 0 auto;
18+ ` ;
19+
20+ const ContentContainerApp = styled ( Container ) `
1821 flex: 1 0 auto;
1922` ;
2023
@@ -32,6 +35,28 @@ export interface BlogPageProps {
3235 children ?: ReactNode ;
3336}
3437
38+ const StandardLayout : FC < {
39+ location : CurrentLocation ;
40+ trackingCategory : string ;
41+ children ?: ReactNode ;
42+ big : boolean ;
43+ author : string ;
44+ } > = ( { location, trackingCategory, big, author, children } ) => {
45+ return (
46+ < div >
47+ < BlogMenu
48+ trackingCategory = { trackingCategory }
49+ pathname = { location . pathname }
50+ />
51+ < ContentContainer >
52+ < DesktopBlogHeader big = { big } />
53+ { children }
54+ </ ContentContainer >
55+ < Footer author = { author } trackingCategory = { trackingCategory } />
56+ </ div >
57+ ) ;
58+ } ;
59+
3560export const BlogPageTemplate : FC < BlogPageProps > = ( {
3661 children,
3762 location,
@@ -44,27 +69,31 @@ export const BlogPageTemplate: FC<BlogPageProps> = ({
4469 description,
4570 date,
4671 big = false ,
47- } ) => (
48- < BlogThemePage >
49- < Head
50- url = { location . url }
51- pageType = { ogPageType }
52- imageUrl = { ogImage }
53- customTitle = { customTitle }
54- description = { description }
55- date = { date }
56- cookieConsentColor = { blogPrimaryColor }
57- />
58- < BlogMenu
59- trackingCategory = { trackingCategory }
60- pathname = { location . pathname }
61- />
62- < ContentContainer pageOpenedFromApp = { false } >
63- < DesktopBlogHeader big = { big } />
64- { children }
65- </ ContentContainer >
66- { ! pageOpenedInApp && (
67- < Footer author = { author } trackingCategory = { trackingCategory } />
68- ) }
69- </ BlogThemePage >
70- ) ;
72+ } ) => {
73+ console . log ( "from app" , pageOpenedInApp ) ;
74+ return (
75+ < BlogThemePage >
76+ < Head
77+ url = { location . url }
78+ pageType = { ogPageType }
79+ imageUrl = { ogImage }
80+ customTitle = { customTitle }
81+ description = { description }
82+ date = { date }
83+ cookieConsentColor = { blogPrimaryColor }
84+ />
85+ { ! pageOpenedInApp ? (
86+ < StandardLayout
87+ location = { location }
88+ big = { big }
89+ trackingCategory = { trackingCategory }
90+ author = { author }
91+ >
92+ { children }
93+ </ StandardLayout >
94+ ) : (
95+ < ContentContainerApp > { children } </ ContentContainerApp >
96+ ) }
97+ </ BlogThemePage >
98+ ) ;
99+ } ;
0 commit comments