From 209431c6f654f536f42b3664d38d6465e53824a0 Mon Sep 17 00:00:00 2001 From: Sam Winslow Date: Thu, 6 May 2021 21:13:25 -0400 Subject: [PATCH] Horizontal UI mobile tweaks (#4245) Co-authored-by: Paolo D'Amico --- .../lib/components/CompareFilter/CompareFilter.tsx | 2 +- .../insights/InsightTabs/InsightDisplayConfig.tsx | 6 ++++-- .../InsightTabs/TrendTab/TrendTabHorizontal.tsx | 7 +++++-- frontend/src/scenes/insights/Insights.scss | 13 +++++++++++++ 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/frontend/src/lib/components/CompareFilter/CompareFilter.tsx b/frontend/src/lib/components/CompareFilter/CompareFilter.tsx index abf88c6d2a2..6fe35039d34 100644 --- a/frontend/src/lib/components/CompareFilter/CompareFilter.tsx +++ b/frontend/src/lib/components/CompareFilter/CompareFilter.tsx @@ -15,7 +15,7 @@ export function CompareFilter(): JSX.Element { style={{ marginLeft: 8, marginRight: 6 }} disabled={disabled} > - Compare previous + Compare previous ) } diff --git a/frontend/src/scenes/insights/InsightTabs/InsightDisplayConfig.tsx b/frontend/src/scenes/insights/InsightTabs/InsightDisplayConfig.tsx index cb2b88656fd..36606be386f 100644 --- a/frontend/src/scenes/insights/InsightTabs/InsightDisplayConfig.tsx +++ b/frontend/src/scenes/insights/InsightTabs/InsightDisplayConfig.tsx @@ -140,8 +140,10 @@ function HorizontalDefaultInsightDisplayConfig({ const dateFilterDisabled = activeView === ViewType.FUNNELS && isFunnelEmpty(allFilters) return ( -
- +
+ + +
{showComparePrevious[activeView] && } {showChartFilter(activeView, featureFlags) && ( diff --git a/frontend/src/scenes/insights/InsightTabs/TrendTab/TrendTabHorizontal.tsx b/frontend/src/scenes/insights/InsightTabs/TrendTab/TrendTabHorizontal.tsx index 507bee35d51..717a244fd82 100644 --- a/frontend/src/scenes/insights/InsightTabs/TrendTab/TrendTabHorizontal.tsx +++ b/frontend/src/scenes/insights/InsightTabs/TrendTab/TrendTabHorizontal.tsx @@ -16,6 +16,7 @@ import { preflightLogic } from 'scenes/PreflightCheck/logic' import './TrendTab.scss' import { SaveToDashboard } from 'lib/components/SaveToDashboard/SaveToDashboard' import { TrendTabProps } from './TrendTab' +import useBreakpoint from 'antd/lib/grid/hooks/useBreakpoint' export function TrendTabHorizontal({ view, annotationsToCreate }: TrendTabProps): JSX.Element { const { filters, filtersLoading } = useValues(trendsLogic({ dashboardItemId: null, view })) @@ -30,11 +31,13 @@ export function TrendTabHorizontal({ view, annotationsToCreate }: TrendTabProps) { name: 'returning', tooltip: 'Users who consistently use the product.' }, { name: 'dormant', tooltip: 'Users who are inactive.' }, ] + const screens = useBreakpoint() + const isSmallScreen = screens.xs || (screens.sm && !screens.md) return ( <> - +

Unsaved query{' '} )} - + {filters.insight === ViewType.LIFECYCLE && ( <>

Lifecycle Toggles

diff --git a/frontend/src/scenes/insights/Insights.scss b/frontend/src/scenes/insights/Insights.scss index b4c16dcdbf0..111fabf2948 100644 --- a/frontend/src/scenes/insights/Insights.scss +++ b/frontend/src/scenes/insights/Insights.scss @@ -59,10 +59,23 @@ border: 1px solid $border_light; padding-right: $default_spacing / 4; + @media screen and (max-width: $md) { + padding-left: $default_spacing / 4; + } + .ant-card-head-title { padding: $default_spacing / 2 0; } } + + .display-config-inner { + display: flex; + align-items: center; + + @media screen and (max-width: $md) { + overflow-x: auto; + } + } } } }