diff --git a/TODO.txt b/TODO.txt index 368a5a27..e92fe0c8 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,28 +1,14 @@ -dog and other filters not working suddenly - -nice hardcoded chat messages / increase dummy responses - ----- - write end to end cypress tests cross browser compatability / mobile check browser stack npm i on windows - -archived snaps from prev months - -lock down jeeliz git repo to exact version - - const [profiles, setProfiles] = useState([]); - -- Last: renew all api keys in commits - make sure pwa manifest related things are being picked up once depoyed! remove yarn lock files and keep only npm ones diff --git a/package.json b/package.json index 141fa8c0..0c10a7b6 100644 --- a/package.json +++ b/package.json @@ -33,14 +33,14 @@ "test": "react-scripts test", "e2e": "cypress open", "eject": "react-scripts eject", - "postinstall": "cd public/filters && npm i && git clone git@github.com:jeeliz/jeelizFaceFilter.git && npm run gulp", + "postinstall": "cd public/filters && npm i && git clone git@github.com:jeeliz/jeelizFaceFilter.git && cd jeelizFaceFilter && git reset --hard bd3cdcd0ca01ced09d836c55af82c36047d82dac && cd .. && npm run gulp", + "cleanup": "rm -rf node_modules && cd public/filters && rm -rf node_modules jeelizFaceFilter build", "precommit": "pretty-quick --staged && react-scripts test --watchAll=false", "storybook": "start-storybook -p 6006", "build-storybook": "build-storybook", "predeploy": "npm run build", "deploy": "gh-pages -d build", - "serve": "serve -s build", - "cleanup": "rm -rf node_modules && cd public/filters && rm -rf node_modules && rm -rf jeelizFaceFilter && rm -rf build" + "serve": "serve -s build" }, "eslintConfig": { "extends": "react-app" diff --git a/public/api/messages.json b/public/api/messages.json index e0f45e15..dda1344c 100644 --- a/public/api/messages.json +++ b/public/api/messages.json @@ -2,22 +2,64 @@ "thread": "Lisa", "messages": [ { - "id": 1, + "id": "9a8fcb4b-f820-4a9b-a736-a6c7297c39e0", "author": "Lisa", - "message": "Hey there2!", - "time": 1593057824382 + "message": "Hey girl))", + "time": 1593915027272 }, { - "id": 2, + "id": "9fd0a280-02c0-4510-b768-b40e9fd9ef4a", "author": "Lisa", - "message": "Oh wow", - "time": 1593057832262 + "message": "How you been?", + "time": 1593915032403 }, { - "id": 3, + "id": "58377272-7014-4fb3-9aad-fb9cd1cb84ca", "author": "Julia", - "message": "Hi", - "time": 1593057839073 + "message": "Oh hey Lisa!!", + "time": 1593915038980 + }, + { + "id": "4e8bfb1f-f087-4bf1-a577-c3b83f82a811", + "author": "Julia", + "message": "I've been good, about to go to that restaurant you recomended", + "time": 1593915044855 + }, + { + "id": "85298dde-d272-4937-8507-fe847e5bbcc5", + "author": "Lisa", + "message": "OMG what dish are you gonna try?? ๐Ÿ˜‹๐Ÿฝ", + "time": 1593915051122 + }, + { + "id": "8c75c657-172b-4185-aca7-7b6d9ef2a12b", + "author": "Julia", + "message": "The chicken parmesan of course ๐Ÿ’๐Ÿปโ€โ™€๏ธ", + "time": 1593915058801 + }, + { + "id": "e476f51f-e72e-4922-a400-00c9eea758f0", + "author": "Lisa", + "message": "HAHAHAHAHAHA", + "time": 1593915064982 + }, + { + "id": "4960dbac-b86d-4604-afb6-bdc1ba6bc006", + "author": "Lisa", + "message": "You and that chicken parmesan, you know other food exists right??", + "time": 1593915071585 + }, + { + "id": "a2b99907-9dc0-4fa5-8e58-3a7f9acc1a5b", + "author": "Julia", + "message": "Not to me it doesn't!!!", + "time": 1593915076911 + }, + { + "id": "ea6891d3-dfe8-4062-a095-21d3fe1b7b1d", + "author": "Julia", + "message": "Gotta go girl, later))", + "time": 1593915083382 } ] } diff --git a/public/api/photos.json b/public/api/photos.json index 08925b0e..a185a455 100644 --- a/public/api/photos.json +++ b/public/api/photos.json @@ -1,20 +1,22 @@ { "photos": [ + { + "month": "June", + "year": 2020, + "images": ["./images/selfies/6.jpg"] + }, { "month": "March", "year": 2020, - "images": [ - "https://www.refinery29.com/file/11154/intro-hero-mobile-v2.jpg", - "https://www.refinery29.com/file/11154/intro-hero-mobile-v2.jpg" - ] + "images": ["./images/selfies/5.jpg", "./images/selfies/4.jpg"] }, { "month": "January", "year": 2020, "images": [ - "https://www.refinery29.com/file/11154/intro-hero-mobile-v2.jpg", - "https://www.refinery29.com/file/11154/intro-hero-mobile-v2.jpg", - "https://www.refinery29.com/file/11154/intro-hero-mobile-v2.jpg" + "./images/selfies/3.jpg", + "./images/selfies/2.jpg", + "./images/selfies/1.jpg" ] } ] diff --git a/public/filters/src/bees.js b/public/filters/src/bees.js index fdc43b06..19e298f8 100644 --- a/public/filters/src/bees.js +++ b/public/filters/src/bees.js @@ -83,7 +83,7 @@ Filters.bees = { Filters.bees.GLASSESOBJ3D.scale.multiplyScalar(1.1); Filters.bees.GLASSESOBJ3D.position.setY(0.05); Filters.bees.GLASSESOBJ3D.position.setZ(0.25); - addDragEventListener(Filters.bees.GLASSESOBJ3D); + // addDragEventListener(Filters.bees.GLASSESOBJ3D); threeStuffs.faceObject.add(Filters.bees.GLASSESOBJ3D); }; const beeLoader = new THREE.JSONLoader(); diff --git a/public/filters/src/dog.js b/public/filters/src/dog.js index 4daa15cd..56e3c7da 100644 --- a/public/filters/src/dog.js +++ b/public/filters/src/dog.js @@ -171,7 +171,7 @@ Filters.dog = { Filters.dog.DOGOBJ3D.add(Filters.dog.EARMESH); Filters.dog.DOGOBJ3D.add(Filters.dog.NOSEMESH); Filters.dog.DOGOBJ3D.add(Filters.dog.TONGUEMESH); - addDragEventListener(Filters.dog.DOGOBJ3D); + // addDragEventListener(Filters.dog.DOGOBJ3D); threeStuffs.faceObject.add(Filters.dog.DOGOBJ3D); Filters.dog.ISLOADED = true; }; diff --git a/public/images/selfies/1.jpg b/public/images/selfies/1.jpg new file mode 100644 index 00000000..95d99ae8 Binary files /dev/null and b/public/images/selfies/1.jpg differ diff --git a/public/images/selfies/2.jpg b/public/images/selfies/2.jpg new file mode 100644 index 00000000..39459da9 Binary files /dev/null and b/public/images/selfies/2.jpg differ diff --git a/public/images/selfies/3.jpg b/public/images/selfies/3.jpg new file mode 100644 index 00000000..37e462e1 Binary files /dev/null and b/public/images/selfies/3.jpg differ diff --git a/public/images/selfies/4.jpg b/public/images/selfies/4.jpg new file mode 100644 index 00000000..2ce8cdea Binary files /dev/null and b/public/images/selfies/4.jpg differ diff --git a/public/images/selfies/5.jpg b/public/images/selfies/5.jpg new file mode 100644 index 00000000..80c81397 Binary files /dev/null and b/public/images/selfies/5.jpg differ diff --git a/public/images/selfies/6.jpg b/public/images/selfies/6.jpg new file mode 100644 index 00000000..941a4069 Binary files /dev/null and b/public/images/selfies/6.jpg differ diff --git a/src/AppShell/duck.ts b/src/AppShell/duck.ts index 10292472..63e3094a 100644 --- a/src/AppShell/duck.ts +++ b/src/AppShell/duck.ts @@ -37,8 +37,8 @@ const initialState = { // animationOut: 'zoomOut', // animationInDuration: 300, // animationOutDuration: 300, - // theme: 'stripped', - // component: 'snapMap', + // // theme: 'stripped', + // component: 'archive', // position: 'front', // show: true // } diff --git a/src/features/Archive/index.scss b/src/features/Archive/index.scss index c5c8285e..23455d11 100644 --- a/src/features/Archive/index.scss +++ b/src/features/Archive/index.scss @@ -2,6 +2,8 @@ @import '~styles/extendables'; .archive { + padding-bottom: 100px; + .message { text-align: center; color: #bbb; @@ -20,7 +22,7 @@ img { margin-right: 5px; - @extend %clickable; + // @extend %clickable; } } } diff --git a/src/features/Camera/index.tsx b/src/features/Camera/index.tsx index 8757b935..b41917e7 100644 --- a/src/features/Camera/index.tsx +++ b/src/features/Camera/index.tsx @@ -41,7 +41,7 @@ const Camera: React.FC = ({ setFooterType, pickPhoto }) => { const [takePic, setTakePic] = useState(false); useEffect(() => { - startCamera(); + // startCamera(); }, []); const startCamera = async () => { diff --git a/src/features/Chat/data.ts b/src/features/Chat/data.ts index 14a81272..bd39f4a8 100644 --- a/src/features/Chat/data.ts +++ b/src/features/Chat/data.ts @@ -1,8 +1,11 @@ export const dummyMessages = [ "Oh wow I can't believe it!", "Hahaha you're so right!!", - 'No way, when?!', + 'No way, when?!! ๐Ÿ˜ฑ', 'OMG I totally agree!', - "Umm I'm not so sure about that one", - 'Wait, you are actually being serious rn?' + "Umm I'm not so sure about that one ๐Ÿคจ", + 'Wait, you are actually being serious rn?', + "Hahahahaha you're too much ๐Ÿ˜‚๐Ÿ˜‚๐Ÿ˜‚", + 'Did you watch the new show last night?', + '๐Ÿคก' ]; diff --git a/src/features/Chat/duck.ts b/src/features/Chat/duck.ts index f28bc870..006d2332 100644 --- a/src/features/Chat/duck.ts +++ b/src/features/Chat/duck.ts @@ -11,20 +11,7 @@ export const getMessages = (user) => async (dispatch) => { if (!error) { dispatch({ type: MESSAGES_RECEIVED, - messages: [ - ...response.messages, - ...response.messages, - ...response.messages, - ...response.messages, - ...response.messages, - ...response.messages, - ...response.messages, - ...response.messages, - ...response.messages, - ...response.messages, - ...response.messages, - ...response.messages - ] + messages: response.messages }); } }; diff --git a/src/features/Chat/index.tsx b/src/features/Chat/index.tsx index d6396269..8a4ee9ed 100644 --- a/src/features/Chat/index.tsx +++ b/src/features/Chat/index.tsx @@ -44,21 +44,24 @@ const Chat: React.FC = ({ messageContainer.current.scrollTop = messageContainer.current.scrollHeight; }, [messages]); - const botResponse = useCallback(() => { - // Randomize the response and typing times to make the bot seem a little more "realistic" - const responseTimes = [500, 700, 900]; - const typeTimes = [1200, 1400, 1600]; - setTimeout(() => setTyping(true), randomArrayVal(responseTimes)); - setTimeout(() => { - setTyping(false); - postMessage(thread, randomArrayVal(dummyMessages)); - if (audioElem.current) playSound('newAppMessage', audioElem.current); - }, randomArrayVal(typeTimes)); - }, [postMessage, thread]); + const botResponse = useCallback( + (message?) => { + // Randomize the response and typing times to make the bot seem a little more "realistic" + const responseTimes = [500, 700, 900]; + const typeTimes = [1200, 1400, 1600]; + setTimeout(() => setTyping(true), randomArrayVal(responseTimes)); + setTimeout(() => { + setTyping(false); + postMessage(thread, message || randomArrayVal(dummyMessages)); + if (audioElem.current) playSound('newAppMessage', audioElem.current); + }, randomArrayVal(typeTimes)); + }, + [postMessage, thread] + ); useEffect(() => { getMessages(thread); - botResponse(); + botResponse('Soooo, how was it!?'); }, [thread, getMessages, botResponse]); const submitMessage = () => { diff --git a/src/features/Discover/index.tsx b/src/features/Discover/index.tsx index e7364569..17777a6b 100644 --- a/src/features/Discover/index.tsx +++ b/src/features/Discover/index.tsx @@ -17,9 +17,14 @@ interface Props { showDrawer: ShowDrawer; } +type Profile = { + image: string; + title: string; +}; + const Discover: React.FC = ({ avatar, drawerContent, showDrawer }) => { - const [profiles, setProfiles] = useState([]); const [page, setPage] = useState(1); + const [profiles, setProfiles] = useState([]); const loadMore = useRef(null); const isFetching = useRef(false); diff --git a/src/serviceWorker.ts b/src/serviceWorker.ts deleted file mode 100644 index b09523f1..00000000 --- a/src/serviceWorker.ts +++ /dev/null @@ -1,149 +0,0 @@ -// This optional code is used to register a service worker. -// register() is not called by default. - -// This lets the app load faster on subsequent visits in production, and gives -// it offline capabilities. However, it also means that developers (and users) -// will only see deployed updates on subsequent visits to a page, after all the -// existing tabs open on the page have been closed, since previously cached -// resources are updated in the background. - -// To learn more about the benefits of this model and instructions on how to -// opt-in, read https://bit.ly/CRA-PWA - -const isLocalhost = Boolean( - window.location.hostname === 'localhost' || - // [::1] is the IPv6 localhost address. - window.location.hostname === '[::1]' || - // 127.0.0.0/8 are considered localhost for IPv4. - window.location.hostname.match( - /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/ - ) -); - -type Config = { - onSuccess?: (registration: ServiceWorkerRegistration) => void; - onUpdate?: (registration: ServiceWorkerRegistration) => void; -}; - -export function register(config?: Config) { - if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) { - // The URL constructor is available in all browsers that support SW. - const publicUrl = new URL( - process.env.PUBLIC_URL, - window.location.href - ); - if (publicUrl.origin !== window.location.origin) { - // Our service worker won't work if PUBLIC_URL is on a different origin - // from what our page is served on. This might happen if a CDN is used to - // serve assets; see https://github.com/facebook/create-react-app/issues/2374 - return; - } - - window.addEventListener('load', () => { - const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`; - - if (isLocalhost) { - // This is running on localhost. Let's check if a service worker still exists or not. - checkValidServiceWorker(swUrl, config); - - // Add some additional logging to localhost, pointing developers to the - // service worker/PWA documentation. - navigator.serviceWorker.ready.then(() => { - console.log( - 'This web app is being served cache-first by a service ' + - 'worker. To learn more, visit https://bit.ly/CRA-PWA' - ); - }); - } else { - // Is not localhost. Just register service worker - registerValidSW(swUrl, config); - } - }); - } -} - -function registerValidSW(swUrl: string, config?: Config) { - navigator.serviceWorker - .register(swUrl) - .then(registration => { - registration.onupdatefound = () => { - const installingWorker = registration.installing; - if (installingWorker == null) { - return; - } - installingWorker.onstatechange = () => { - if (installingWorker.state === 'installed') { - if (navigator.serviceWorker.controller) { - // At this point, the updated precached content has been fetched, - // but the previous service worker will still serve the older - // content until all client tabs are closed. - console.log( - 'New content is available and will be used when all ' + - 'tabs for this page are closed. See https://bit.ly/CRA-PWA.' - ); - - // Execute callback - if (config && config.onUpdate) { - config.onUpdate(registration); - } - } else { - // At this point, everything has been precached. - // It's the perfect time to display a - // "Content is cached for offline use." message. - console.log('Content is cached for offline use.'); - - // Execute callback - if (config && config.onSuccess) { - config.onSuccess(registration); - } - } - } - }; - }; - }) - .catch(error => { - console.error('Error during service worker registration:', error); - }); -} - -function checkValidServiceWorker(swUrl: string, config?: Config) { - // Check if the service worker can be found. If it can't reload the page. - fetch(swUrl, { - headers: { 'Service-Worker': 'script' } - }) - .then(response => { - // Ensure service worker exists, and that we really are getting a JS file. - const contentType = response.headers.get('content-type'); - if ( - response.status === 404 || - (contentType != null && contentType.indexOf('javascript') === -1) - ) { - // No service worker found. Probably a different app. Reload the page. - navigator.serviceWorker.ready.then(registration => { - registration.unregister().then(() => { - window.location.reload(); - }); - }); - } else { - // Service worker found. Proceed as normal. - registerValidSW(swUrl, config); - } - }) - .catch(() => { - console.log( - 'No internet connection found. App is running in offline mode.' - ); - }); -} - -export function unregister() { - if ('serviceWorker' in navigator) { - navigator.serviceWorker.ready - .then(registration => { - registration.unregister(); - }) - .catch(error => { - console.error(error.message); - }); - } -}