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

Make things pretty #67

Merged
merged 29 commits into from
Feb 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
# production
/build

# Semantic Theme Overrides and Variables
/src/semantic-ui/site/

# misc
.DS_Store
.env.local
Expand Down
3 changes: 3 additions & 0 deletions craco.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
plugins: [{ plugin: require('@semantic-ui-react/craco-less') }],
};
16 changes: 10 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@
"react-firestore": "^1.0.1",
"react-router": "^5.1.2",
"react-router-dom": "^5.1.2",
"react-scripts": "3.3.0"
"react-scripts": "3.3.0",
"semantic-ui-react": "^0.88.2"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"start": "craco start",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Was this to allow overriding some of semantic ui's less styling?

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, the Semantic UI docs recommended craco so that the app doesn't eject when the less for the custom theme compiles. I'm not too familiar with that but that's how I understood it.

https://react.semantic-ui.com/theming/

"build": "craco build",
"test": "craco test",
"eject": "craco eject",
"format": "prettier --write 'src/**/*.{js,jsx,ts,tsx,json,css,scss,md}'"
},
"eslintConfig": {
Expand Down Expand Up @@ -49,6 +50,9 @@
]
},
"devDependencies": {
"cypress": "^3.8.1"
"@craco/craco": "^5.6.3",
"@semantic-ui-react/craco-less": "^1.2.1",
"cypress": "^3.8.1",
"semantic-ui-less": "^2.4.1"
}
}
Binary file modified public/favicon.ico
Binary file not shown.
Binary file added public/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 2 additions & 5 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<meta name="description" content="Smart Shopping List" />
<link rel="apple-touch-icon" href="logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
Expand All @@ -24,7 +21,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>Smart Shopping List - TCL3</title>
Copy link
Member

Choose a reason for hiding this comment

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

Nice job catching this detail!

</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
Binary file modified public/logo192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/logo512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"short_name": "Smart Shopping List",
"name": "Smart Shopping List - Collab Lab Cohort 3",
Copy link
Member

Choose a reason for hiding this comment

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

Love that you took the time to tidy up these details!

"icons": [
{
"src": "favicon.ico",
Expand Down
23 changes: 2 additions & 21 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,22 +1,3 @@
.App {
text-align: center;
}

.App-logo {
height: 40vmin;
}

.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}

.App-link {
color: #09d3ac;
header > h1 {
font-size: 1.6rem;
}
1 change: 1 addition & 0 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import AppRouter from './AppRouter';
import './App.css';

function App() {
return (
Expand Down
Binary file added src/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 43 additions & 0 deletions src/components/AppHeader.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import React from 'react';
import { Header, Segment, Button } from 'semantic-ui-react';
import { Link } from 'react-router-dom';

function AppHeader(props) {
return (
<Segment textAlign="center" style={{ borderRadius: 0 }}>
{props.showBackArrow && (
<>
<Button
style={{ marginRight: '-37.5px' }}
basic
as={Link}
to="/"
icon="arrow left"
size="medium"
color="blue"
circular
floated="left"
></Button>
{/* <Divider hidden /> */}
</>
)}

<header>
{/* <Image
src={Logo}
centered
size="tiny"
verticalAlign="middle"
alt="Shopping List"
/> */}
<Header as="h1">
<Header.Content>{props.children}</Header.Content>
</Header>
</header>
</Segment>
);
}
AppHeader.defaultProps = {
showBackArrow: false,
};
export default AppHeader;
13 changes: 0 additions & 13 deletions src/components/ErrorMessage.js

This file was deleted.

9 changes: 0 additions & 9 deletions src/components/HiddenButton.js

This file was deleted.

15 changes: 0 additions & 15 deletions src/components/HomePageButton.js

This file was deleted.

2 changes: 0 additions & 2 deletions src/pages/ItemError.css → src/components/ItemError.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
margin-left: 15px;
margin-right: 15px;
padding: 10px;
border-left: 10px solid rgb(178, 20, 14);
border-radius: 2px;
background-color: rgb(240, 128, 128, 0.1);
}
Expand All @@ -17,7 +16,6 @@
margin-left: 1.2rem;
margin-right: 1.2rem;
padding: 1rem;
border-left: 1rem solid rgb(178, 20, 14);
border-radius: 2px;
background-color: rgb(240, 128, 128, 0.1);
}
Expand Down
File renamed without changes.
53 changes: 0 additions & 53 deletions src/components/JoinList.js

This file was deleted.

7 changes: 0 additions & 7 deletions src/components/Loading.js

This file was deleted.

19 changes: 9 additions & 10 deletions src/components/NavTabs.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
import React from 'react';
import { NavLink } from 'react-router-dom';
import '../pages/HomePage.css';
import { Menu, Icon } from 'semantic-ui-react';

const NavTabs = () => {
return (
<div className="container-container">
<div className="container">
<NavLink className="left-tab" to="/add-item">
to add item
</NavLink>
<Menu fluid fixed="bottom" bottom="true" widths={2}>
<Menu.Item as={NavLink} name="to add item" to="/add-item">
<Icon name="add" /> Add Item
</Menu.Item>

<NavLink className="right-tab" to={`/list/`}>
to list
</NavLink>
</div>
</div>
<Menu.Item as={NavLink} name="to list" to="/list">
<Icon name="list" /> Shopping List
</Menu.Item>
</Menu>
);
};

Expand Down
56 changes: 0 additions & 56 deletions src/components/Welcome.js

This file was deleted.

1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { fb as firebase } from './lib/firebase.js';
import { BrowserRouter as Router } from 'react-router-dom';
import App from './App';
import { ListContextProviderWithFirestore } from './listContext';
import 'semantic-ui-less/semantic.less';

ReactDOM.render(
<FirestoreProvider firebase={firebase}>
Expand Down
1 change: 0 additions & 1 deletion src/lib/normalizeName.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
//normalized function
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

const normalizeName = name => {
return name
.replace(/[,.;:!-?]/g, '')
Expand Down
Loading