Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
295 commits
Select commit Hold shift + click to select a range
360562e
Merge branch 'staging' into dashboard-view
lucymk Nov 18, 2019
27907a5
Merge pull request #10 from InFact-coop/dashboard-view
maxgerber Nov 18, 2019
2a6a6ed
make app easier to navigate (temp)
lucymk Nov 18, 2019
c640cc0
Merge branch 'staging' into take-a-photo
lucymk Nov 18, 2019
9642ce5
+ Create FormSteps overarching component
maxgerber Nov 18, 2019
6b852e6
Merge branch 'staging' into onboarding-form
maxgerber Nov 18, 2019
73dfbb1
Merge pull request #11 from InFact-coop/onboarding-form
lucymk Nov 18, 2019
395520a
+ Create tooltip
maxgerber Nov 18, 2019
37e3fd5
Turns button into file input and saves to state (2)
lucymk Nov 19, 2019
c7b352a
sends uploaded photo to back end
lucymk Nov 19, 2019
663fc7f
sends photo and moves to category page
lucymk Nov 19, 2019
2733a59
Merge branch 'staging' into take-a-photo
lucymk Nov 19, 2019
af4e68e
Begin with progress '...' tracker
maxgerber Nov 19, 2019
1a4e1f2
Initial setup using onboarding Formik layout
Oliversw Nov 19, 2019
af7f43c
Update generated Prisma files
Oliversw Nov 19, 2019
e2a4ae8
create error page
lucymk Nov 19, 2019
e3b285b
Add ratio and tags placeholders and moving between components
Oliversw Nov 19, 2019
42ba8d2
+ Progress tracker
maxgerber Nov 19, 2019
0ba7e6e
Merge pull request #12 from InFact-coop/onboarding-form
lucymk Nov 19, 2019
e3c3aa2
Add back functionality including back to photo
Oliversw Nov 19, 2019
304ebb7
+ Back and forward buttons
maxgerber Nov 19, 2019
c2868b4
Remove grey background from white arrow svg
Oliversw Nov 19, 2019
0a9db07
Add some very basic styling
Oliversw Nov 19, 2019
fd01a98
adds cors
lucymk Nov 19, 2019
aa28f6b
no message
lucymk Nov 19, 2019
cab9a11
Merge branch 'staging' into take-a-photo
lucymk Nov 19, 2019
f0610a3
+ How many children step
maxgerber Nov 19, 2019
51045b4
returns cloudinary url (2)
lucymk Nov 19, 2019
1c1b87a
Merge pull request #15 from InFact-coop/onboarding-form
lucymk Nov 19, 2019
803231d
Merge branch 'staging' into take-a-photo
lucymk Nov 19, 2019
1ac21fc
fixes or statement
lucymk Nov 19, 2019
68a920e
creates confirmation /success page 46
lucymk Nov 20, 2019
d62ce9e
Change file and import names to match prisma
Oliversw Nov 20, 2019
034e00b
Create categories component for food data form
Oliversw Nov 20, 2019
4f5eeca
Merge pull request #18 from InFact-coop/feature/food-data-component
maxgerber Nov 20, 2019
ae03fc6
Merge branch 'staging' into success-page
maxgerber Nov 20, 2019
df378b7
Merge pull request #17 from InFact-coop/success-page
maxgerber Nov 20, 2019
96a34c1
+ Begin creating Radio Input
maxgerber Nov 20, 2019
3eb0113
Merge branch 'staging' into onboarding-form
maxgerber Nov 20, 2019
6f48ea1
+ Make multistep form controls less rigid
maxgerber Nov 20, 2019
02dfc97
Change nodemon start script to watch for change in env variables
ivan-unfolds Nov 20, 2019
57e892b
Initial conditional styling for checkboxes
Oliversw Nov 20, 2019
3b68d39
Remove cors
ivan-unfolds Nov 20, 2019
24a9f6f
Basic working version of clickable checkboxes
Oliversw Nov 20, 2019
29544e8
Import and render all checkbox icons
Oliversw Nov 20, 2019
9156f10
Move state to own directory and add foodData context
ivan-unfolds Nov 20, 2019
17d1dbf
Display captured photo in food data view
ivan-unfolds Nov 20, 2019
5e069d5
Finish basic styling of the categories component
Oliversw Nov 20, 2019
a33b09c
Merge pull request #20 from InFact-coop/feature/category-selection
ivan-unfolds Nov 20, 2019
a27f101
Merge pull request #19 from InFact-coop/photo
maxgerber Nov 20, 2019
27dfd9c
Adjust image positioning in foodData
ivan-unfolds Nov 20, 2019
c06a030
Change categories from flex to grid
Oliversw Nov 20, 2019
5724ef0
Add constants for categories and update categories component
Oliversw Nov 20, 2019
732d05f
Remove extra FOOD_DATA from router context history
Oliversw Nov 20, 2019
db248a1
Add vegetable and fruit proportion to multistep form
ivan-unfolds Nov 20, 2019
2626a86
Add vegetable tile
ivan-unfolds Nov 20, 2019
eb117ac
Refactor foodData step components
ivan-unfolds Nov 20, 2019
d164ad9
Add correct metadata for downloading to homescreen
ivan-unfolds Nov 20, 2019
e8f7bca
Create very basic layout for results page
Oliversw Nov 21, 2019
802c1c6
Abstract out "step" elements
maxgerber Nov 21, 2019
c57d8e7
Merge pull request #21 from InFact-coop/fix/category-grid
maxgerber Nov 21, 2019
a9cc54c
Merge pull request #22 from InFact-coop/portions
maxgerber Nov 21, 2019
039e609
Merge branch 'staging' into feature/results
maxgerber Nov 21, 2019
502f250
Merge pull request #23 from InFact-coop/feature/results
maxgerber Nov 21, 2019
e415bc0
+ Create Step components for both forms
maxgerber Nov 21, 2019
b6c8db5
Merge branch 'staging' into food-data-form
maxgerber Nov 21, 2019
b69acd3
Merge pull request #24 from InFact-coop/food-data-form
lucymk Nov 21, 2019
f7f5dee
Small styling fixes
ivan-unfolds Nov 21, 2019
5d14de3
Fix back buttons
ivan-unfolds Nov 21, 2019
c372f7c
Add results screen
ivan-unfolds Nov 21, 2019
ff2ad83
Merge pull request #26 from InFact-coop/tweaks
lucymk Nov 21, 2019
1c05243
Put correct icons in
ivan-unfolds Nov 21, 2019
0ef5262
Change border color and get rid of tap highlight
ivan-unfolds Nov 21, 2019
a376aa3
Merge pull request #27 from InFact-coop/icons
lucymk Nov 21, 2019
1aba0fd
Adds Success stage to food data form 46
lucymk Nov 22, 2019
dcec8a8
Merge pull request #28 from InFact-coop/meal-success
maxgerber Nov 25, 2019
c978145
tidy up results page
lucymk Nov 25, 2019
df13532
+ Dynamic Ages Question
maxgerber Nov 25, 2019
d1641fa
Merge pull request #29 from InFact-coop/onboarding-form
lucymk Nov 26, 2019
60f7ab8
Merge branch 'staging' into refactoring-meal-flow
lucymk Nov 26, 2019
eb35c85
Merge pull request #30 from InFact-coop/refactoring-meal-flow
maxgerber Nov 26, 2019
0dc4e47
Add button to return to categories from results
Oliversw Nov 26, 2019
3c70e4f
Add return option to fruit and vegetable proportions
Oliversw Nov 26, 2019
b8191fa
Add return option to tags
Oliversw Nov 26, 2019
f87aaf2
Track last page and navigate back to results when revising answers
Oliversw Nov 26, 2019
c5bced1
+ Add slug to project datamodel
maxgerber Nov 26, 2019
886b63f
+ Create project seeds and flush
maxgerber Nov 26, 2019
9fb8a26
+ Create project context
maxgerber Nov 26, 2019
5d332c3
+ Get project from slug API handler
maxgerber Nov 26, 2019
1c3a062
Fix merge conflicts
Oliversw Nov 26, 2019
ffab1d0
update constants.js, seeds.js and flushDB.js
lucymk Nov 26, 2019
41e8621
Add constants to foodData
Oliversw Nov 26, 2019
f16ab9f
Merge pull request #31 from InFact-coop/fix/change-choices
lucymk Nov 26, 2019
be3f20f
Merge pull request #32 from InFact-coop/slugging-it
lucymk Nov 26, 2019
853a40b
Merge branch 'staging' into submit-food-data
lucymk Nov 26, 2019
67698e1
creates submit food data route
lucymk Nov 26, 2019
2eca9d1
fix not enough hooks error
lucymk Nov 26, 2019
f4d9ff3
Add privacy page assets and add to constants
Oliversw Nov 27, 2019
c3ae3ce
Add privacy page with styles
Oliversw Nov 27, 2019
4747130
Merge branch 'staging' into feature/privacy-page
Oliversw Nov 27, 2019
8296bf1
Merge pull request #33 from InFact-coop/submit-food-data
ivan-unfolds Nov 27, 2019
486073d
Make eslint work with ts files
ivan-unfolds Nov 27, 2019
ce067a7
Merge pull request #34 from InFact-coop/feature/privacy-page
ivan-unfolds Nov 27, 2019
a181d7f
Merge branch 'staging' into ts-eslint
ivan-unfolds Nov 27, 2019
c7fabdf
Delete getView function and update lint-staged config
ivan-unfolds Nov 27, 2019
16e4c2b
Add fix flag to eslint
ivan-unfolds Nov 27, 2019
68f74cc
Change state directory to be called context
ivan-unfolds Nov 27, 2019
cadf498
submit food data 76
lucymk Nov 27, 2019
47c2237
Merge branch 'staging' into submit-food-data
lucymk Nov 27, 2019
2378996
Merge pull request #35 from InFact-coop/ts-eslint
lucymk Nov 27, 2019
d710e26
mergee staging
lucymk Nov 27, 2019
5396508
removes image upload from home
lucymk Nov 27, 2019
0b48f2b
Add @auth0/nextjs-auth0 library and auth backend routes
ivan-unfolds Nov 27, 2019
0031284
Add auth context and create different apps based on authentication st…
ivan-unfolds Nov 27, 2019
783e8c1
Merge branch 'staging' into auth
ivan-unfolds Nov 27, 2019
f90c77b
Style menu 48
lucymk Nov 27, 2019
4dbd7c0
update logo width
lucymk Nov 27, 2019
3954387
Create proportion examples page
Oliversw Nov 27, 2019
0fd8f07
Include link to examples page in VegetableProportion page
Oliversw Nov 27, 2019
dcb818f
Add to FruitProportion page and write styles for link/button
Oliversw Nov 27, 2019
6703acd
Add state to food data form to track examples page and pass down to a…
Oliversw Nov 27, 2019
a26215b
makes headers consistent between menu and home and exports header to …
lucymk Nov 27, 2019
14ea58a
Merge pull request #36 from InFact-coop/submit-food-data
maxgerber Nov 28, 2019
6c979b0
Merge pull request #37 from InFact-coop/menu
maxgerber Nov 28, 2019
6adf125
Merge branch 'staging' into feature/proportion-examples
lucymk Nov 28, 2019
6cfac59
tidy up prop page
lucymk Nov 28, 2019
80e9f2a
Merge pull request #38 from InFact-coop/feature/proportion-examples
lucymk Nov 28, 2019
c70667d
Merge staging in
ivan-unfolds Nov 28, 2019
f57501a
Put a check in home for cookie expiry and logout if so
ivan-unfolds Nov 28, 2019
2ad05d4
adds privacy, terems and conditions and updates security page
lucymk Nov 29, 2019
29ab651
adds express sslify
lucymk Nov 29, 2019
3960bc9
+ Errors and validation:
maxgerber Nov 29, 2019
36d4af6
+ Start Ages dynamic validation]
maxgerber Nov 29, 2019
b7aa2f1
+ hasInitialised check
maxgerber Nov 29, 2019
34713d1
Merge pull request #39 from InFact-coop/auth
lucymk Dec 2, 2019
348c961
merge staging
lucymk Dec 2, 2019
1d39952
adds sign out
lucymk Dec 2, 2019
5663b10
+ FieldArray validation bloody madness
maxgerber Dec 2, 2019
79caef5
Merge pull request #40 from InFact-coop/privacy-terms-pages
maxgerber Dec 2, 2019
0714c3a
Merge branch 'staging' into validation-errors
maxgerber Dec 2, 2019
5dc91e8
Merge pull request #41 from InFact-coop/validation-errors
lucymk Dec 2, 2019
3207760
Add very basic styles to landing
Oliversw Dec 3, 2019
01fc096
+ Fix landscape image bug
maxgerber Dec 3, 2019
3d4b8d4
Merge pull request #42 from InFact-coop/image-fix
lucymk Dec 3, 2019
fba1f7b
+ Create Consent context/provider and plug into platform
maxgerber Dec 3, 2019
d6888b3
+ Create consent context
maxgerber Dec 3, 2019
04b16ce
Create new unauthenticated route provider
Oliversw Dec 3, 2019
fd146b3
Move landing page into a separate view
Oliversw Dec 3, 2019
c5f77f1
adds styled error page to food data
lucymk Dec 3, 2019
789eca5
Merge pull request #43 from InFact-coop/consent-context
lucymk Dec 3, 2019
ac40eeb
Merge branch 'staging' into error-page
lucymk Dec 3, 2019
43ed694
updates spinner component
lucymk Dec 3, 2019
7bccabe
Refactor security and welcome pages to use unauthed route provider
Oliversw Dec 3, 2019
b4c8ab7
Merge pull request #44 from InFact-coop/error-page
maxgerber Dec 3, 2019
3c9ce41
+ Move colours to tailwind extend
maxgerber Dec 3, 2019
34b49bb
+ Change Ages error message
maxgerber Dec 3, 2019
e988087
Separate security, privacy, and t&cs into separate components for aut…
Oliversw Dec 3, 2019
68a8de7
+ Create Phone page
maxgerber Dec 4, 2019
b8011f6
Merge pull request #45 from InFact-coop/onboarding-submit
lucymk Dec 4, 2019
c387a6c
Merge branch 'staging' into mobile-question
lucymk Dec 4, 2019
b06467b
Merge pull request #46 from InFact-coop/mobile-question
lucymk Dec 4, 2019
948a286
+ Add useEffect subscription cancel
maxgerber Dec 4, 2019
6115cde
Finish security pages
Oliversw Dec 4, 2019
0b2249c
Refactor landing page for new design
Oliversw Dec 4, 2019
fe15fdf
Merge branch 'staging' into onboarding-submit
maxgerber Dec 4, 2019
575403d
Fix merge conflicts
Oliversw Dec 4, 2019
3d28351
Initial styling for 404 page
Oliversw Dec 4, 2019
6c5fc52
Move 404 to next js _errors page
Oliversw Dec 4, 2019
4dbe069
Change casing of Snapeat to SnapEat in website copy
Oliversw Dec 4, 2019
a2ec7e3
Create button for reporting bugs, present on all pages
Oliversw Dec 4, 2019
1ad01dc
Add Airtable form to link
Oliversw Dec 4, 2019
a69aa3d
Fix bug with back button not appearing
Oliversw Dec 4, 2019
1080fa7
Fix bug with photo not appearing
Oliversw Dec 4, 2019
e2fd675
Merge pull request #47 from InFact-coop/feature/landing
lucymk Dec 4, 2019
68a4ea2
Adds reminder text messages
lucymk Dec 4, 2019
db4fe86
Merge branch 'staging' into feature/404
lucymk Dec 4, 2019
ac4cef1
Merge pull request #48 from InFact-coop/feature/404
lucymk Dec 4, 2019
afb8e46
Merge branch 'staging' into fix/snapeat-case
lucymk Dec 4, 2019
2fdf185
Merge pull request #49 from InFact-coop/fix/snapeat-case
lucymk Dec 4, 2019
6979a73
Merge branch 'staging' into feature/help-button
lucymk Dec 4, 2019
a5ad248
Merge pull request #50 from InFact-coop/feature/help-button
lucymk Dec 4, 2019
c40eed2
Merge pull request #51 from InFact-coop/fix/back-button
lucymk Dec 4, 2019
5eb1691
submit onboarding form
maxgerber Dec 4, 2019
f155b48
Merge branch 'staging' into onboarding-submit
maxgerber Dec 4, 2019
6db7d01
+ empty initvalues
maxgerber Dec 4, 2019
c3e0be8
Merge pull request #52 from InFact-coop/onboarding-submit
lucymk Dec 4, 2019
f414e4f
Journey through the centre of the app
maxgerber Dec 4, 2019
4a091e2
Merge pull request #53 from InFact-coop/onboarding-submit
lucymk Dec 5, 2019
08a17d2
- Mini fix first onboarding screen
maxgerber Dec 5, 2019
f3d2827
Merge pull request #54 from InFact-coop/onboarding-to-first-screen
lucymk Dec 5, 2019
a21209b
Make full login button clickable
maxgerber Dec 5, 2019
c057a83
Update eslint setup to handle typescript files
ivan-unfolds Dec 5, 2019
ce46756
+ Absolute bottom positioning food data :o
maxgerber Dec 5, 2019
149789c
Absolute onboarding controls so they don't obscure the screen when ke…
maxgerber Dec 5, 2019
c6d4924
fixes landing view design tweaks and adds staging seeds and commands
lucymk Dec 5, 2019
9c508d8
Merge pull request #55 from InFact-coop/onboarding-to-first-screen
lucymk Dec 5, 2019
736ec1d
merge staging
lucymk Dec 5, 2019
13394fb
adds test for iOS
lucymk Dec 5, 2019
423c6ef
tidy up for PR
ivan-unfolds Dec 5, 2019
3d92b67
Fix positioning of next controls button
ivan-unfolds Dec 5, 2019
7618324
fiixes form submit
lucymk Dec 5, 2019
3db2773
Merge commit '13394fbbdee11fb4c55710cea6444da564b8c2aa' into fix-submit
ivan-unfolds Dec 5, 2019
42a7810
Merge branch '🐛' into fix-submit
ivan-unfolds Dec 5, 2019
aa7c947
Merge changes
ivan-unfolds Dec 5, 2019
83ebce5
Merge branch 'staging' into sms-notifications
lucymk Dec 5, 2019
82ce656
Merge branch 'sms-notifications' into fix-submit
lucymk Dec 5, 2019
566d04a
edit timne
lucymk Dec 5, 2019
46b7c2d
Update lock file
ivan-unfolds Dec 5, 2019
f78d45f
Fix uploading of meal if only one of fruit and veg is selected
ivan-unfolds Dec 5, 2019
30d775b
Merge pull request #57 from InFact-coop/fix-submit
lucymk Dec 5, 2019
3940ca8
+ Dynamically get email from auth and plug into food data
maxgerber Dec 6, 2019
b4f9d27
+ Combine auth0 and prisma/snapeat user auth contexts so information…
maxgerber Dec 6, 2019
53a7abd
Merge pull request #58 from InFact-coop/dynamic-variables
lucymk Dec 6, 2019
ef9b148
Removes postcode validation to allow user to submit the start of thei…
lucymk Dec 10, 2019
72f9f96
edits postcode validation
lucymk Dec 10, 2019
533305f
Merge pull request #59 from InFact-coop/expanding=auth-context
ivan-unfolds Dec 10, 2019
a5678c4
Merge pull request #60 from InFact-coop/postcode-remove-validation
ivan-unfolds Dec 10, 2019
e85ed3b
+ Add airtableId's to db
maxgerber Dec 11, 2019
73ebbb3
Pascal casing interface
maxgerber Dec 16, 2019
588760f
[DEBUG] adding logs and debuggers
maxgerber Dec 16, 2019
3b13fed
[DEBUG]
maxgerber Dec 16, 2019
8d9a32c
[DEBUG]
maxgerber Dec 16, 2019
a345ac0
[DEBUG]
maxgerber Dec 16, 2019
410d12d
+ Remove postcode error
maxgerber Dec 16, 2019
1036faf
+ Await for airtable-user flow
maxgerber Dec 16, 2019
17deafc
removes back arrow if user has come from Results page
lucymk Dec 16, 2019
c0a3ba6
refactors nextOnClick
lucymk Dec 16, 2019
e12e838
refactor
lucymk Dec 16, 2019
9bcf361
refactor useEffect
lucymk Dec 16, 2019
0ca6bcc
Merge pull request #63 from InFact-coop/bug-fixing
ivan-unfolds Dec 16, 2019
fc73e1e
+ Working airtable-user flow (need to return json)
maxgerber Dec 17, 2019
f98164b
+ Fix no email in FoodData after onboarding bug
maxgerber Dec 17, 2019
7739fea
Await prisma call, and return from express to avoid duplicate request!
maxgerber Dec 17, 2019
42915fe
+ Remove console logs
maxgerber Dec 17, 2019
55b2be9
Merge pull request #61 from InFact-coop/export-to-airtable
lucymk Dec 17, 2019
8540709
script to push users from db into AT
lucymk Dec 17, 2019
1e3fc2f
Merge branch 'staging' into pushToAT
lucymk Dec 17, 2019
f3b57d9
+ non-crap error message for Ages component
maxgerber Dec 17, 2019
841a26a
Merge pull request #65 from InFact-coop/pushToAT
maxgerber Dec 17, 2019
a480062
[DEBUG] Add in debuggers get-available-projects
maxgerber Dec 17, 2019
44fb873
Remove debuggers
maxgerber Dec 17, 2019
3c901b5
Merge pull request #66 from InFact-coop/export-to-airtable
lucymk Dec 18, 2019
ce71524
+ set review global env variables
maxgerber Dec 18, 2019
f3ad1d4
Merge pull request #68 from InFact-coop/review-configuration
ivan-unfolds Dec 18, 2019
f0c4545
+ Stop uploadToAirtable file breaking the app
maxgerber Dec 18, 2019
a41c979
+ Upload to Airtable script
maxgerber Dec 18, 2019
c6ad94c
+ Remove required HOST variable
maxgerber Dec 18, 2019
a156f7a
Merge pull request #69 from InFact-coop/review-configuration
ivan-unfolds Dec 18, 2019
14f10f3
stop sending twilio reminders
lucymk Dec 19, 2019
5656b13
Merge pull request #71 from InFact-coop/cancel-twilio
maxgerber Dec 19, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
prisma/generated/
__playground__/
57 changes: 31 additions & 26 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,39 @@
{
"extends": ["esnext", "plugin:react/recommended", "prettier"],
"plugins": ["react-hooks", "babel"],
"settings": {
"react": {
"version": "16.9.0"
}
},
"parser": "babel-eslint",
"parserOptions": {
"ecmaFeatures": {
"jsx": true,
"modules": true
}
},
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": ["kentcdodds", "kentcdodds/react", "kentcdodds/jsx-a11y"],
"rules": {
"react/prop-types": 0,
"no-use-before-define": ["error", { "variables": false }],
"no-console": "error",
"import/no-commonjs": 0,
"no-use-before-define": 0,
"react/react-in-jsx-scope": 0,
"react/no-unescaped-entities": 0,
"import/no-namespace": 0,
"import/no-nodejs-modules": 0
"react-hooks/exhaustive-deps": 0,
"consistent-return": 0
},
"globals": {
"cssTheme": "readonly"
}
},
"overrides": [
{
"files": ["**/*.ts"],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
"prettier/@typescript-eslint"
],
"rules": {
"@typescript-eslint/ban-ts-ignore": 0,
"@typescript-eslint/no-explicit-any": 0
},
"settings": {
"import/resolver": {
"typescript": {
"alwaysTryTypes": true,
"directory": "tsconfig.json"
}
}
}
}
]
}
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ typings/

# dotenv environment variables file
.env
*.env


# Config folder
.config

# next.js build output
.next

__playground__/
16 changes: 14 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
{
"arrowParens": "avoid",
"bracketSpacing": true,
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxBracketSameLine": false,
"jsxSingleQuote": false,
"printWidth": 80,
"proseWrap": "always",
"quoteProps": "as-needed",
"requirePragma": false,
"semi": false,
"singleQuote": false,
"trailingComma": "es5"
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"useTabs": false
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# Snapeat
# SnapEat
10 changes: 10 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "snapeat",
"description": "",
"scripts": {},
"buildpacks": [
{
"url": "heroku/nodejs"
}
]
}
35 changes: 35 additions & 0 deletions apps/AuthenticatedApp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React, { useEffect } from 'react'
import AuthenticatedAppProviders from '../context/AuthenicatedAppProviders'
import { useAuth } from '../context/authContext'

import views from '../views'

import { CHANGE_VIEW, HOME, ONBOARDING } from '../utils/constants'

import { useRouteState, useRouteDispatch } from '../context/routeContext'

const AuthenticatedApp = () => {
const { currentView } = useRouteState()
const routeDispatch = useRouteDispatch()

const { snapeatUser } = useAuth()

useEffect(() => {
routeDispatch({
type: CHANGE_VIEW,
view: snapeatUser ? HOME : ONBOARDING,
})

return () => ({})
}, [])

const CurrentView = views[currentView]

return (
<AuthenticatedAppProviders>
<CurrentView />
</AuthenticatedAppProviders>
)
}

export default AuthenticatedApp
15 changes: 15 additions & 0 deletions apps/UnauthenticatedApp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react'

import views from '../views'

import { useRouteStateUnauth } from '../context/unauthRouteContext'

const UnauthenticatedApp = () => {
const { currentView } = useRouteStateUnauth()

const CurrentView = views[currentView]

return <CurrentView />
}

export default UnauthenticatedApp
24 changes: 24 additions & 0 deletions components/BugButton.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import styled from 'styled-components'

import bugIcon from '../public/icons/bug_icon.svg'

const BugButton = () => {
return (
<a
href="https://airtable.com/shrA8ckDkLTVqLoab"
target="_blank"
rel="noopener noreferrer"
>
<Icon src={bugIcon} alt="Report a bug" />
</a>
)
}

const Icon = styled.img.attrs({
className: 'absolute w-10',
})`
top: 2%;
right: 20%;
`

export default BugButton
43 changes: 43 additions & 0 deletions components/Header.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import styled from 'styled-components'
import { useRouteDispatch } from '../context/routeContext'
import { CHANGE_VIEW, MENU } from '../utils/constants'
import snapeatLogo from '../public/logos/logo2.svg'
import menuIcon from '../public/icons/menu.svg'
import menuBG from '../public/backgrounds/menu_bg.svg'

const MenuContainer = styled.div.attrs({
className: 'w-screen px-6 pt-5d5',
})`
display: grid;
grid-template-columns: 1fr 12.5%;
grid-template-rows: 40% 1fr;
align-items: center;
background: url(${menuBG}) left top/cover no-repeat;
`

const SnapeatLogo = styled.img.attrs({
className: 'w-auto sm:w-25',
})`
margin-left: calc((100vw - 48px - 80px) / 2);

@media ${cssTheme('media.sm')} {
margin-left: calc((100vw - 48px - 100px) / 2);
}
`

const HeaderWithLogo = () => {
const routeDispatch = useRouteDispatch()
return (
<MenuContainer>
<SnapeatLogo alt="logo" src={snapeatLogo} />
<div
onClick={() => routeDispatch({ type: CHANGE_VIEW, view: MENU })}
onKeyPress={() => routeDispatch({ type: CHANGE_VIEW, view: MENU })}
>
<img alt="menu" src={menuIcon} />
</div>
</MenuContainer>
)
}

export { HeaderWithLogo }
85 changes: 85 additions & 0 deletions components/Input.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import styled from 'styled-components'
import * as R from 'ramda'
import { Field, ErrorMessage } from 'formik'

import dropdown from '../public/icons/dropdown.svg'

const TextInput = styled(Field).attrs(({ placeholder, name, ...attrs }) => ({
className: 'bg-lightgray w-full border-b-2 border-navy',
type: 'text',
name,
placeholder,
...attrs,
}))``

const SelectInput = ({ options, placeholder, name, ...attrs }) => {
const emptyOption = (
<option value="" key="empty-option" disabled>
{placeholder}
</option>
)

const optionComponents = R.pipe(
R.map(({ label, value }) => (
<option key={`${name}-${value}`} label={label} value={value}>
{label}
</option>
)),
R.prepend(emptyOption),
)(options)

return <Select {...{ name, ...attrs }}>{optionComponents}</Select>
}

const Select = styled.select.attrs(({ className, ...attrs }) => {
return {
className: `border-b-2 border-navy block w-full
bg-transparent text-center ${className}`,
...attrs,
}
})`
-moz-appearance: none;
-webkit-appearance: none;
appearance: none;
background-image: url(${dropdown});
background-repeat: no-repeat, repeat;
background-position: right 0 top 50%, 0 0;
`

const RadioLabel = styled.label.attrs({
className: 'ml-2d5',
})``

const Radio = styled(Field).attrs(({ name, ...attrs }) => ({
type: 'radio',
id: name,
name,
...attrs,
}))``

const RadioInput = ({ name, children, id, ...attrs }) => (
<div className="mb-2d5">
<Radio name={name} id={id} {...attrs} />
<RadioLabel htmlFor={id}>{children}</RadioLabel>
</div>
)

const ErrorContainer = styled.div.attrs({
className: 'text-red',
})``

const Error = ({ name, className }) => (
<ErrorMessage
name={name}
render={msg => <ErrorContainer className={className}>{msg}</ErrorContainer>}
/>
)

const Input = ({ Component, ...attrs }) => (
<div>
<Component {...attrs} />
<Error name={attrs.name} />
</div>
)

export { Input, TextInput, RadioInput, SelectInput, Error }
Loading