-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from bennett-diaz/dev
Add core components
- Loading branch information
Showing
21 changed files
with
1,120 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,26 @@ | ||
robots.txt,1723319421373,391d14b3c2f8c9143a27a28c7399585142228d4d1bdbe2c87ac946de411fa9a2 | ||
manifest.json,1723319421372,4e1d3adad9ce7e17c0d13fac197f1c27091906f4ecf3909c9f51247bff345118 | ||
index.html,1723319425327,6b61db28bd0cc8768f3df3defedd8070a1c14e189b22f7b340bcfa31d03e38ce | ||
asset-manifest.json,1723319425327,79b6386041539f7abe6f33fdd665593b3f620e023a243164fc461b5dfc45dad8 | ||
static/js/main.35e79179.js.LICENSE.txt,1723319425333,3e972863135e0286aeeff02dcf229f64266f242ca52a215efe5bb09e6d30d029 | ||
static/js/787.2c4f160c.chunk.js,1723319425333,c99de9dfb7b6c62fc9e4be6ffcd3dd065431d089888ae88749d95f14957e6bd3 | ||
static/js/787.2c4f160c.chunk.js.map,1723319425333,73ab8c999a9d71639017168747e9fd8ca3033f5f0d0dab911c16a277a3c2c8c2 | ||
static/js/main.35e79179.js,1723319425333,cf6b3cb798372db93601f04d93dc1d4561e774d64824212e56c568323b5a4379 | ||
static/js/main.35e79179.js.map,1723319425333,7a196bd6210d339953c89aaa5188ba1d0ff713773820f3d50fd137fa51de15b8 | ||
robots.txt,1723393057071,391d14b3c2f8c9143a27a28c7399585142228d4d1bdbe2c87ac946de411fa9a2 | ||
manifest.json,1723393057071,1c928c06665f60c071ee66beacd385d3015b421238eb6230319dfad8f7cca6eb | ||
index.html,1723393066436,bb0438135ebfc727d23e2b4ad799bd68b852e2f939ec42ffa73fbe91239596f2 | ||
asset-manifest.json,1723393066436,aa0158eb64d7ad844633e3a277b8333f257c373b6f75853983fa9005e729f231 | ||
static/js/main.6d77bf4b.js.map,1723393066450,5dbf123673e87e09e904f973cdfcdefc1a3e95ff01e4827200118264a8efdffc | ||
static/js/main.6d77bf4b.js.LICENSE.txt,1723393066450,15675683fda6557fbdad3b06203aacae9d9d04b43ee51a713cff455330ea6126 | ||
static/js/main.6d77bf4b.js,1723393066450,932a9139f72d4680370ac6ca4d12e3a62dfd63bfdf4bb9240d557a372746cfb1 | ||
static/js/787.2c4f160c.chunk.js.map,1723393066450,73ab8c999a9d71639017168747e9fd8ca3033f5f0d0dab911c16a277a3c2c8c2 | ||
static/js/787.2c4f160c.chunk.js,1723393066450,c99de9dfb7b6c62fc9e4be6ffcd3dd065431d089888ae88749d95f14957e6bd3 | ||
static/css/main.f01de07c.css.map,1723393066450,07a1a5923eee10f1060a2ea90e2322828cfe709a5201af37889216c7f7f8f66b | ||
static/css/main.f01de07c.css,1723393066450,6d2a9b0f33a123ea68406ebb6155e321ae487682796ca594147ad7cf4f26ce96 | ||
logos/text_logo_v3_white.png,1723393057070,5a31aa68b32afc2efa800adc03d4f3e08c860d950b3c388be5ab5c45dee52457 | ||
logos/text_logo_v3.png,1723393057069,00c730988d20718d58a87f45d92e9bfa1209ed903b0403675eb640e64d48b9eb | ||
logos/instacap_logo_v2_invert.png,1723393057068,56486769310014e976f84bea2c81800c4fc211ca5014f074177c83eaa0a6b1db | ||
logos/instacap_logo72_v3.png,1723393057067,62e4b8616daea01db9cfecf67c24af4767e38927e22c1a6ca56752f0d50ff485 | ||
logos/instacap_logo72_v1.png,1723393057066,fd27aa3886a16f8c35f61a502e9bd1971ba2d15a0130d325001b67ee3888262e | ||
images/overlay-600-900-v1.png,1723393057064,0f93feaf31f183a67a53d74dadba53f2f458182ff2dbdb2ac218c3225f5d1628 | ||
images/overlay-400-600-v1.png,1723393057062,de52a3b18d70c46f5633938fdcee92b46fcedb61bdf1d09f8bf58bf19e3ecd11 | ||
images/hero-web-1920-3d.jpg,1723393057060,21d92b9bfbe2e55a01762020d8db68cfbee36f6ba2aa3581abae61522377e838 | ||
images/hero-web-1600-3d.jpg,1723393057059,d14b192303b5881c1fae3c89bf30f2d2826d005fce928daa258a4acc0e0e19de | ||
images/hero-mobile-768-stacked.jpg,1723393057058,373b59183198361891fd7458b54d5077cb0e615d7b0a8b3d454c0662d49e2e77 | ||
images/hero-mobile-640-stacked.jpg,1723393057057,a4b8d775ce408233ee85a16c87251cd42b796ac18c8f146b8352f5200ec3f891 | ||
images/hero-mobile-1920-stacked.jpg,1723393057056,1e4764bcbf6e2dee40c1b16fff9eda0caa795800e769e65b67bb4f3b2552df95 | ||
images/hero-mobile-1600-stacked.jpg,1723393057054,3b86c44662c74a15a88f19cced44d461ff0c1365e872096df92b60507800f94b | ||
images/hero-mobile-1366-stacked.jpg,1723393057052,6ecc7c9298dcb3f4cd29c63573f967b148ebae23feddc0fe428648af0d9a541f | ||
images/hero-mobile-1024-stacked.jpg,1723393057050,55649c3cb0aad8a3a0eb81dc7fbfb95a31acc52e5b3f5ab33f63ba67ee0f6e4a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,128 @@ | ||
import React, { useState } from 'react'; | ||
import React, { useState, useEffect } from 'react'; | ||
import { GluestackUIProvider, Box, Button, ButtonText, Text } from '@gluestack-ui/themed'; | ||
import { config } from "./styles/gluestack_config/gluestack-ui.config" | ||
import Results from './components/Results'; | ||
import WebOverlay from './components/WebOverlay'; | ||
import BottomBar from './components/BottomBar'; | ||
import { useRemote, defaultTabs } from './contexts/remoteConfigContext' | ||
import { useAuth } from './contexts/authContext'; | ||
import { ResultsProvider } from './contexts/resultsContext'; | ||
import { AppContext, useLayout } from './contexts/layoutContext'; | ||
import { perf } from './firebaseConfig' | ||
import { ImageProvider } from "./contexts/imageContext" | ||
import { useLayout } from './contexts/layoutContext'; | ||
|
||
import NavBar from './components/NavBar'; | ||
import BottomBar from './components/BottomBar'; | ||
import HeroSection from './components/HeroSection'; | ||
import CTA from './components/CTA'; | ||
import WebOverlay from './components/WebOverlay'; | ||
|
||
import Results from './components/Results'; | ||
// import CaptionSet from './components/CaptionSet'; | ||
// import ImgRender from './components/ImgRender'; | ||
// import Login from './components/Login'; | ||
// import MyAccount from './components/MyAccount'; | ||
|
||
import Drawer from './components/Drawer'; | ||
import PrivacyPolicy from './components/PrivacyPolicy'; | ||
import TermsOfService from './components/TermsOfService'; | ||
|
||
|
||
|
||
function App() { | ||
|
||
// app context | ||
const { curUser } = useAuth(); | ||
const { remoteConfig } = useRemote(); | ||
const tabs = remoteConfig.tabs || defaultTabs; | ||
const [activeTab, setActiveTab] = useState(tabs.HomeTab.fixed_id); | ||
const [tabContent, setTabContent] = useState(tabs.HomeTab.fixed_id); | ||
const [page, setPage] = useState(tabs.HomeTab.fixed_id); | ||
const [selectedContent, setSelectedContent] = useState(null); | ||
const { isWeb, setIsWeb } = useLayout(); | ||
|
||
const handleOverlayClose = () => { | ||
setIsWeb(false); | ||
}; | ||
|
||
|
||
return ( | ||
<GluestackUIProvider config={config}> | ||
<ImageProvider> | ||
<Box> | ||
{isWeb && <WebOverlay onClose={handleOverlayClose} />} | ||
<Text>Hello Instacap!</Text> | ||
<Results /> | ||
<Button> | ||
<ButtonText>Hello world</ButtonText> | ||
</Button> | ||
{/* <BottomBar/> */} | ||
const [currentRoute, setCurrentRoute] = useState(window.location.pathname.slice(1) || 'home'); | ||
|
||
useEffect(() => { | ||
const handlePopState = () => { | ||
setCurrentRoute(window.location.pathname.slice(1) || 'home'); | ||
}; | ||
|
||
window.addEventListener('popstate', handlePopState); | ||
return () => window.removeEventListener('popstate', handlePopState); | ||
}, []); | ||
|
||
const navigateTo = (route) => { | ||
window.history.pushState(null, '', `/${route}`); | ||
setCurrentRoute(route); | ||
}; | ||
|
||
const renderContent = () => { | ||
switch (currentRoute) { | ||
case 'privacy': | ||
return <PrivacyPolicy />; | ||
case 'terms': | ||
return <TermsOfService />; | ||
// case 'account': | ||
// return curUser ? <MyAccount /> : <Login />; | ||
default: | ||
return ( | ||
<ImageProvider> | ||
<ResultsProvider> | ||
<Box flex="1" display="flex" flexDirection="column"> | ||
{isWeb && <WebOverlay onClose={handleOverlayClose} />} | ||
|
||
{/* More Tab */} | ||
{activeTab === (tabs.MoreTab?.fixed_id) && ( | ||
<> | ||
<Drawer /> | ||
{selectedContent && selectedContent} | ||
|
||
</> | ||
)} | ||
|
||
{/* Home tab */} | ||
<ImageProvider> | ||
<ResultsProvider> | ||
{tabContent === (tabs.HomeTab?.fixed_id) && ( | ||
<> | ||
<HeroSection /> | ||
<CTA /> | ||
{/* <Results ImgRender={ImgRender} CaptionSet={CaptionSet} /> */} | ||
<Results/> | ||
</> | ||
)} | ||
</ResultsProvider> | ||
</ImageProvider> | ||
|
||
{/* Account tab */} | ||
{/* {tabContent === (tabs.AccountTab?.fixed_id) && ( | ||
curUser ? <MyAccount /> : <Login /> | ||
)} */} | ||
</Box> | ||
{/* <Banner /> */} | ||
<BottomBar /> | ||
{/* <RestartFab /> */} | ||
{/* <Footer /> */} | ||
</ResultsProvider> | ||
</ImageProvider> | ||
); | ||
} | ||
}; | ||
|
||
return ( | ||
<AppContext.Provider value={{ navigateTo, remoteConfig, curUser, activeTab, page, setPage, setActiveTab, tabContent, tabs, setTabContent, selectedContent, setSelectedContent }}> | ||
<GluestackUIProvider config={config}> | ||
<Box display="flex" flexDirection="column" minHeight="100vh"> | ||
<NavBar /> | ||
{renderContent()} | ||
</Box> | ||
</ImageProvider> | ||
</GluestackUIProvider> | ||
); | ||
</GluestackUIProvider > | ||
</AppContext.Provider> | ||
|
||
) | ||
} | ||
|
||
export default App; |
Oops, something went wrong.