Skip to content

Commit 8f4253e

Browse files
larixermerceyz
authored andcommitted
Move Ukrainain banner to the home page only to not disrupt docs UX (#4251)
1 parent 6a69d70 commit 8f4253e

File tree

2 files changed

+54
-49
lines changed

2 files changed

+54
-49
lines changed

packages/gatsby/src/components/header.js

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -159,44 +159,6 @@ const MenuNavigation = styled.div`
159159
}
160160
`;
161161

162-
const Banner = styled.div`
163-
background-color: #5474c9;
164-
display: flex;
165-
flex: 1;
166-
align-items: center;
167-
justify-content: center;
168-
padding: 1em;
169-
170-
> :first-child {
171-
margin-right: 1em;
172-
}
173-
`;
174-
175-
const UkrainianFlag = styled.div`
176-
width: 4em;
177-
height: 3em;
178-
background-image: linear-gradient(#0066cc 50%, #ffcc00 50%);
179-
`;
180-
181-
const BannerTextContainer = styled.div`
182-
flex: 1;
183-
184-
color: white;
185-
186-
a {
187-
color: #fff;
188-
text-decoration: underline;
189-
}
190-
191-
> :first-child {
192-
margin-top: 0;
193-
}
194-
195-
> :last-child {
196-
margin-bottom: 0;
197-
}
198-
`;
199-
200162
const MenuSearchBox = styled.div`
201163
display: none;
202164
@@ -386,17 +348,6 @@ export const Header = ({children}) => {
386348
</a>
387349
</MenuSearchBox>
388350
</MenuContainer>
389-
<Banner>
390-
<UkrainianFlag />
391-
<BannerTextContainer>
392-
<p>
393-
The Yarn team stands with the people of Ukraine during this heinous assault on their freedom, their independence, and their lives.
394-
</p>
395-
<p>
396-
To support Ukraine in their time of need visit this <a href={`https://war.ukraine.ua/support-ukraine/`}>page</a>.
397-
</p>
398-
</BannerTextContainer>
399-
</Banner>
400351
{children}
401352
</HeaderContainer>
402353
</>;

packages/gatsby/src/pages/index.js

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,58 @@ const SellingPoint = ({imgUrl, children, href}) => <>
155155
</SellingPointContainer>
156156
</>;
157157

158+
const Banner = styled.div`
159+
background-color: #5474c9;
160+
display: flex;
161+
flex: 1;
162+
align-items: center;
163+
justify-content: center;
164+
padding: 1em;
165+
166+
> :first-child {
167+
margin-right: 1em;
168+
}
169+
`;
170+
171+
const UkrainianFlag = styled.div`
172+
width: 4em;
173+
height: 3em;
174+
background-image: linear-gradient(#0066cc 50%, #ffcc00 50%);
175+
`;
176+
177+
const BannerTextContainer = styled.div`
178+
flex: 1;
179+
180+
color: white;
181+
182+
a {
183+
color: #fff;
184+
text-decoration: underline;
185+
}
186+
187+
> :first-child {
188+
margin-top: 0;
189+
}
190+
191+
> :last-child {
192+
margin-bottom: 0;
193+
}
194+
`;
195+
196+
const UkrainianBanner = () =>
197+
<Banner>
198+
<UkrainianFlag />
199+
<BannerTextContainer>
200+
<p>
201+
The Yarn team stands with the people of Ukraine during this heinous assault on their freedom, their independence, and their lives.
202+
</p>
203+
<p>
204+
To support Ukraine in their time of need visit this <a href={`https://war.ukraine.ua/support-ukraine/`}>page</a>.
205+
</p>
206+
</BannerTextContainer>
207+
</Banner>;
208+
209+
158210
const IndexPage = ({data, searchState, onSearchStateChange}) => {
159211
const [tags, setTags] = useState([]);
160212
const [owners, setOwners] = useState([]);
@@ -182,6 +234,8 @@ const IndexPage = ({data, searchState, onSearchStateChange}) => {
182234
/>
183235

184236
{!searchState.query && <>
237+
<UkrainianBanner />
238+
185239
<Hero>
186240
<SectionContent>
187241
<HeroTitle>

0 commit comments

Comments
 (0)