+
+
+
+
-
-
-
+
+
+ >
);
}
diff --git a/beta/src/components/SocialBanner.tsx b/beta/src/components/SocialBanner.tsx
new file mode 100644
index 000000000..b0da4a6b6
--- /dev/null
+++ b/beta/src/components/SocialBanner.tsx
@@ -0,0 +1,26 @@
+/**
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ */
+
+import React from 'react';
+import {ExternalLink} from './ExternalLink';
+
+// TODO: Unify with the old site settings.
+// Turning this off also requires changing the Page top value to pull up the sidebar.
+const bannerText = 'Support Ukraine 🇺🇦';
+const bannerLink = 'https://opensource.fb.com/support-ukraine';
+const bannerLinkText = 'Help Provide Humanitarian Aid to Ukraine.';
+
+export default function SocialBanner() {
+ return (
+
+ {bannerText}
+
+ {bannerLinkText}
+
+
+ );
+}
diff --git a/src/components/LayoutHeader/Header.js b/src/components/LayoutHeader/Header.js
index 82fa2c888..64573ba06 100644
--- a/src/components/LayoutHeader/Header.js
+++ b/src/components/LayoutHeader/Header.js
@@ -5,7 +5,8 @@
* @flow
*/
-import Banner from 'components/Banner';
+import SurveyBanner from 'components/SurveyBanner';
+import SocialBanner from 'components/SocialBanner';
import Container from 'components/Container';
import HeaderLink from './HeaderLink';
import {Link} from 'gatsby';
@@ -46,7 +47,8 @@ const Header = ({location}: {location: Location}) => (
-
+
+
diff --git a/src/components/MarkdownHeader/MarkdownHeader.js b/src/components/MarkdownHeader/MarkdownHeader.js
index 0ddc20cc8..1c6840053 100644
--- a/src/components/MarkdownHeader/MarkdownHeader.js
+++ b/src/components/MarkdownHeader/MarkdownHeader.js
@@ -17,19 +17,23 @@ const MarkdownHeader = ({title}: {title: string}) => {
css={{
color: colors.dark,
marginBottom: 0,
- marginTop: 'calc(40px + var(--banner-height-normal))',
+ marginTop:
+ 'calc(40px + var(--survey-banner-height-normal) + var(--social-banner-height-normal))',
...fonts.header,
[media.lessThan('small')]: {
- marginTop: 'calc(40px + var(--banner-height-small))',
+ marginTop:
+ 'calc(40px + var(--survey-banner-height-small) + var(--social-banner-height-small))',
},
[media.size('medium')]: {
- marginTop: 'calc(60px + var(--banner-height-normal))',
+ marginTop:
+ 'calc(60px + var(--survey-banner-height-normal) + var(--social-banner-height-normal))',
},
[media.greaterThan('large')]: {
- marginTop: 'calc(80px + var(--banner-height-normal))',
+ marginTop:
+ 'calc(80px + var(--survey-banner-height-normal) + var(--social-banner-height-normal))',
},
}}>
{title}
diff --git a/src/components/MarkdownPage/MarkdownPage.js b/src/components/MarkdownPage/MarkdownPage.js
index e297284c5..567674216 100644
--- a/src/components/MarkdownPage/MarkdownPage.js
+++ b/src/components/MarkdownPage/MarkdownPage.js
@@ -75,9 +75,11 @@ const MarkdownPage = ({
position: 'relative',
zIndex: 0,
'& h1, & h2, & h3, & h4, & h5, & h6': {
- scrollMarginTop: 'var(--banner-height-normal)',
+ scrollMarginTop:
+ 'calc(var(--survey-banner-height-normal) + var(--social-banner-height-normal))',
[media.lessThan('small')]: {
- scrollMarginTop: 'var(--banner-height-small)',
+ scrollMarginTop:
+ 'calc(var(--survey-banner-height-small) + var(--social-banner-height-small))',
},
},
}}>
diff --git a/src/components/SocialBanner/SocialBanner.js b/src/components/SocialBanner/SocialBanner.js
new file mode 100644
index 000000000..9b3b5e315
--- /dev/null
+++ b/src/components/SocialBanner/SocialBanner.js
@@ -0,0 +1,77 @@
+/**
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * @emails react-core
+ * @flow
+ */
+
+// $FlowFixMe Update Flow
+import React from 'react';
+import {colors, fonts, media} from 'theme';
+import ExternalLinkSvg from 'templates/components/ExternalLinkSvg';
+
+const linkProps = {
+ href: 'https://opensource.fb.com/support-ukraine',
+ target: '_blank',
+ rel: 'noopener',
+};
+
+const bannerText = 'Support Ukraine 🇺🇦 ';
+const bannerLink = 'Help Provide Humanitarian Aid to Ukraine.';
+
+export default function SocialBanner() {
+ return (
+
+ );
+}
diff --git a/src/components/Banner/index.js b/src/components/SocialBanner/index.js
similarity index 54%
rename from src/components/Banner/index.js
rename to src/components/SocialBanner/index.js
index 3e286dd74..f1cb9778c 100644
--- a/src/components/Banner/index.js
+++ b/src/components/SocialBanner/index.js
@@ -4,6 +4,6 @@
* @emails react-core
*/
-import Banner from './Banner';
+import SocialBanner from './SocialBanner';
-export default Banner;
+export default SocialBanner;
diff --git a/src/components/StickyResponsiveSidebar/StickyResponsiveSidebar.js b/src/components/StickyResponsiveSidebar/StickyResponsiveSidebar.js
index 93cea504d..8fe306462 100644
--- a/src/components/StickyResponsiveSidebar/StickyResponsiveSidebar.js
+++ b/src/components/StickyResponsiveSidebar/StickyResponsiveSidebar.js
@@ -43,7 +43,8 @@ class StickyResponsiveSidebar extends Component
{
render() {
const {open} = this.state;
const smallScreenSidebarStyles = {
- top: 'var(--banner-height-small)',
+ top:
+ 'calc(var(--survey-banner-height-small) + var(--social-banner-height-small))',
left: 0,
bottom: 0,
right: 0,
@@ -117,18 +118,21 @@ class StickyResponsiveSidebar extends Component {
transition: 'transform 0.5s ease',
}}
css={{
- marginTop: 'calc(60px + var(--banner-height-normal))',
+ marginTop:
+ 'calc(60px + var(--survey-banner-height-normal) + var(--social-banner-height-normal))',
[media.size('xsmall')]: {
marginTop: 40,
},
[media.between('small', 'medium')]: {
- marginTop: 'calc(20px + var(--banner-height-normal))',
+ marginTop:
+ 'calc(20px + var(--survey-banner-height-normal) + var(--social-banner-height-normal))',
},
[media.between('medium', 'large')]: {
- marginTop: 'calc(50px + var(--banner-height-normal))',
+ marginTop:
+ 'calc(50px + var(--survey-banner-height-normal) + var(--social-banner-height-normal))',
},
[media.greaterThan('small')]: {
diff --git a/src/components/Banner/Banner.js b/src/components/SurveyBanner/SurveyBanner.js
similarity index 96%
rename from src/components/Banner/Banner.js
rename to src/components/SurveyBanner/SurveyBanner.js
index 1b2cce6ee..ee871afad 100644
--- a/src/components/Banner/Banner.js
+++ b/src/components/SurveyBanner/SurveyBanner.js
@@ -16,18 +16,18 @@ const linkProps = {
rel: 'noopener',
};
-export default function Banner() {
+export default function SurveyBanner() {
return (
@@ -167,7 +167,7 @@ export default function Banner() {
}}
onClick={() => {
// See html.js
- window.__dismissBanner();
+ window.__dismissSurveyBanner();
}}>