Skip to content
This repository was archived by the owner on Jan 19, 2025. It is now read-only.

Commit 0da5235

Browse files
committed
Still testing but let's see 🚀
1 parent 30471c3 commit 0da5235

File tree

3 files changed

+57
-29
lines changed

3 files changed

+57
-29
lines changed

src/components/design-system/organism/blog-header.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { StaticImage } from "gatsby-plugin-image";
33
import styled from "styled-components";
44
import { mediaQuery } from "../utils-css/media-query";
55
import { gatsbyImagePlaceholderSelector } from "../utils-css/gatsby-image-selector";
6-
import { transform } from "../utils-css/transform-keyframes";
76

87
const BlogHeaderContainer = styled.div`
98
display: flex;

src/components/design-system/templates/blog-page-template.tsx

Lines changed: 56 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@ import { FC, ReactNode } from "react";
1212

1313
const 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+
3560
export 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+
};

src/logic/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ export const pageOpenedInApp = (
44
location: WindowLocation<WindowLocation["state"]>,
55
): boolean => {
66
const appParam = new URLSearchParams(location.search).get("app");
7-
return appParam !== null && appParam === "true";
7+
return appParam !== undefined && appParam !== null && appParam === "true";
88
};

0 commit comments

Comments
 (0)