From d23b2132de05f072f7f9daad83d81421d747cf99 Mon Sep 17 00:00:00 2001 From: Ryan Cohen Date: Sat, 7 Jan 2023 01:12:19 +0900 Subject: [PATCH] fix: improve small screen layout for discover editing (#3221) --- .../Discover/DiscoverSliderEdit/index.tsx | 104 +++++++++--------- src/components/Discover/index.tsx | 62 +++++------ src/components/MediaSlider/index.tsx | 4 +- 3 files changed, 81 insertions(+), 89 deletions(-) diff --git a/src/components/Discover/DiscoverSliderEdit/index.tsx b/src/components/Discover/DiscoverSliderEdit/index.tsx index 6e9bd8b76..2cd462e9a 100644 --- a/src/components/Discover/DiscoverSliderEdit/index.tsx +++ b/src/components/Discover/DiscoverSliderEdit/index.tsx @@ -183,10 +183,12 @@ const DiscoverSliderEdit = ({ className={`absolute -bottom-2 left-0 w-full border-t-4 border-indigo-500`} /> )} -
- -
{getSliderTitle(slider)}
-
+
+
+ +
{getSliderTitle(slider)}
+
+
{(slider.type === DiscoverSliderType.TMDB_MOVIE_KEYWORD || slider.type === DiscoverSliderType.TMDB_TV_KEYWORD) && (
@@ -224,55 +226,57 @@ const DiscoverSliderEdit = ({ }>{slider.data} )}
- {!slider.isBuiltIn && ( - <> - {!isEditing ? ( - - ) : ( +
+ {!slider.isBuiltIn && ( + <> + {!isEditing ? ( + + ) : ( + + )} - )} - - - )} -
- -
- { - onEnable(); - }} - checked={slider.enabled} - /> -
-
+ + )} +
+ +
+ { + onEnable(); + }} + checked={slider.enabled} + /> +
+
+
{isEditing ? ( @@ -286,11 +290,7 @@ const DiscoverSliderEdit = ({ />
) : ( -
+
{children}
)} diff --git a/src/components/Discover/index.tsx b/src/components/Discover/index.tsx index b627ab6ed..31eaa9156 100644 --- a/src/components/Discover/index.tsx +++ b/src/components/Discover/index.tsx @@ -119,44 +119,36 @@ const Discover = () => { <> {isEditing ? ( <> -
- - - - - - resetSliders()} - confirmText={intl.formatMessage( - globalMessages.areyousure - )} - > - - {intl.formatMessage(messages.resettodefault)} - - - - - + + resetSliders()} + confirmText={intl.formatMessage(globalMessages.areyousure)} > - - {intl.formatMessage(globalMessages.save)} - - + + {intl.formatMessage(messages.resettodefault)} + + +
-
+
{intl.formatMessage(messages.createnewslider)} diff --git a/src/components/MediaSlider/index.tsx b/src/components/MediaSlider/index.tsx index b0fab251a..54b5cc801 100644 --- a/src/components/MediaSlider/index.tsx +++ b/src/components/MediaSlider/index.tsx @@ -149,8 +149,8 @@ const MediaSlider = ({