Skip to content

Commit

Permalink
Replace direct theme imports with MUI useTheme hook
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Campbell committed Oct 14, 2020
1 parent 0639739 commit 1e6c208
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 16 deletions.
5 changes: 2 additions & 3 deletions src/components/DirectoryInformation/DirectoryInformation.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import React from "react";
import PropTypes from "prop-types";
import { TableContainer, Table, TableRow, TableCell, Paper, makeStyles } from "@material-ui/core";
import webqueue2Theme from "../../theme";
import { TableContainer, Table, TableRow, TableCell, Paper, makeStyles, useTheme } from "@material-ui/core";

export default function DirectoryInformation({ section }) {

const theme = webqueue2Theme(false);
const theme = useTheme();
const useStyles = makeStyles((theme) => ({
headerCell: {
borderBottom: "none",
Expand Down
5 changes: 2 additions & 3 deletions src/components/EmailHeader/EmailHeader.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import React from "react";
import PropTypes from "prop-types";
import { Card, CardHeader, makeStyles } from "@material-ui/core";
import { Card, CardHeader, makeStyles, useTheme } from "@material-ui/core";
import UserAvatar from "../UserAvatar/";
import webqueue2Theme from "../../theme";

export default function EmailHeader({name, date, email}){

const theme = webqueue2Theme(false);
const theme = useTheme();
const useStyles = makeStyles({
"verticalPadding": {
paddingTop: theme.spacing(1),
Expand Down
5 changes: 2 additions & 3 deletions src/components/ItemMetadataView/ItemMetadataView.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import React from 'react';
import PropTypes from 'prop-types';
import { makeStyles, Typography } from '@material-ui/core';
import { makeStyles, Typography, useTheme } from '@material-ui/core';
import { Alert } from '@material-ui/lab';
import webqueue2Theme from "../../theme";
import EmailHeader from '../EmailHeader/EmailHeader';


export default function ItemMetadataView({item}){

const theme = webqueue2Theme(false);
const theme = useTheme();
const useStyles = makeStyles({
"verticalSpacing": {
marginTop: theme.spacing(1),
Expand Down
4 changes: 2 additions & 2 deletions src/components/ItemTableAppBar/ItemTableAppBar.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ The ItemTableAppBar is the primary toolbar for the [ItemTable](/#/Components/Ite

```jsx
import React, { useState } from "react";
import webqueue2Theme from "../../theme.js";
import { useTheme } from '@material-ui/core';

const [darkMode, setDarkMode] = useState(false);

const theme = webqueue2Theme(darkMode);
const theme = useTheme();

<ItemTableAppBar title="webqueue2" darkMode={darkMode} setDarkMode={setDarkMode} theme={theme} />
```
Expand Down
4 changes: 2 additions & 2 deletions src/components/ItemViewAppBar/ItemViewAppBar.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ The ItemViewAppBar is the primary toolbar for the [ItemView](/#/Components/ItemV
```jsx
import React, { useState } from "react";
import ItemViewAppBar from "./ItemViewAppBar";
import webqueue2Theme from "../../theme.js";
import { useTheme } from '@material-ui/core';

const theme = webqueue2Theme(false);
const theme = useTheme();

const [sidebarOpen, setSidebarOpen] = useState(false);

Expand Down
6 changes: 3 additions & 3 deletions src/components/TeamMemberCard/TeamMemberCard.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React from 'react';
import PropTypes from 'prop-types'
import { Card, CardHeader, Avatar, IconButton, CardContent,
CardActions, Link, makeStyles } from '@material-ui/core';
CardActions, Link, makeStyles, useTheme } from '@material-ui/core';
import WebsiteIcon from '@material-ui/icons/Language';
import webqueue2Theme from "../../theme";


export default function TeamMemberCard({firstName, lastName, imageUrl, websiteUrl, children}){

const theme = webqueue2Theme();
const theme = useTheme();

const useStyles = () => makeStyles({
"avatarImageLarge": {
Expand Down

0 comments on commit 1e6c208

Please sign in to comment.