theme toast icons and various cosmetic updates

This commit is contained in:
Maxime Beauchemin
2025-03-24 12:54:01 -07:00
parent 8ce144983d
commit 56e3d165dd
3 changed files with 27 additions and 7 deletions

View File

@@ -75,6 +75,7 @@ const ShareSqlLabQuery = ({
return (
<Button
buttonSize="small"
buttonStyle="secondary"
tooltip={tooltip}
css={css`
span > :first-of-type {

View File

@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import { styled, css, SupersetTheme } from '@superset-ui/core';
import { styled, css, SupersetTheme, useTheme } from '@superset-ui/core';
import cx from 'classnames';
import { Interweave } from 'interweave';
import { useCallback, useEffect, useRef, useState } from 'react';
@@ -84,19 +84,39 @@ export default function Toast({ toast, onCloseToast }: ToastPresenterProps) {
};
}, [handleClosePress, toast.duration]);
const theme = useTheme();
let className = 'toast--success';
let icon = (
<Icons.CheckCircleFilled css={theme => notificationStyledIcon(theme)} />
<Icons.CheckCircleFilled
css={theme => notificationStyledIcon(theme)}
iconColor={theme.colorSuccess}
/>
);
if (toast.toastType === ToastType.Warning) {
icon = <Icons.ExclamationCircleFilled css={notificationStyledIcon} />;
icon = (
<Icons.ExclamationCircleFilled
css={notificationStyledIcon}
iconColor={theme.colorWarning}
/>
);
className = 'toast--warning';
} else if (toast.toastType === ToastType.Danger) {
icon = <Icons.ExclamationCircleFilled css={notificationStyledIcon} />;
icon = (
<Icons.ExclamationCircleFilled
css={notificationStyledIcon}
iconColor={theme.colorError}
/>
);
className = 'toast--danger';
} else if (toast.toastType === ToastType.Info) {
icon = <Icons.InfoCircleFilled css={notificationStyledIcon} />;
icon = (
<Icons.InfoCircleFilled
css={notificationStyledIcon}
iconColor={theme.colorInfo}
/>
);
className = 'toast--info';
}

View File

@@ -42,8 +42,7 @@ interface MenuProps {
const StyledHeader = styled.header`
${({ theme }) => `
background-color: ${theme.colorBgElevated};
margin-bottom: 2px;
background-color: ${theme.colorBgContainer};
z-index: 10;
&:nth-last-of-type(2) nav {