diff --git a/docs/src/components/banner/AppFrameBanner.tsx b/docs/src/components/banner/AppFrameBanner.tsx index 90baa060d7f2b2..e9c9d7a2292c9a 100644 --- a/docs/src/components/banner/AppFrameBanner.tsx +++ b/docs/src/components/banner/AppFrameBanner.tsx @@ -5,6 +5,15 @@ import FEATURE_TOGGLE from 'docs/src/featureToggle'; import PageContext from 'docs/src/modules/components/PageContext'; import { convertProductIdToName } from 'docs/src/modules/components/AppSearch'; +const showSurveyMessage = false; + +function isBlackFriday() { + const today = Date.now(); + const start = new Date('2024-11-25').getTime(); + const end = new Date('2024-12-07T23:59:59Z').getTime(); + return today > start && today < end; +} + export default function AppFrameBanner() { if (!FEATURE_TOGGLE.enable_docsnav_banner) { return null; @@ -14,11 +23,17 @@ export default function AppFrameBanner() { // eslint-disable-next-line react-hooks/rules-of-hooks -- FEATURE_TOGGLE never changes const pageContext = React.useContext(PageContext); const productName = convertProductIdToName(pageContext) || 'MUI'; - const surveyMessage = `Influence ${productName}'s 2024 roadmap! Participate in the latest Developer Survey`; - const blackFridayMessage = `Black Friday is here! Don't miss out on the best offers of the year.`; - const showSurveyMessage = false; - const message = showSurveyMessage ? surveyMessage : blackFridayMessage; + let message = ''; + let href = ''; + + if (showSurveyMessage) { + message = `Influence ${productName}'s 2024 roadmap! Participate in the latest Developer Survey`; + href = 'https://tally.so/r/3Ex4PN?source=website'; + } else if (isBlackFriday()) { + message = `Black Friday is here! Don't miss out on the best offers of the year.`; + href = 'https://mui.com/store/bundles/?deal=black-friday&from=docs'; + } if (process.env.NODE_ENV !== 'production') { if (message.length > 100) { @@ -28,18 +43,18 @@ export default function AppFrameBanner() { } } + if (message === '' || href === '') { + return null; + } + return ( ({ - padding: theme.spacing('7px', 1.5, '8px', 1.5), + padding: theme.spacing('6px', 1.5), display: { xs: 'none', md: 'block' }, fontWeight: 'medium', textWrap: 'nowrap',