Skip to content

Commit

Permalink
[survey] Remove survey promotion items (#30122)
Browse files Browse the repository at this point in the history
  • Loading branch information
danilo-leal authored Dec 14, 2021
1 parent 5bad7df commit 95eac12
Show file tree
Hide file tree
Showing 14 changed files with 89 additions and 89 deletions.
5 changes: 0 additions & 5 deletions docs/notifications.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,5 @@
{
"id": 53,
"text": "You can <a style=\"color: inherit;\" target=\"_blank\" rel=\"noopener\" href=\"https://twitter.com/MaterialUI\">follow us on Twitter</a> to receive exclusive tips and updates about MUI and the React ecosystem."
},
{
"id": 55,
"title": "2021 MUI developer survey",
"text": "Help shape the future of MUI! 🚀<br />Please take a few minutes to complete the <a style=\"color: inherit;\" target=\"_blank\" rel=\"noopener\" href=\"https://mui-org.typeform.com/2021-dev-survey\">2021 MUI developer survey</a>."
}
]
4 changes: 2 additions & 2 deletions docs/pages/about.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import ForumRoundedIcon from '@mui/icons-material/ForumRounded';
import PeopleRoundedIcon from '@mui/icons-material/PeopleRounded';
import LocalAtmRoundedIcon from '@mui/icons-material/LocalAtmRounded';
import BrandingProvider from 'docs/src/BrandingProvider';
import SurveyBanner from 'docs/src/components/home/SurveyBanner';
import AppHeaderBanner from 'docs/src/components/banner/AppHeaderBanner';

interface Profile {
/**
Expand Down Expand Up @@ -745,7 +745,7 @@ export default function About() {
title="About us - MUI"
description="MUI (formerly Material-UI) started back in 2014 to unify React and Material Design. Today, MUI has grown to become one of the world's most popular React libraries – used by a vibrant community of more than 2M developers in over 180 countries."
/>
<SurveyBanner />
<AppHeaderBanner />
<AppHeader />
<main>
<AboutContent />
Expand Down
2 changes: 2 additions & 0 deletions docs/pages/careers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import MuiAccordion from '@mui/material/Accordion';
import MuiAccordionSummary from '@mui/material/AccordionSummary';
import MuiAccordionDetail from '@mui/material/AccordionDetails';
import ROUTES from 'docs/src/route';
import AppHeaderBanner from 'docs/src/components/banner/AppHeaderBanner';

interface RoleProps {
description: string;
Expand Down Expand Up @@ -529,6 +530,7 @@ export default function Careers() {
title="Careers - MUI"
description="MUI (formerly Material-UI) started back in 2014 to unify React and Material Design. Today, MUI has grown to become one of the world's most popular React libraries – used by a vibrant community of more than 2M developers in over 180 countries."
/>
<AppHeaderBanner />
<AppHeader />
<main>
<CareersContent />
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/core.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import CoreStyling from 'docs/src/components/productCore/CoreStyling';
import CoreHeroEnd from 'docs/src/components/productCore/CoreHeroEnd';
import References, { CORE_CUSTOMERS } from 'docs/src/components/home/References';
import AppFooter from 'docs/src/layouts/AppFooter';
import SurveyBanner from 'docs/src/components/home/SurveyBanner';
import AppHeaderBanner from 'docs/src/components/banner/AppHeaderBanner';

export default function Home() {
return (
Expand All @@ -21,7 +21,7 @@ export default function Home() {
card="/static/social-previews/core-preview.jpg"
/>
<CssBaseline />
<SurveyBanner />
<AppHeaderBanner />
<AppHeader />
<main>
<CoreHero />
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/design-kits.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Testimonials from 'docs/src/components/home/Testimonials';
import HeroEnd from 'docs/src/components/home/HeroEnd';
import BrandingProvider from 'docs/src/BrandingProvider';
import References, { DESIGNKITS_CUSTOMERS } from 'docs/src/components/home/References';
import SurveyBanner from 'docs/src/components/home/SurveyBanner';
import AppHeaderBanner from 'docs/src/components/banner/AppHeaderBanner';

export default function DesignKits() {
return (
Expand All @@ -21,7 +21,7 @@ export default function DesignKits() {
description="Pick your favorite design tool to enjoy and use MUI components. Boost consistency and facilitate communication when working with developers."
card="/static/social-previews/designkits-preview.jpg"
/>
<SurveyBanner />
<AppHeaderBanner />
<AppHeader />
<main>
<DesignKitHero />
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import * as React from 'react';
import Head from 'docs/src/modules/components/Head';
import NoSsr from '@mui/material/NoSsr';
import Divider from '@mui/material/Divider';
import SurveyBanner from 'docs/src/components/home/SurveyBanner';
import AppHeader from 'docs/src/layouts/AppHeader';
import Hero from 'docs/src/components/home/Hero';
import References, { CORE_CUSTOMERS } from 'docs/src/components/home/References';
Expand All @@ -15,6 +14,7 @@ import HeroEnd from 'docs/src/components/home/HeroEnd';
import AppFooter from 'docs/src/layouts/AppFooter';
import BrandingProvider from 'docs/src/BrandingProvider';
import NewsletterToast from 'docs/src/components/home/NewsletterToast';
import AppHeaderBanner from 'docs/src/components/banner/AppHeaderBanner';

export default function Home() {
return (
Expand All @@ -26,7 +26,7 @@ export default function Home() {
<NoSsr>
<NewsletterToast />
</NoSsr>
<SurveyBanner />
<AppHeaderBanner />
<AppHeader />
<main>
<Hero />
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/pricing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import FAQ from 'docs/src/components/pricing/FAQ';
import HeroEnd from 'docs/src/components/home/HeroEnd';
import AppFooter from 'docs/src/layouts/AppFooter';
import BrandingProvider from 'docs/src/BrandingProvider';
import SurveyBanner from 'docs/src/components/home/SurveyBanner';
import AppHeaderBanner from 'docs/src/components/banner/AppHeaderBanner';

export default function Pricing() {
return (
Expand All @@ -22,7 +22,7 @@ export default function Pricing() {
title="Pricing - MUI"
description="The community edition lets you get going right away. Switch to a commercial plan for more components & professional support."
/>
<SurveyBanner />
<AppHeaderBanner />
<AppHeader />
<main>
<HeroPricing />
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/templates.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Testimonials from 'docs/src/components/home/Testimonials';
import HeroEnd from 'docs/src/components/home/HeroEnd';
import BrandingProvider from 'docs/src/BrandingProvider';
import References, { TEMPLATES_CUSTOMERS } from 'docs/src/components/home/References';
import SurveyBanner from 'docs/src/components/home/SurveyBanner';
import AppHeaderBanner from 'docs/src/components/banner/AppHeaderBanner';

export default function Templates() {
return (
Expand All @@ -20,7 +20,7 @@ export default function Templates() {
description="A collection of 4.5 average rating templates, selected and curated by MUI's team of maintainers to get your projects up and running today."
card="/static/social-previews/templates-preview.jpg"
/>
<SurveyBanner />
<AppHeaderBanner />
<AppHeader />
<main>
<TemplateHero />
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/x.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import XRoadmap from 'docs/src/components/productX/XRoadmap';
import References, { ADVANCED_CUSTOMERS } from 'docs/src/components/home/References';
import AppFooter from 'docs/src/layouts/AppFooter';
import XPlans from 'docs/src/components/productX/XPlans';
import SurveyBanner from 'docs/src/components/home/SurveyBanner';
import AppHeaderBanner from 'docs/src/components/banner/AppHeaderBanner';

export default function Home() {
return (
Expand All @@ -22,7 +22,7 @@ export default function Home() {
card="/static/social-previews/x-preview.jpg"
/>
<CssBaseline />
<SurveyBanner />
<AppHeaderBanner />
<AppHeader />
<main>
<XHero />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import Box from '@mui/material/Box';
import Typography from '@mui/material/Typography';
import Link from 'docs/src/modules/components/Link';
import ROUTES from 'docs/src/route';
import FEATURE_TOGGLE from 'docs/src/featureToggle';

export default function SurveyBanner() {
return (
export default function AppHeaderBanner() {
return FEATURE_TOGGLE.enable_website_banner ? (
<Box
sx={{
p: 1.5,
Expand All @@ -25,19 +26,18 @@ export default function SurveyBanner() {
color: '#fff',
}}
>
Help shape the future of MUI! &nbsp;🚀 &nbsp;&nbsp;&nbsp;Please take a few minutes to
complete the{' '}
Fix me! &nbsp;
<Link
href={ROUTES.survey2021Website}
href={ROUTES.home} // Fix me!
target="_blank"
data-ga-event-category="survey-2021"
data-ga-event-category="$event-category" // Fix me!
data-ga-event-action="click"
data-ga-event-label="header"
sx={{ color: '#fff', textDecoration: 'underline' }}
>
2021 MUI developer survey &#8594;
Fix me!
</Link>
</Typography>
</Box>
);
) : null;
}
61 changes: 61 additions & 0 deletions docs/src/components/banner/TableOfContentsBanner.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import * as React from 'react';
import Typography from '@mui/material/Typography';
import Link from 'docs/src/modules/components/Link';
import ROUTES from 'docs/src/route';
import FEATURE_TOGGLE from 'docs/src/featureToggle';

export default function TableOfContentsBanner() {
return FEATURE_TOGGLE.enable_website_banner ? (
<Link
href={ROUTES.home} // Fix me!
target="_blank"
data-ga-event-category="$event-category" // Fix me!
data-ga-event-action="click"
data-ga-event-label="table-contents"
sx={(theme) => ({
mb: 2,
p: 1,
display: 'flex',
flexDirection: 'column',
alignItems: 'start',
background:
theme.palette.mode === 'dark'
? `linear-gradient(90deg, ${theme.palette.primary[900]}, ${theme.palette.primary[600]} 120%)`
: `linear-gradient(-90deg, ${theme.palette.primary[700]}, ${theme.palette.primary[500]} 120%)`,
borderRadius: 1,
transitionProperty: 'all',
transitionTiming: 'cubic-bezier(0.4, 0, 0.2, 1)',
transitionDuration: '200ms',
'&:hover, &:focus-visible': {
boxShadow:
theme.palette.mode === 'dark'
? '1px 1px 20px 0 rgb(2 2 2 / 50%)'
: '1px 1px 20px 0 rgb(90 105 120 / 30%)',
},
})}
>
<Typography component="span" variant="body1" fontWeight="bold" sx={{ color: '#fff' }}>
Fix me!
<br />
</Typography>
<Typography component="span" variant="body2" fontWeight="medium" sx={{ color: 'primary.50' }}>
Fix me!
<br />
</Typography>
<Typography
component="span"
variant="caption"
fontWeight="normal"
sx={{
mt: 1,
pt: 1,
color: 'primary.50',
borderTop: 1,
borderColor: 'primary.400',
}}
>
Fix me!
</Typography>
</Link>
) : null;
}
1 change: 1 addition & 0 deletions docs/src/featureToggle.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const FEATURE_TOGGLE = {
nav_products: true,
enable_website_banner: false,
};

export default FEATURE_TOGGLE;
63 changes: 3 additions & 60 deletions docs/src/modules/components/AppTableOfContents.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import PropTypes from 'prop-types';
import throttle from 'lodash/throttle';
import { styled, alpha } from '@mui/material/styles';
import Typography from '@mui/material/Typography';
import NoSsr from '@mui/material/NoSsr';
import Link from 'docs/src/modules/components/Link';
import PageContext from 'docs/src/modules/components/PageContext';
import { useTranslate } from 'docs/src/modules/utils/i18n';
import NoSsr from '@mui/material/NoSsr';
import ROUTES from 'docs/src/route';
import TableOfContentsBanner from 'docs/src/components/banner/TableOfContentsBanner';

const Nav = styled('nav')(({ theme }) => {
return {
Expand Down Expand Up @@ -211,64 +211,7 @@ export default function AppTableOfContents(props) {
return (
<Nav aria-label={t('pageTOC')}>
<NoSsr>
<Link
href={ROUTES.survey2021Docs}
target="_blank"
data-ga-event-category="survey-2021"
data-ga-event-action="click"
data-ga-event-label="table-contents"
sx={(theme) => ({
mb: 2,
p: 1,
display: 'flex',
flexDirection: 'column',
alignItems: 'start',
background:
theme.palette.mode === 'dark'
? `linear-gradient(90deg, ${theme.palette.primary[900]}, ${theme.palette.primary[600]} 120%)`
: `linear-gradient(-90deg, ${theme.palette.primary[700]}, ${theme.palette.primary[500]} 120%)`,
borderRadius: 1,
transitionProperty: 'all',
transitionTiming: 'cubic-bezier(0.4, 0, 0.2, 1)',
transitionDuration: '200ms',
'&:hover, &:focus-visible': {
boxShadow:
theme.palette.mode === 'dark'
? '1px 1px 20px 0 rgb(2 2 2 / 50%)'
: '1px 1px 20px 0 rgb(90 105 120 / 30%)',
},
})}
>
<Typography component="span" variant="body1" fontWeight="bold" sx={{ color: '#fff' }}>
2021 MUI&nbsp;&nbsp;🚀
<br />
</Typography>
<Typography
component="span"
variant="body2"
fontWeight="medium"
sx={{ color: 'primary.50' }}
// eslint-disable-next-line material-ui/no-hardcoded-labels
>
Developer survey
<br />
</Typography>
<Typography
component="span"
variant="caption"
fontWeight="normal"
sx={{
mt: 1,
pt: 1,
color: 'primary.50',
borderTop: 1,
borderColor: 'primary.400',
}}
// eslint-disable-next-line material-ui/no-hardcoded-labels
>
Help us shape the future of MUI! &#8594;
</Typography>
</Link>
<TableOfContentsBanner />
</NoSsr>
{toc.length > 0 ? (
<React.Fragment>
Expand Down
2 changes: 0 additions & 2 deletions docs/src/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ const ROUTES = {
storeTemplateWebbee: 'https://material-ui.com/store/items/webbee-landing-page/',
storeTheFront: 'https://material-ui.com/store/items/the-front-landing-page/',
storeFlexy: 'https://material-ui.com/store/items/flexy-react-admin-dashboard/',
survey2021Website: 'https://mui-org.typeform.com/2021-dev-survey#source=website',
survey2021Docs: 'https://mui-org.typeform.com/2021-dev-survey#source=docs',
};

export default ROUTES;

0 comments on commit 95eac12

Please sign in to comment.