From d015656944564d25aa5fa216af09ac3bfc24cfb4 Mon Sep 17 00:00:00 2001 From: Jason Frerich Date: Tue, 12 Jul 2022 13:05:35 -0500 Subject: [PATCH] [Gekidou MM-45521] Remove show results button (#6465) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * - calculate the bottom sheet height dynamically - remove show results button - set the new fitler when select a new item * when the user selects the same filter, just dismiss the bottom sheet, don't fetch the values again * Update app/screens/home/search/results/header.tsx Co-authored-by: Daniel Espino García * Use OptionItem instead of MenuItem Co-authored-by: Daniel Espino García --- app/components/option_item/index.tsx | 4 +- app/screens/bottom_sheet/content.tsx | 15 ++-- .../browse_channels/channel_dropdown.tsx | 3 +- app/screens/home/search/results/filter.tsx | 84 +++++++------------ app/screens/home/search/results/header.tsx | 26 ++++-- assets/base/i18n/en.json | 1 - 6 files changed, 64 insertions(+), 69 deletions(-) diff --git a/app/components/option_item/index.tsx b/app/components/option_item/index.tsx index 041d32629d..c68f176a02 100644 --- a/app/components/option_item/index.tsx +++ b/app/components/option_item/index.tsx @@ -34,6 +34,8 @@ const OptionType = { type OptionType = typeof OptionType[keyof typeof OptionType]; +export const ITEM_HEIGHT = 48; + const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => { return { actionContainer: { @@ -44,7 +46,7 @@ const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => { container: { flexDirection: 'row', alignItems: 'center', - minHeight: 48, + minHeight: ITEM_HEIGHT, }, destructive: { color: theme.dndIndicator, diff --git a/app/screens/bottom_sheet/content.tsx b/app/screens/bottom_sheet/content.tsx index cdaad3c275..498cb9ddb3 100644 --- a/app/screens/bottom_sheet/content.tsx +++ b/app/screens/bottom_sheet/content.tsx @@ -23,7 +23,12 @@ type Props = { titleSeparator?: boolean; } -export const TITLE_HEIGHT = 38; +const TITLE_MARGIN_TOP = 4; +const TITLE_MARGIN_BOTTOM = 12; + +export const TITLE_HEIGHT = TITLE_MARGIN_TOP + TITLE_MARGIN_BOTTOM + 30; // typography 600 line height +export const SEPARATOR_MARGIN = 12; +export const SEPARATOR_MARGIN_TABLET = 20; const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => { return { @@ -31,8 +36,8 @@ const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => { flex: 1, }, titleContainer: { - marginTop: 4, - marginBottom: 12, + marginTop: TITLE_MARGIN_TOP, + marginBottom: TITLE_MARGIN_BOTTOM, }, titleText: { color: theme.centerChannelColor, @@ -71,14 +76,14 @@ const BottomSheetContent = ({buttonText, buttonIcon, children, disableButton, on } {titleSeparator && - + } <> {children} {showButton && ( <> - +