diff --git a/packages/react-components/src/icons/desktop.tsx b/packages/react-components/src/icons/desktop.tsx new file mode 100644 index 0000000000..963e1c20c9 --- /dev/null +++ b/packages/react-components/src/icons/desktop.tsx @@ -0,0 +1,20 @@ +/* istanbul ignore file */ + +const desktop = ( + + + +); + +export default desktop; diff --git a/packages/react-components/src/icons/index.ts b/packages/react-components/src/icons/index.ts index e66cc29735..e5502a3019 100644 --- a/packages/react-components/src/icons/index.ts +++ b/packages/react-components/src/icons/index.ts @@ -25,6 +25,7 @@ export { default as crossInCircleIcon } from './cross-in-circle'; export { default as crossSmallIcon } from './cross-small'; export { default as dashboardIcon } from './dashboard'; export { default as dataset } from './dataset'; +export { default as deskTopIcon } from './desktop'; export { default as discoverIcon } from './discover'; export { default as docsIcon } from './docs'; export { default as dropdownChevronIcon } from './dropdown-chevron'; diff --git a/packages/react-components/src/templates/AnalyticsMobilePage.tsx b/packages/react-components/src/templates/AnalyticsMobilePage.tsx new file mode 100644 index 0000000000..24ff4a9bb8 --- /dev/null +++ b/packages/react-components/src/templates/AnalyticsMobilePage.tsx @@ -0,0 +1,29 @@ +import { css } from '@emotion/react'; + +import { Paragraph } from '../atoms'; +import { rem } from '../pixels'; +import { deskTopIcon } from '../icons'; + +const containerStyles = css({ + padding: `30vh ${rem(24)} 0`, + textAlign: 'center', +}); + +const headlineStyles = css({ + fontSize: '26px', + margin: '16px 0', +}); +const AnalyticsMobilePage: React.FC = () => ( +
+
{deskTopIcon}
+

+ Analytics are only available on the desktop version. +

+ + To access all analytics features, please use the desktop version. We + apologize for any inconvenience this may cause. + +
+); + +export default AnalyticsMobilePage; diff --git a/packages/react-components/src/templates/AnalyticsPage.tsx b/packages/react-components/src/templates/AnalyticsPage.tsx index 90eb5e566c..fe7ff0580a 100644 --- a/packages/react-components/src/templates/AnalyticsPage.tsx +++ b/packages/react-components/src/templates/AnalyticsPage.tsx @@ -2,18 +2,36 @@ import { ComponentProps } from 'react'; import { css } from '@emotion/react'; import AnalyticsPageHeader from './AnalyticsPageHeader'; +import AnalyticsMobilePage from './AnalyticsMobilePage'; import { defaultPageLayoutPaddingStyle } from '../layout'; +import { mobileScreen } from '../pixels'; const mainStyles = css({ padding: defaultPageLayoutPaddingStyle, }); +const pageMobileStyles = css({ + [`@media (min-width: ${mobileScreen.max}px)`]: { + display: 'none', + }, +}); +const pageDesktopStyles = css({ + [`@media (max-width: ${mobileScreen.max}px)`]: { + display: 'none', + }, +}); + type AnalyticsPageProps = ComponentProps; const AnalyticsPage: React.FC = ({ children }) => (
- -
{children}
+
+ +
{children}
+
+
+ +
); diff --git a/packages/react-components/src/templates/__tests__/AnalyticsMobilePage.test.tsx b/packages/react-components/src/templates/__tests__/AnalyticsMobilePage.test.tsx new file mode 100644 index 0000000000..ab8dfde81b --- /dev/null +++ b/packages/react-components/src/templates/__tests__/AnalyticsMobilePage.test.tsx @@ -0,0 +1,10 @@ +import { render, screen } from '@testing-library/react'; + +import AnalyticsMobilePage from '../AnalyticsMobilePage'; + +it('renders the page', () => { + render(); + expect( + screen.getByText(/Analytics are only available/, { selector: 'h3' }), + ).toBeVisible(); +});