Skip to content

Commit

Permalink
Style Migration (#50)
Browse files Browse the repository at this point in the history
* added support for semantic ui react

* removed support for bridge

* migrated login page to semantic ui

* replaced all bridge components with semantic, minor styling edits

* yarn format

* add husky

* yarn add husky to root

* removed css comments and fixed package.json
  • Loading branch information
alicesf2 authored Jan 28, 2021
1 parent 2524f9c commit a001e44
Show file tree
Hide file tree
Showing 14 changed files with 511 additions and 1,089 deletions.
5 changes: 3 additions & 2 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"homepage": "https://pineapple.lol/",
"license": "MIT",
"dependencies": {
"@hack4impact-uiuc/bridge": "^1.1.0",
"ag-grid-community": "^25.0.0",
"ag-grid-enterprise": "^25.0.0",
"ag-grid-react": "^25.0.0",
Expand All @@ -16,7 +15,9 @@
"react-dom": "^16.13.1",
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.3",
"react-select": "^3.2.0"
"react-select": "^3.2.0",
"semantic-ui-css": "^2.4.1",
"semantic-ui-react": "^2.0.3"
},
"devDependencies": {
"@babel/cli": "^7.6.2",
Expand Down
3 changes: 2 additions & 1 deletion client/src/components/EditableAttribute/DateAttribute.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import DatePicker from 'react-datepicker';
import { startCase } from 'lodash';
import 'react-datepicker/dist/react-datepicker.css';
import '../../css/DateAttribute.css';

Expand All @@ -17,7 +18,7 @@ const DateAttribute = ({

return (
<div className={className}>
<p>{attributeLabel}</p>
<p>{startCase(attributeLabel)}</p>
<DatePicker
className="datePicker"
onChange={onValueChange}
Expand Down
3 changes: 2 additions & 1 deletion client/src/components/EditableAttribute/EnumAttribute.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import Select from 'react-select';
import { startCase } from 'lodash';

const defaultDropdownOption = { label: '', value: '' };

Expand All @@ -24,7 +25,7 @@ const EnumAttribute = ({

return (
<div className={className}>
<p>{attributeLabel}</p>
<p>{startCase(attributeLabel)}</p>
<Select
value={getOptionFromValue(value)}
isDisabled={isDisabled}
Expand Down
7 changes: 4 additions & 3 deletions client/src/components/EditableAttribute/TextAttribute.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { TextField } from '@hack4impact-uiuc/bridge';
import { startCase } from 'lodash';
import { Form } from 'semantic-ui-react';

const TextAttribute = ({
type = 'text',
Expand All @@ -16,8 +17,8 @@ const TextAttribute = ({

return (
<div className={className}>
<p>{attributeLabel}</p>
<TextField
<p>{startCase(attributeLabel)}</p>
<Form.Input
type={type}
value={value}
onChange={onValueChange}
Expand Down
4 changes: 3 additions & 1 deletion client/src/components/table/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ const Table = () => {
useEffect(() => {
const getAllMembers = async () => {
const allMembers = await getMembers();
setMembers(allMembers.data.result);
if (allMembers.data) {
setMembers(allMembers.data.result);
}
};
getAllMembers();
}, []);
Expand Down
6 changes: 0 additions & 6 deletions client/src/css/Login.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
}

.login-btn {
background-color: #dd4b39;
color: white;
font-weight: 500;
font-family: inherit;
Expand All @@ -39,8 +38,3 @@
border-radius: 5rem;
margin: 2px 5px 2px 5px;
}

.login-btn:hover {
cursor: pointer;
background-color: #ed7465;
}
4 changes: 3 additions & 1 deletion client/src/css/Navbar.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.nav {
display: flex;
margin: 1.5rem;
}

.nav #nav-title {
Expand All @@ -16,9 +17,10 @@
.nav .profile-item {
display: flex;
align-items: center;
padding: 1rem 3rem 0rem 0rem;
margin-right: 2rem;
}

.nav .profile-item #welcome-text {
margin-top: 1rem;
margin-right: 1rem;
}
9 changes: 7 additions & 2 deletions client/src/css/Profile.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@
margin-left: 2.5%;
margin-right: 2.5%;
display: inline-block;
margin-bottom: 1rem;
}

.profile-alert {
margin-top: 30px;
margin: 3rem;
}

#submit-button {
margin: 50px auto;
margin: 3rem auto 3rem auto;
display: block;
}

.profile-form {
margin-left: 10%;
}
1 change: 0 additions & 1 deletion client/src/css/Table.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.table-wrapper {
padding-top: 1rem;
height: 85vh;
width: 95%;
margin: auto;
Expand Down
2 changes: 1 addition & 1 deletion client/src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { BrowserRouter as Router } from 'react-router-dom';
import '@hack4impact-uiuc/bridge/dist/styles.css';
import 'semantic-ui-css/semantic.min.css';

import App from './App';

Expand Down
42 changes: 24 additions & 18 deletions client/src/pages/Login.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { useLocation } from 'react-router-dom';
import { Alert, Icon } from '@hack4impact-uiuc/bridge';
import { Button, Header, Icon, Image, Message } from 'semantic-ui-react';

import googleIcon from '../assets/google-logo.png';
import '../css/Login.css';
Expand All @@ -9,7 +9,7 @@ import buildURI from '../utils/apiHelpers';

const LOGIN_FAILURE_QUERY_PARAM = 'failure';
const LOGIN_FAILURE_TEXT =
'First time logging in? Your email isn&apos;t verified. Please contact an admin.';
"First time logging in? Your email isn't verified. Please contact an admin.";

// A custom hook that builds on useLocation to parse
// the query string for you.
Expand All @@ -28,23 +28,29 @@ const Login = () => {
<div className="login-card">
<h2>Member Database Login</h2>
{didLoginFail && (
<Alert variant="error" mb="8px">
<Icon type="errorAlert" />
{LOGIN_FAILURE_TEXT}
</Alert>
<Message color="red">
<Header as="h4">
<Icon name="warning circle" />
<Header.Content>Login Failed!</Header.Content>
</Header>
<Message.Content>{LOGIN_FAILURE_TEXT}</Message.Content>
</Message>
)}
<a
type="button"
href={buildURI(
'auth/login',
FRONTEND_BASE_URL,
`${FRONTEND_BASE_URL}/login?${LOGIN_FAILURE_QUERY_PARAM}=1`,
)}
className="login-btn"
>
<img className="google-icon" src={googleIcon} alt="Google Icon" />
Sign in with Google
</a>
<Button className="login-btn" color="orange">
<a
href={buildURI(
'auth/login',
FRONTEND_BASE_URL,
`${FRONTEND_BASE_URL}/login?${LOGIN_FAILURE_QUERY_PARAM}=1`,
)}
>
<Header as="h5">
<Image circular src={googleIcon} /> Sign in with Google
</Header>
{/* <img className="google-icon" src={googleIcon} alt="Google Icon" />
Sign in with Google */}
</a>
</Button>
</div>
</div>
);
Expand Down
Loading

1 comment on commit a001e44

@vercel
Copy link

@vercel vercel bot commented on a001e44 Jan 28, 2021

Choose a reason for hiding this comment

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

Please sign in to comment.