Skip to content

Commit

Permalink
Merge pull request #7 from bennett-diaz/dev
Browse files Browse the repository at this point in the history
Add core components
  • Loading branch information
bennett-diaz authored Aug 12, 2024
2 parents 3ac0e9e + 72df610 commit f7f8697
Show file tree
Hide file tree
Showing 21 changed files with 1,120 additions and 92 deletions.
35 changes: 26 additions & 9 deletions .firebase/hosting.YnVpbGQ.cache
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
18 changes: 17 additions & 1 deletion firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,21 @@
"destination": "/index.html"
}
]
}
},
"functions": [
{
"source": "functions",
"codebase": "default",
"ignore": [
"node_modules",
".git",
"firebase-debug.log",
"firebase-debug.*.log",
"*.local"
],
"predeploy": [
"npm --prefix \"$RESOURCE_DIR\" run lint"
]
}
]
}
23 changes: 17 additions & 6 deletions functions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,24 @@
* See a full list of supported triggers at https://firebase.google.com/docs/functions
*/

// const {onRequest} = require("firebase-functions/v2/https");
// const logger = require("firebase-functions/logger");
const {onRequest, onCall} = require("firebase-functions/v2/https");
const logger = require("firebase-functions/logger");

// Create and deploy your first functions
// https://firebase.google.com/docs/functions/get-started

// exports.helloWorld = onRequest((request, response) => {
// logger.info("Hello logs!", {structuredData: true});
// response.send("Hello from Firebase!");
// });
exports.helloWorld = onRequest((request, response) => {
logger.info("Hello logs! From, client", {structuredData: true});
response.send("Hello from Firebase! From, server");
});

exports.helloWorld1 = onCall((data, context) => {
logger.info("Hello logs! From, client on call - HOT", {structuredData: true});
return {message: "Hello on call - HOT RELOAD"};
});

exports.fetchCap1 = onCall((data, context) => {
logger.info("Test data for fetch captions", {structuredData: true});
return {message: "test data"};
});

72 changes: 53 additions & 19 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,57 @@
<html lang="en">

<head>
<meta charset="utf-8">
<meta name="theme-color" content="transparent">
<meta name="description" content="Generate influencer-worthy captions for your next post">
<meta charset="utf-8">
<meta name="theme-color" content="transparent">
<meta name="description" content="Generate influencer-worthy captions for your next post">

<!-- 'default' results in a white status bar with black text,
<!-- 'default' results in a white status bar with black text,
'black' results in a black status bar with white text
'black-translucent' results in a transparent background with white text.
Additionally, this status bar floats above your content -->

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, viewport-fit=cover" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, viewport-fit=cover" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">

<!-- TODO: add splash screens here -->
<!-- TODO: add splash screens here -->
<link rel="apple-touch-startup-image" href="images/apple-splash-2048-2732.jpg"
media="(device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)">
<link rel="apple-touch-startup-image" href="images/apple-splash-1668-2388.jpg"
media="(device-width: 834px) and (device-height: 1194px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)">
<link rel="apple-touch-startup-image" href="images/apple-splash-1536-2048.jpg"
media="(device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)">
<link rel="apple-touch-startup-image" href="images/apple-splash-1488-2266.jpg"
media="(device-width: 744px) and (device-height: 1133px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)">
<link rel="apple-touch-startup-image" href="images/apple-splash-1640-2360.jpg"
media="(device-width: 820px) and (device-height: 1180px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)">
<link rel="apple-touch-startup-image" href="images/apple-splash-1668-2224.jpg"
media="(device-width: 834px) and (device-height: 1112px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)">
<link rel="apple-touch-startup-image" href="images/apple-splash-1620-2160.jpg"
media="(device-width: 810px) and (device-height: 1080px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)">
<link rel="apple-touch-startup-image" href="images/apple-splash-1290-2796.jpg"
media="(device-width: 430px) and (device-height: 932px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)">
<link rel="apple-touch-startup-image" href="images/apple-splash-1179-2556.jpg"
media="(device-width: 393px) and (device-height: 852px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)">
<link rel="apple-touch-startup-image" href="images/apple-splash-1284-2778.jpg"
media="(device-width: 428px) and (device-height: 926px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)">
<link rel="apple-touch-startup-image" href="images/apple-splash-1170-2532.jpg"
media="(device-width: 390px) and (device-height: 844px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)">
<link rel="apple-touch-startup-image" href="images/apple-splash-1125-2436.jpg"
media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)">
<link rel="apple-touch-startup-image" href="images/apple-splash-1242-2688.jpg"
media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)">
<link rel="apple-touch-startup-image" href="images/apple-splash-828-1792.jpg"
media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)">
<link rel="apple-touch-startup-image" href="images/apple-splash-1242-2208.jpg"
media="(device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)">
<link rel="apple-touch-startup-image" href="images/apple-splash-750-1334.jpg"
media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)">
<link rel="apple-touch-startup-image" href="images/apple-splash-640-1136.jpg"
media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)">

<!-- <script>
<!-- <script>
(function () {
var isDevelopment = window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1';
var isStaging = window.location.hostname.includes('instacap-staging');
Expand All @@ -45,17 +79,17 @@
</head>

<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>

<script>
// if ('serviceWorker' in navigator) {
// window.addEventListener('load', () => {
// navigator.serviceWorker.register('/service-worker-workbox.js');
// });
// }
<script>
// if ('serviceWorker' in navigator) {
// window.addEventListener('load', () => {
// navigator.serviceWorker.register('/service-worker-workbox.js');
// });
// }

</script>
</script>
</body>

</html>
126 changes: 107 additions & 19 deletions src/App.jsx
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;
Loading

0 comments on commit f7f8697

Please sign in to comment.