Skip to content
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@material-ui/pickers": "^3.3.10",
"@material-ui/styles": "^4.11.2",
"@mozilla-frontend-infra/components": "^3.0.7",
"@mozilla-protocol/core": "^17.0.1",
"axios": "^0.24.0",
"change-case": "^4.1.2",
"classnames": "^2.2.6",
Expand Down
2 changes: 1 addition & 1 deletion ui/src/Main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function Main() {

return backendError ? (
<BrowserRouter>
<Dashboard title="Error" disabled>
<Dashboard disabled>
<ErrorPanel fixed error={backendError} />
</Dashboard>
</BrowserRouter>
Expand Down
46 changes: 36 additions & 10 deletions ui/src/components/Dashboard/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { Helmet } from 'react-helmet';
import { makeStyles } from '@material-ui/styles';
import AppBar from '@material-ui/core/AppBar';
import Toolbar from '@material-ui/core/Toolbar';
import Typography from '@material-ui/core/Typography';
import Box from '@material-ui/core/Box';
import ExtensionIcon from '@material-ui/icons/Extension';
import menuItems from './menuItems';
import Link from '../../utils/Link';
import UserMenu from './UserMenu';
Expand Down Expand Up @@ -43,8 +44,41 @@ const useStyles = makeStyles(theme => ({
buttonWithIcon: {
paddingLeft: theme.spacing(2),
},
protocolLogo: {
margin: '0px',
marginRight: '.7%',
},
extensionIcon: {
margin: '0px',
marginRight: '.5%',
},
}));

function Logo(props) {
const { group } = props;
const classes = useStyles();

if (group && group.toLowerCase().includes('firefox')) {
return (
<Box
component="div"
className={`mzp-c-logo mzp-t-logo-sm mzp-t-product-firefox ${classes.protocolLogo}`}
/>
);
}

if (group && group.toLowerCase().includes('extensions')) {
return <ExtensionIcon className={classes.extensionIcon} />;
}

return (
<Box
component="div"
className={`mzp-c-logo mzp-t-logo-sm mzp-t-product-mozilla ${classes.protocolLogo}`}
/>
);
}

export default function Dashboard(props) {
const classes = useStyles();
const { title, children, disabled } = props;
Expand All @@ -56,15 +90,7 @@ export default function Dashboard(props) {
</Helmet>
<AppBar className={classes.appbar}>
<Toolbar>
<Typography
className={classes.title}
color="inherit"
variant="h6"
noWrap
component={Link}
to="/">
Balrog Admin ┃ {title}
</Typography>
<Logo />
<nav className={classes.nav}>
{menuItems.main.map(menuItem => (
<Link
Expand Down
800 changes: 0 additions & 800 deletions ui/src/images/balrog.svg

This file was deleted.

4 changes: 3 additions & 1 deletion ui/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
<html>
<head>
<meta charset="utf-8"/>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />
<link rel="preconnect" href="https://rsms.me/">
<link rel="stylesheet" href="https://rsms.me/inter/inter.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Zilla+Slab:300,400,500,700&display=swap" />
<title>Balrog Admin</title>
</head>
<body>
Expand Down
45 changes: 25 additions & 20 deletions ui/src/theme.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createTheme } from '@material-ui/core/styles';
import { amber, red, indigo } from '@material-ui/core/colors';
import '../node_modules/@mozilla-protocol/core/protocol/css/protocol-components.css';

const SPACING = {
UNIT: 8,
Expand All @@ -11,31 +11,36 @@ const SPACING = {
export default createTheme({
palette: {
primary: {
light: '#804cc5',
main: '#4e1f94',
dark: '#160065',
main: '#000',
},
secondary: {
light: '#678dff',
main: '#0061f2',
dark: '#0038be',
main: '#c50042',
},
error: red,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these be updated? What changes when you delete these?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I delete them the theme changes to the original theme it was. for example the dashboard becomes blue when I delete the palette

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh OK I see. Can we pick similar colors from the protocol pallette?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we do have similar colours in the protocol pallette, we can pick them if they look more lively. Should I update the pallette to include those colours?

warning: {
light: amber[300],
main: amber[500],
dark: amber[700],
contrastText: 'rgba(0, 0, 0, 0.9)',
},
info: {
light: indigo[300],
main: indigo[500],
dark: indigo[700],
contrastText: 'rgba(255, 255, 255, 0.9)',
success: {
main: '#3fe1b0',
dark: '#008787',
},
},
typography: {
Copy link
Contributor

@gabrielbusta gabrielbusta Oct 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useNextVariants: true,
fontDisplay: 'swap',
fontFamily: "'Zilla Slab', 'Inter', sans-serif",
fontStyle: 'normal',
fontWeight: 'normal',
body1: {
fontFamily: "'Inter', sans-serif",
},
body2: {
fontFamily: "'Inter', sans-serif",
},
caption: {
fontFamily: "'Inter', sans-serif",
},
button: {
fontFamily: "'Inter', sans-serif",
},
overline: {
fontFamily: "'Inter', sans-serif",
},
},
mixins: {
link: {
Expand Down
10 changes: 0 additions & 10 deletions ui/src/views/Home/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,9 @@ import ListItemText from '@material-ui/core/ListItemText';
import LinkIcon from 'mdi-react/LinkIcon';
import Dashboard from '../../components/Dashboard';
import Link from '../../utils/Link';
import balrogSrc from '../../images/balrog.svg';
import { RULES_COMMON_FILTERS } from '../../utils/constants';

const useStyles = makeStyles(theme => ({
balrogImage: {
width: 800,
height: 800,
position: 'fixed',
zIndex: -1,
opacity: 0.5,
transform: 'scaleX(-1)',
},
cardPaper: {
background: 'rgba(255, 255, 255, 0.9)',
},
Expand All @@ -34,7 +25,6 @@ function Home() {

return (
<Dashboard title="Home">
<img alt="Balrog logo" className={classes.balrogImage} src={balrogSrc} />
<Card className={classes.cardPaper}>
<CardContent>
<Typography gutterBottom component="h2" variant="h5">
Expand Down
5 changes: 5 additions & 0 deletions ui/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1425,6 +1425,11 @@
eslint-plugin-react "^7.14.3"
eslint-plugin-react-hooks "^2.0.0"

"@mozilla-protocol/core@^17.0.1":
version "17.0.1"
resolved "https://registry.yarnpkg.com/@mozilla-protocol/core/-/core-17.0.1.tgz#8ae34ffbba9e686b80465d9304b207da95ea272e"
integrity sha512-xN6DNJ1P93lqrzhEHhx6J8HvIVpWDBLNOO4cqlHWH6HNPOoD/vsfygCwg6UJ+pkWBAwQLbS10xgB3Y2+kCP82Q==

"@neutrinojs/[email protected]":
version "9.5.0"
resolved "https://registry.yarnpkg.com/@neutrinojs/clean/-/clean-9.5.0.tgz#77cfb0add1584741c7501f5e12ad206b67f216bf"
Expand Down