You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by di...@apache.org on 2022/05/05 16:01:32 UTC

[superset] 02/04: add dedicated mobile collapse button

This is an automated email from the ASF dual-hosted git repository.

diegopucci pushed a commit to branch mobile-friendly-dash
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 5fc9b39f91f92d2cbcbf0212d8302b6f2fb82da3
Author: Ville Brofeldt <vi...@gmail.com>
AuthorDate: Thu May 5 11:20:56 2022 +0300

    add dedicated mobile collapse button
---
 .../nativeFilters/FilterBar/Header/index.tsx       | 29 ++++++++++++++++------
 1 file changed, 21 insertions(+), 8 deletions(-)

diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Header/index.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Header/index.tsx
index 99cc8f2960..92bb1a4c43 100644
--- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Header/index.tsx
+++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Header/index.tsx
@@ -39,20 +39,32 @@ const TitleArea = styled.h4`
   }
 `;
 
-const HeaderButton = styled(Button)`
-  padding: 0;
-  @media (max-width: 767px) {
+const MobileCollapse = styled(Icons.DownOutlined)`
+  @media (min-width: 768px) {
+    .ant-btn > .anticon + span {
+      margin: 0;
+    }
     svg {
       display: none;
     }
-    &::after {
-      content: '\\2715';
-      width: ${({ theme }) => theme.gridUnit * 6}px;
-      height: ${({ theme }) => theme.gridUnit * 6}px;
+  }
+`;
+
+const Collapse = styled(Icons.Expand)`
+  @media (max-width: 767px) {
+    .ant-btn > .anticon + span {
+      margin: 0;
+    }
+    svg {
+      display: none;
     }
   }
 `;
 
+const HeaderButton = styled(Button)`
+  padding: 0;
+`;
+
 const Wrapper = styled.div`
   padding: ${({ theme }) => theme.gridUnit}px
     ${({ theme }) => theme.gridUnit * 2}px;
@@ -106,7 +118,8 @@ const Header: FC<HeaderProps> = ({ toggleFiltersBar }) => {
           buttonSize="xsmall"
           onClick={() => toggleFiltersBar(false)}
         >
-          <Icons.Expand iconColor={theme.colors.grayscale.base} />
+          <Collapse iconColor={theme.colors.grayscale.base} />
+          <MobileCollapse iconSize="l" />
         </HeaderButton>
       </TitleArea>
       {canEdit && (