Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature-081 UI Library Migration #82

Merged
merged 2 commits into from
Nov 29, 2020
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"@fortawesome/fontawesome-svg-core": "^1.2.25",
"@fortawesome/free-brands-svg-icons": "^5.11.2",
"@fortawesome/react-fontawesome": "^0.1.6",
"@material-ui/core": "^4.11.1",
"@material-ui/icons": "^4.9.1",
"@material/react-button": "^0.10.0",
"@material/react-card": "^0.15.0",
"@material/react-chips": "^0.15.0",
Expand Down
3 changes: 2 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
content="minimum-scale=1, initial-scale=1, width=device-width"
/>
<meta name="theme-color" content="#000000" />
<!--
Expand All @@ -27,6 +27,7 @@

<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
10 changes: 9 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ import { RequestedLoginMode } from "./state-management/types/auth-types";

/** Routes & pages */
import { PageRoutesContainer } from "./pages/page-routes/page-routes";
import CssBaseline from "@material-ui/core/CssBaseline";
import { MuiThemeProvider, createMuiTheme } from "@material-ui/core/styles";


/** Locals */
import "./App.css";
Expand All @@ -20,6 +23,8 @@ interface IAppProps {
retrieveLoginAuth: () => void;
}

const theme = createMuiTheme();

class App extends Component<IAppProps> {
componentDidMount() {
this.props.retrieveLoginAuth();
Expand All @@ -28,7 +33,10 @@ class App extends Component<IAppProps> {
render() {
return (
<div className="App">
<PageRoutesContainer />
<CssBaseline />
<MuiThemeProvider theme={theme}>
<PageRoutesContainer />
</MuiThemeProvider>
</div>
);
}
Expand Down
28 changes: 21 additions & 7 deletions src/components/company/company-list-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ import { Company } from "../../data-model/company/company";
import { Application } from "../../data-model/application/application";

/** Components */
import Card, { CardPrimaryContent } from "@material/react-card";
import '@material/react-card/dist/card.css';
import List, { ListItem, ListItemText } from "@material/react-list";
import MaterialUIListItem from "@material-ui/core/ListItem";
import MaterialUIButton from "@material-ui/core/Button";
import ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction';
import Checkbox from '@material-ui/core/Checkbox';

import '@material/react-list/dist/list.css';
// mdc-chips
import { ChipSet, Chip } from '@material/react-chips';
Expand All @@ -16,6 +20,7 @@ import "@material/react-chips/dist/chips.css";
import Skeleton from 'react-loading-skeleton';

import styles from './company-list-item.module.css';
import { Typography } from "@material-ui/core";


interface ICompanyListItemProps {
Expand All @@ -25,14 +30,18 @@ interface ICompanyListItemProps {
}

const CompanyListItem = (props: ICompanyListItemProps) => {
const onClick = (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => {
const onClick = () => {
props.onClick && props.company && props.onClick(props.company.uuid);
}

return (
<Card className={styles.companyCard} onClick={onClick}>
<CardPrimaryContent className={styles.companyCardContent}>
<h1>{props.company ? props.company.name : <Skeleton duration={1.1} width={`50vmin`} />}</h1>
<MaterialUIListItem className={false ? styles.companyCard : ''}>
<div className={styles.companyCardContent}>
<MaterialUIButton onClick={onClick}>
<Typography variant="h5">
{props.company ? props.company.name : <Skeleton duration={1.1} width={`50vmin`} />}
</Typography>
</MaterialUIButton>

{props.company ? (
props.company.labels.length && props.company.labels[0].text ? (
Expand Down Expand Up @@ -63,8 +72,13 @@ const CompanyListItem = (props: ICompanyListItemProps) => {
)
}
</List>
</CardPrimaryContent>
</Card>
<ListItemSecondaryAction>
<Checkbox
edge="end"
/>
</ListItemSecondaryAction>
</div>
</MaterialUIListItem>
);
}

Expand Down
5 changes: 3 additions & 2 deletions src/pages/user-app-page/user-app-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { Application } from "../../data-model/application/application";
import MaterialIcon from "@material/react-material-icon";
// mdc react button
import "@material/react-button/dist/button.css";
import MaterialUIList from "@material-ui/core/List";
import Button from "@material/react-button";

// mdc-react input
Expand Down Expand Up @@ -161,7 +162,7 @@ class UserAppPage extends Component<IUserAppPageProps, IUserAppPageState> {
/>
</TextField>
</div>
<div>
<MaterialUIList>
{
displayingCompanies.map(
(company, index) =>
Expand All @@ -173,7 +174,7 @@ class UserAppPage extends Component<IUserAppPageProps, IUserAppPageState> {
/>
)
}
</div>
</MaterialUIList>
</TabContent>)

const groupCompanyTabs = Object.values(labelTypes).map((labelText: labelTypes, index) => {
Expand Down