You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/07/07 05:10:26 UTC

[GitHub] [incubator-superset] etr2460 commented on a change in pull request #10178: style: new toast design closer to SIP-34

etr2460 commented on a change in pull request #10178:
URL: https://github.com/apache/incubator-superset/pull/10178#discussion_r450613610



##########
File path: superset-frontend/src/messageToasts/components/Toast.tsx
##########
@@ -97,13 +117,17 @@ class Toast extends React.Component {
           toastType === DANGER_TOAST && 'toast--danger',
         )}
       >
-        <Interweave content={text} />
+        <ToastContianer>
+          {toastType === SUCCESS_TOAST ? (
+            <Icon name="check" />
+          ) : (
+            <Icon name="error" />
+          )}

Review comment:
       Since we have a warning icon, should we use that for the `WARNING_TOAST`s too? And perhaps add an info icon as well? If we don't add the info icon, should we perhaps default to no icon at all, since it could be confusing for an info toast to show an error icon

##########
File path: superset-frontend/src/messageToasts/components/Toast.tsx
##########
@@ -97,13 +117,17 @@ class Toast extends React.Component {
           toastType === DANGER_TOAST && 'toast--danger',

Review comment:
       Are these classes still needed? It looks like they're unused now

##########
File path: superset-frontend/src/messageToasts/components/ToastPresenter.tsx
##########
@@ -0,0 +1,96 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import React from 'react';
+import styled from '@superset-ui/style';
+import Toast from './Toast';
+
+const StyledToastPresenter = styled.div`
+  max-width: 600px;
+  position: fixed;
+  bottom: 0px;
+  right: -110px;
+  transform: translate(-50%, 0);
+  z-index: ${({ theme }) => theme.zIndex.max};
+
+  .toast {
+    background: ${({ theme }) => theme.colors.grayscale.dark1};
+    border-radius: ${({ theme }) => theme.borderRadius};
+    box-shadow: 0 2px 4px 0
+      fade(
+        ${({ theme }) => theme.colors.grayscale.dark2},
+        ${({ theme }) => theme.opacity.mediumLight}
+      );
+    color: ${({ theme }) => theme.colors.grayscale.light5};
+    opacity: 0;
+    position: relative;
+    transform: translateY(-100%);
+    white-space: pre-line;
+    will-change: transform, opacity;
+    transition: transform ${({ theme }) => theme.transitionTiming}s,
+      opacity ${({ theme }) => theme.transitionTiming}s;
+
+    &:after {
+      content: '';
+      position: absolute;
+      top: 0;
+      left: 0;
+      width: 6px;
+      height: 100%;
+    }
+  }
+
+  .toast > button {
+    color: ${({ theme }) => theme.colors.grayscale.light5};
+    opacity: 1;
+  }
+
+  .toast--visible {
+    opacity: 1;
+    transform: translateY(0);
+  }
+`;
+
+type ToastType =

Review comment:
       this is defined twice, let's pull it into a `types.ts` file




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org