Skip to content

Commit

Permalink
add popup, disable creating lists
Browse files Browse the repository at this point in the history
  • Loading branch information
djtaylor8 committed Dec 20, 2023
1 parent 4263956 commit 400b232
Show file tree
Hide file tree
Showing 10 changed files with 35,763 additions and 19,943 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.20.0
18.18.2
42,654 changes: 30,631 additions & 12,023 deletions package-lock.json

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@the-collab-lab/shopping-list-utils": "^2.2.0",
"dayjs": "^1.8.17",
"firebase": "^7.3.0",
"husky": "^3.1.0",
"lint-staged": "^9.5.0",
"prettier": "^1.19.1",
"react": "^16.11.0",
"react-dom": "^16.11.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-firestore": "^1.0.1",
"react-router-dom": "^5.1.2",
"react-scripts": "3.2.0"
"react-router-dom": "^5.1.2"
},
"scripts": {
"start": "react-scripts start",
Expand Down Expand Up @@ -48,6 +48,7 @@
]
},
"devDependencies": {
"cypress": "^3.8.0"
"cypress": "^3.8.0",
"react-scripts": "5.0.0"
}
}
3 changes: 1 addition & 2 deletions src/component/FetchItems.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import { withFirestore, FirestoreCollection } from 'react-firestore';
import Navbar from './Navbar';
import dayjs from 'dayjs';
import ListContents from './ListContents';
import shoppingCartIllustration from '../lib/images/shopping-cart-illustration2.svg';
// import shoppingCartIcon from '../lib/images/shoppingcart-icon.png';
import shoppingCartIllustration from '../lib/images/shopping-cart-illustration.svg';
import TopBar from './TopBar';

const FetchItems = ({ token, setToken, firestore }) => {
Expand Down
11 changes: 5 additions & 6 deletions src/component/GetToken.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import React from 'react';
import { Redirect } from 'react-router-dom';
import getToken from '../token';

const GetToken = ({ token, setToken }) => {
const onButtonClickHandler = () => {
const uniqueToken = getToken();
localStorage.setItem('uniqueToken', uniqueToken);
setToken(localStorage.getItem('uniqueToken'));
return <Redirect to="/list" />;
// const uniqueToken = 'the collab lab';
// localStorage.setItem('uniqueToken', uniqueToken);
// setToken(localStorage.getItem('uniqueToken'));
// return <Redirect to="/list" />;
console.log('Creating new lists is no longer supported.');
};

return (
Expand Down
2 changes: 1 addition & 1 deletion src/component/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import GetToken from './GetToken';
import { Link } from 'react-router-dom';
import ProjectInfo from './ProjectInfo';
import homeIllustration from '../lib/images/list_illustration_2.svg';
import homeIllustration from '../lib/images/list_illustration_1.svg';

function Home({ token, setToken }) {
return (
Expand Down
6 changes: 5 additions & 1 deletion src/component/Router.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import AddItem from './AddItem';
import JoinList from './JoinList';
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
import ItemDetails from './ItemDetails';
import { ArchivalNoticeModal } from '@the-collab-lab/shopping-list-utils';

function RouterComponent() {
const [token, setToken] = useState(localStorage.getItem('uniqueToken'));
Expand All @@ -28,7 +29,10 @@ function RouterComponent() {
</Route>
<Route path="">
{token === null ? (
<Home token={token} setToken={setToken} />
<>
<ArchivalNoticeModal />
<Home token={token} setToken={setToken} />
</>
) : (
<FetchItems token={token} setToken={setToken} />
)}
Expand Down
Loading

0 comments on commit 400b232

Please sign in to comment.