Skip to content

Commit

Permalink
added disclaimer and welcome modal and fixed bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Sayyadd25794 committed Aug 11, 2024
1 parent fbe1ba9 commit b0791fd
Show file tree
Hide file tree
Showing 11 changed files with 122 additions and 3,883 deletions.
18 changes: 9 additions & 9 deletions .firebase/hosting.YnVpbGQ.cache
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
robots.txt,1720316070612,bfe106a3fb878dc83461c86818bf74fc1bdc7f28538ba613cd3e775516ce8b49
manifest.json,1722873973842,aff3449bdc238776f5d6d967f19ec491b36aed5fb7f23ccff6500736fd58494a
asset-manifest.json,1723386778432,a5bb9dcd8f3a9c68fbb3af0085ee4238200b1cd306e845490747ed8729f63ecb
static/js/main.0db7e3bb.js.LICENSE.txt,1723386778434,7845450e5511ea9a69120078ca00599b846cf5e0ead7cad96d3c23a2c44a9a66
static/css/main.d16f8633.css.map,1723386778435,a7795d2af2ffe3d20cbcedf02a0ab15a98fe6aa1c0a09fdcbe68562fcbdab0af
static/css/main.d16f8633.css,1723386778435,c27ab94a686123637e8756a946cd2551f9f99d7e835b443cf6c052710fba3432
static/media/logo.dc46dce79ffc0b376e05.png,1723386778435,6f4110889b7eced157c54d4b61ae9cb326fd1df4fb9ba5bf88e2cb29dd109641
index.html,1723386858077,b0b5bc488519185334a2196175c261978d8c2095ab9b6dbbb57debee8342c7f4
favicon.ico,1720316066988,eae62e993eb980ec8a25058c39d5a51feab118bd2100c4deebb2a9c158ec11f9
static/js/main.0db7e3bb.js,1723386778436,eca10e865d0e666101f006c77213d1f00731ad0025a1459c3cea63b5b447cd4b
static/js/main.0db7e3bb.js.map,1723386778439,30c864c61617d0725562284750a2b84fa8522f47a335237e4bde715ef0711cba
index.html,1723394493317,8c6ad1a711ddc1d276799b24913df3d8893482127e74b723b0ee56c62ec99756
asset-manifest.json,1723394493317,e4fd5d29a8b06c70a17ea213c8cbd6b04f877da22fc27c6f3a6f290213c41165
static/js/main.4b60c211.js.LICENSE.txt,1723394493351,7845450e5511ea9a69120078ca00599b846cf5e0ead7cad96d3c23a2c44a9a66
static/css/main.d16f8633.css.map,1723394493351,f2d2c12d6c5ff71fe4710e795507d548ac3613ee8abaadef1893863780992264
static/css/main.d16f8633.css,1723394493351,c27ab94a686123637e8756a946cd2551f9f99d7e835b443cf6c052710fba3432
static/media/logo.dc46dce79ffc0b376e05.png,1723394493351,6f4110889b7eced157c54d4b61ae9cb326fd1df4fb9ba5bf88e2cb29dd109641
favicon.ico,1723356052771,6f4110889b7eced157c54d4b61ae9cb326fd1df4fb9ba5bf88e2cb29dd109641
static/js/main.4b60c211.js,1723394493351,0eaa52ea21843031025bc4226575b78dbf57219ed12b3230b9c709e8d3cd02fb
static/js/main.4b60c211.js.map,1723394493355,4f8b51428d04540869932569b45b255700d652a7668827d896b28f560d922639
15 changes: 13 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { useEffect, useState } from 'react';
import Main from './components/Main';
import PeriodicTable from './components/PeriodicTable';
import './App.css'
Expand All @@ -7,21 +7,32 @@ import { useSelector } from 'react-redux';
import LoadingModal from './components/LoadingModal';
import ErrorSnackBar from './components/ErrorSnackBar';
import SuccessSnackBar from './components/SuccessSnackBar';
import Disclaimer from './components/Disclamer';
import { WelcomeModal } from './components/WelcomeModal';

function App() {
const loadingStore = useSelector((state) => state.loading);
const reactants = useSelector(state=> state.reactions.reactants);
const { loading, error, errorMessage, success, successMessage } = loadingStore;
const [open, setOpen] = useState(false);
const isWelcome = localStorage.getItem('isWelcome');
useEffect(()=>{
if( !isWelcome ){
setOpen(true);
}
},[isWelcome])

return (
<>
{error && <ErrorSnackBar message={errorMessage} open={error} />}
{success && <SuccessSnackBar message={successMessage} open={success} />}
<LoadingModal loading={reactants.length ? false : loading} />
<WelcomeModal open={open} setOpen={setOpen} />
<Routes>
<Route path='/' element={<Main />} />
<Route path='/periodic-table' element={<PeriodicTable />} />
</Routes>

<Disclaimer />
</>
);
}
Expand Down
Loading

0 comments on commit b0791fd

Please sign in to comment.