add banner to theme palette

This commit is contained in:
Twisha Saraiya
2020-07-15 12:27:45 +05:30
parent 56d4c6a83e
commit b6c2e8173b
5 changed files with 23 additions and 21 deletions
@@ -89,7 +89,7 @@ export const WithLink = () => (
message={
<Typography>
This is a dismissable banner with a link:{' '}
<Link href="http://example.com" color="textSecondary">
<Link href="http://example.com" color="textPrimary">
example.com
</Link>
</Typography>
@@ -18,13 +18,14 @@ import React, { FC, ReactNode, useState, useEffect } from 'react';
import { useApi, storageApiRef } from '@backstage/core-api';
import { useObservable } from 'react-use';
import classNames from 'classnames';
import { makeStyles, Theme } from '@material-ui/core';
import { makeStyles } from '@material-ui/core';
import { BackstageTheme } from '@backstage/theme';
import Snackbar from '@material-ui/core/Snackbar';
import SnackbarContent from '@material-ui/core/SnackbarContent';
import IconButton from '@material-ui/core/IconButton';
import Close from '@material-ui/icons/Close';
const useStyles = makeStyles((theme: Theme) => ({
const useStyles = makeStyles((theme: BackstageTheme) => ({
root: {
position: 'relative',
padding: theme.spacing(0),
@@ -46,10 +47,10 @@ const useStyles = makeStyles((theme: Theme) => ({
alignItems: 'center',
},
info: {
backgroundColor: theme.palette.primary.main,
backgroundColor: theme.palette.banner.info,
},
error: {
backgroundColor: theme.palette.error.dark,
backgroundColor: theme.palette.banner.error,
},
}));
+12 -15
View File
@@ -15,7 +15,7 @@
*/
import { createTheme } from './baseTheme';
import { yellow } from '@material-ui/core/colors';
import { blue, yellow } from '@material-ui/core/colors';
export const lightTheme = createTheme({
palette: {
@@ -39,14 +39,11 @@ export const lightTheme = createTheme({
},
},
primary: {
main: '#2E77D0',
main: blue[500],
},
error: {
main: '#E22134',
dark: '#E22134',
},
text: {
secondary: '#000000',
banner: {
info: '#2E77D0',
error: '#E22134',
},
border: '#E6E6E6',
textContrast: '#000000',
@@ -95,14 +92,14 @@ export const darkTheme = createTheme({
},
},
primary: {
main: '#2E77D0',
main: blue[500],
},
error: {
main: '#E22134',
dark: '#E22134',
},
text: {
secondary: '#000000',
banner: {
info: '2E77D0',
error: 'E22134',
link: {
default: '#000000',
},
},
border: '#E6E6E6',
textContrast: '#FFFFFF',
+4
View File
@@ -58,6 +58,10 @@ type PaletteAdditions = {
icon: string;
background: string;
};
banner: {
info: string;
error: string;
};
};
export type BackstagePalette = Palette & PaletteAdditions;
@@ -42,7 +42,7 @@ export const WelcomeBanner = () => {
🎉
</span>
Welcome to Backstage! Take a look around and check out our{' '}
<Link href="/welcome" color="textSecondary">
<Link href="/welcome" color="textPrimary">
getting started
</Link>{' '}
page.