Skip to content

Commit

Permalink
New Main Release (#45)
Browse files Browse the repository at this point in the history
* Ayomiku cu #860purrxf create components for search on mobile (#15)

* CU_#860purrwv search header perfected for mobile, desktop, tablet screen

* CU_#860purrwv search header perfected for mobile, desktop, tablet screen

* CU_#860purrwv search header perfected for mobile, desktop, tablet and adjust sign in button

* CU_#860purrwv sidebar restyle

* CU_#860purrwv navbar restyle

* CU_#860purrwv popular foods categories done

* CU_#860purrwv popular foods simgle category updated

* CU_#860purrwv search category updated

* CU_#860purrwv algolia search updated

* CU_#860purrwv desktop subtask ready for review

* CU_#860purrxf mobile design perfected on search home screen

* CU_#860purrxf major design perfected

* CU_#860purrxf fixed major bugs

* CU_#860purrxf fixed major bugs

* CU_#860purrxf fixed minor bugs

* CU_#860purrxf fixed recommendation text break bug

* CU_#860purrxf fixed bug on storybook

* CU_#860purrxf button theme typography textTransform changed

* CU_#860purrt6 addressed all Harit design issues

* commit changes

* CU_Ayomiku #860purrt6 fixed and addressed PR issues

* CU_Ayomiku #860pxhar3 completed desktop version

* CU_#860purrt6 adding custom typography theme done

* CU_#860purrt6 adding custom typography theme done

* CU_#860purrt6 adding custom typography theme done and fonts updated

* remove fonts from plugins

* CU_#860pbqzjb custom typography theme done

* CU_#860pbqzjb quick fix

* CU_#860pbqzjb quick fix HomeScreen component

* CU_#860pbqzjb quick fix HomeScreen component

* CU_#860pbqzjb quick fix HomeScreen component

* CU_#860pbqzjb fixed all PR comments and design issues

* CU_#860pbqzjb quick fix AutoCompleteSearch and SearchResultItem component

* CU_#860pbqzjb quick fix AutoCompleteSearch and SearchResultItem component

* quick fix on ViewMoreButton and SearchCategory components

* remove fomts

* remove fonts from project

* CU_#860purrxf remove fonts from package.json

* Ayomiku cu #860pvhgcd comparing detail page (#16)

* CU_#860purrwv search header perfected for mobile, desktop, tablet screen

* CU_#860purrwv search header perfected for mobile, desktop, tablet screen

* CU_#860purrwv search header perfected for mobile, desktop, tablet and adjust sign in button

* CU_#860purrwv sidebar restyle

* CU_#860purrwv navbar restyle

* CU_#860purrwv popular foods categories done

* CU_#860purrwv popular foods simgle category updated

* CU_#860purrwv search category updated

* CU_#860purrwv algolia search updated

* CU_#860purrwv desktop subtask ready for review

* CU_#860purrxf mobile design perfected on search home screen

* CU_#860purrxf major design perfected

* CU_#860purrxf fixed major bugs

* CU_#860purrxf fixed major bugs

* CU_#860purrxf fixed minor bugs

* CU_#860purrxf fixed recommendation text break bug

* CU_#860purrxf fixed bug on storybook

* CU_#860purrxf button theme typography textTransform changed

* CU_#860purrt6 addressed all Harit design issues

* commit changes

* commit all changes

* CU_#860pvhgcd more update

* CU_#860pvhgcd details page and comparing tab ready for review

* CU_#860pvhgcd addressing video review

* CU_#860pvhgcd addressing video review

* CU_#860pvhgcd addressing video reviews done

* CU_#860pvhgcd addressing video reviews done

* CU_#860pvhgcd fixed bug on MultipleSelects component

* CU_Ayomiku #860purrt6 fixed and addressed PR issues

* CU_Ayomiku #860pbqzjb added feat on MultipleSelects component

* CU_Ayomiku #860pxhar3 completed desktop version

* CU_#860purrt6 adding custom typography theme done

* CU_#860purrt6 adding custom typography theme done

* CU_#860purrt6 adding custom typography theme done and fonts updated

* remove fonts from plugins

* CU_#860pbqzjb custom typography theme done

* CU_#860pbqzjb quick fix

* CU_#860pbqzjb quick fix HomeScreen component

* CU_#860pbqzjb quick fix HomeScreen component

* CU_#860pbqzjb quick fix HomeScreen component

* CU_#860pbqzjb fixed all PR comments and design issues

* CU_#860pbqzjb quick fix AutoCompleteSearch and SearchResultItem component

* CU_#860pbqzjb quick fix AutoCompleteSearch and SearchResultItem component

* quick fix on ViewMoreButton and SearchCategory components

* remove fomts

* remove fonts from project

* CU_#860purrxf remove fonts from package.json

* merge from Ayomiku_CU_#860purrxf_Create_components_for_Search_on_Mobile

* CU_#860pvhgcd updating themes and typography

* CU_#860pvhgcd updating themes and typography

* CU_#860pvhgcd updating themes and typography done

* CU_#860pvhgcd quick fix

* Fixed some PR issues

* Fixed and address storybook UI issues

* CU_#860pvhgcd quick fix on SharedSocialMedia component

* CU_#860pvhgcd quick fix on SharedSocialMedia component

* CU_#860pvhgcd quick fix

* CU_#860pvhgcd addressed storybook and design issues

* CU_#860pvhgcd addressed storybook and design issues

* CU_#860pvhgcd fixed all fontWeight issues

* CU_#860pvhgcd fixed all fontWeight issues

* CU_#860pvhgcd quick fix

* CU_#860pvhgcd more update and fixes on design fontWeight

* CU_#860pvhgcd more update and fixes on design fontWeight with Adedamola

* CU_#860pvhgcd more updates on design storybook solution

* CU_#860pvhgcd more updates on design storybook solution and fixed filter food padding issue

* Ayomiku cu #860pxhar3 nutrition components for facts for a given food (#18)

* CU_#860purrwv search header perfected for mobile, desktop, tablet screen

* CU_#860purrwv search header perfected for mobile, desktop, tablet screen

* CU_#860purrwv search header perfected for mobile, desktop, tablet and adjust sign in button

* CU_#860purrwv sidebar restyle

* CU_#860purrwv navbar restyle

* CU_#860purrwv popular foods categories done

* CU_#860purrwv popular foods simgle category updated

* CU_#860purrwv search category updated

* CU_#860purrwv algolia search updated

* CU_#860purrwv desktop subtask ready for review

* CU_#860purrxf mobile design perfected on search home screen

* CU_#860purrxf major design perfected

* CU_#860purrxf fixed major bugs

* CU_#860purrxf fixed major bugs

* CU_#860purrxf fixed minor bugs

* CU_#860purrxf fixed recommendation text break bug

* CU_#860purrxf fixed bug on storybook

* CU_#860purrxf button theme typography textTransform changed

* CU_#860purrt6 addressed all Harit design issues

* commit changes

* commit all changes

* CU_#860pvhgcd more update

* CU_#860pvhgcd details page and comparing tab ready for review

* first commit

* first commit

* first commit

* CU_#860pvhgcd addressing video review

* CU_#860pvhgcd addressing video review

* CU_#860pvhgcd addressing video reviews done

* CU_#860pvhgcd addressing video reviews done

* CU_#860pvhgcd fixed bug on MultipleSelects component

* More updates and features

* CU_Ayomiku #860purrt6 fixed and addressed PR issues

* CU_Ayomiku #860pxhar3 more features on nutrition tab

* CU_Ayomiku #860pxhar3 more features on nutrition tab

* CU_Ayomiku #860pxhar3 more features on nutrition tab

* merge from comparing tab branch

* CU_Ayomiku #860pbqzjb added feat on MultipleSelects component

* CU_Ayomiku #860pxhar3 completed desktop version

* CU_Ayomiku #860pxhar3 completed desktop version

* CU_Ayomiku #860pxhar3 completed desktop version

* CU_#860purrt6 adding custom typography theme done

* CU_#860purrt6 adding custom typography theme done

* CU_#860purrt6 adding custom typography theme done and fonts updated

* CU_#860pxhar3 nutrition tab components done and ready for PR review

* remove fonts from plugins

* remove fonts from plugins

* CU_#860pbqzjb custom typography theme done

* CU_#860pbqzjb quick fix

* CU_#860pbqzjb quick fix HomeScreen component

* CU_#860pbqzjb quick fix HomeScreen component

* CU_#860pbqzjb quick fix HomeScreen component

* CU_#860pbqzjb fixed all PR comments and design issues

* CU_#860pbqzjb quick fix AutoCompleteSearch and SearchResultItem component

* CU_#860pbqzjb quick fix AutoCompleteSearch and SearchResultItem component

* quick fix on ViewMoreButton and SearchCategory components

* remove fomts

* remove fonts from project

* CU_#860purrxf remove fonts from package.json

* merge from Ayomiku_CU_#860purrxf_Create_components_for_Search_on_Mobile

* CU_#860pvhgcd updating themes and typography

* CU_#860pvhgcd updating themes and typography

* CU_#860pvhgcd updating themes and typography done

* CU_#860pvhgcd quick fix

* updating typography

* CU_#860pxhar3 all fonts, spacings and colors match with the design

* CU_#860pxhar3 quick corrections

* Fixed some PR issues

* Fixed and address storybook UI issues

* CU_#860pvhgcd quick fix on SharedSocialMedia component

* CU_#860pvhgcd quick fix on SharedSocialMedia component

* CU_#860pvhgcd quick fix

* CU_#860pvhgcd addressed storybook and design issues

* CU_#860pvhgcd addressed storybook and design issues

* CU_#860pvhgcd fixed all fontWeight issues

* CU_#860pvhgcd fixed all fontWeight issues

* CU_#860pvhgcd quick fix

* CU_#860pvhgcd more update and fixes on design fontWeight

* CU_#860pvhgcd more update and fixes on design fontWeight with Adedamola

* CU_#860pvhgcd more updates on design storybook solution

* CU_#860pvhgcd more updates on design storybook solution and fixed filter food padding issue

* CU_#860pxhar3 more update on fontWeight update

* CU_#860pxhar3 adjusted nutition components typographies and colors

* CU_#860pxhar3 adjusted nutition components typographies and colors

* CU_#860pxhar3 adjusted nutition components typographies and colors

* CU_#860pxhar3 adjusted nutition components typographies and colors and code review with Ade

* CU_#860pxhar3 adjusted nutition components typographies and colors and code review with Ade

* CU_#860pxhar3 adjusted nutition components typographies and colors and code review with Ade

* CU_#860pxhar3 quick fix

* CU_#860pxhar3 quick fix too

* CU_#860pxhar3 Ade design issues fixed

* CU_#860pxhar3 Ade design issues fixed

* CU_#860pxhar3 Ade design issues fixed 2

* CU_#860pxhar3 Ade design issues fixed 2

* CU_#860pxhar3 Ade design issues fixed 3

* CU_#860pxhar3 Ade design issues fixed 4

* CU_#860pxhar3 Ade design issues fixed 4

* CU_#860pxhar3 Ade design issues fixed 5

* CU_#860pxhar3 Ade design issues fixed 6

* CU_#860pxhar3 Ade design issues fixed 6

* CU_#860pxhar3 Ade design issues fixed 6

* CU_#860pxhar3 Ade design issues fixed 6

* CU_#860pxhar3 fixed react-slick dot with and height bug

* CU_#860pxhar3 documented svgr on READ.md

* CU_#860pxhar3 quick fix on react-slick

* CU_#860pxhar3 harit reviews addressed

* CU_#860pxhar3 Ade alignment issue  addressed

* CU_#860pxhar3 Ade alignment issue  addressed

* CU_#860pxhar3 fixed all Harit storybook design issue

* CU_#860pxhar3 fixed all Harit storybook design issue

* CU_#860pxhar3 fixed all Harit storybook design issue 2

* CU_#860pxhar3 fixed all Harit storybook design issues

* CU_#860pxhar3 fixed all Harit storybook design issues

* CU_#860pxhar3 fixed all Harit storybook design issues

* CU_#860pxhar3 major fix

* CU_#860pxhar3 major fix

* CU_#860pxhar3 major fix and storybook PR updated

* CU_#860pxhar3 bug fixed

* CU_#860pxhar3 bug fixed 2

* CU_#860pxhar3 bug fixed final

* CU_#860pxhar3 bug fixed final 2

* feat(#8669rk7pr): fix issue related to nutrient selection on filter

* CU_#860q6d11w added script to download data files (#20)

* CU_#860q6d11w added script to download data files

* CU_#860q6d11w added script to download data files

* CU_#860q6d11w convert file to typescript, data directory to root directory

* CU_#860q6d11w convert file to typescript, data directory to root directory

* CU_#860q6d11w convert file to typescript, data directory to root directory

* CU_#860q6d11w added .env variable

* CU_#860q6d11w added .env variable and README documentation

* CU_#860q6d11w added .env variable and README documentation

* CU_#860q6d11w added .env variable and README documentation

* CU_#860q6d11w added .env variable and README documentation

* CU_#860q6d11w added .env variable and README documentation

* CU_#860q6d11w fixed deployment issue

* CU_#860q6d11w fixed deployment issue

* feat(#860q6d11w): change the location of the script

* CU_#860q6d11w remove type:'module'

* CU_#860q6d11w convert to .mjs format

---------

Co-authored-by: hhimanshu <dev.atwork@yahoo.com>

* Ayomiku cu #860q6d3gu migrate the build process to generate food pages (#22)

* first push

* pushed working code

* pushed working code for PR review

* pushed working code for PR review

* pushed working code for PR review

* pushed working code for PR review

* pushed working code for PR review

* pushed working code for PR review

* pushed working code for PR review 2

* pushed working code for PR review 2

* fixing deployment bug

* fixing deployment bug 2

* fixing deployment bug 2

* fixing MUI gatsby bug issue

* fixing MUI gatsby bug issue

* fixed

* fixed

* checking production break bug

* fixed table design issue

* ade review

* ade review and fixed deployment bug

* ade review and fixed deployment bug2

* fixed filtering age selection bugs

* fixed #4

* quick fix

* testing gatsby-plugin-emotion

* fixing production bug

* fixing production bug

* fixing production bug

* added custom plugins back

* added custom plugins back

* added custom plugins back

* code review with harit

* fixing mui break issue

* fixing mui break issue

* fixing mui break issue in progress

* adjuster header button borderRadius size

* adjuster header button borderRadius size

* adjuster header padding effect

* feat(#860q6d3gu): rdi should be passed using context

* feat(#860q6d3gu): local useState is not needed

refactor the code to have better names in types

* code refactoring

* code refactoring done

* feat(#860q6d3gu): make variable naming clearer to domain

* fixed duplicate name issue on search results lists

* feat(#860q6d3gu): extract smaller components

* feat(#860q6d3gu): renaming to support code reading clarity

* feat(#860q6d3gu): more renaming to support code reading clarity

* feat(#860q6d3gu): do not recreate function in a loop

* feat(#860q6d3gu): rename argument for better clarity

* feat(#860q6d3gu): further renaming type

* feat(#860q6d3gu): create rowsByNutrientGroup

* feat(#860q6d3gu): add type to the story

* fixed duplicate name issue on search results lists

* remove slice funcion generate details page

* remove slice funcion generate details page

* refactoring search nutrition filter function

* refactoring search nutrition filter function

* refactoring search nutrition more update

* refactoring search nutrition more update

* refactoring search nutrition more update

* refactoring search nutrition done

* working nutrition table filters

* working nutrition table filters 2

* working nutrition table filters 3

* working nutrition table filters bug

* working nutrition table filters bug on production

* working nutrition table filters bug fixed

* working nutrition table filters bug fixed

* working nutrition table filters production bug fixed

* working nutrition table filters production bug fixed and checking

* working nutrition table filters production bug fixed correctly

* working nutrition table filters production bug fixed correctly

* working nutrition table filters production bug fixed correctly

* testing update on production

* testing update on production 2

* CU_#860q6d3gu quick fix

* CU_#860q6d3gu quick fix on social medium

* CU_#860q6d3gu quick fix on storybook deployment issue

* CU_#860q6d3gu quick fix on storybook deployment issue

* CU_#860q6d3gu quick fix on storybook deployment issue ongoing

* fixing chromatic build issue

* fixing chromatic build issue

* fixing chromatic build issue

* fixing chromatic build issue ongoing

* fixing chromatic build issue ongoing

* fixing chromatic build issue ongoing

* fixing chromatic build issue ongoing 2

* fixed searchNutrition select bug

* fixed searchNutrition select bug fixed

* fixed 1,2 and 4 Ade reviews

* fixed searchNutrition select bug fixed

* working on table sortings..

* fixed all Ade issues

* fixed all Ade issues reviews done

* quick fixes

* Fixed selected Age bug

* Fixed selected Age bug

* Fixing chromatic build env issue

* Fixing chromatic build env issued on testing

* remove download-data command from chromatic build

* fixed stories args errors

* fixed PR review comments

* quick fix

* quick fix

* Corrected vercel build errors

* fixed all issues

* fixed all issues and production bugs

---------

Co-authored-by: hhimanshu <dev.atwork@yahoo.com>

* Ayomiku cu #860q8w6dk recently viewed main (#25)

* first push

* pushed working code

* pushed working code for PR review

* pushed working code for PR review

* pushed working code for PR review

* pushed working code for PR review

* pushed working code for PR review

* pushed working code for PR review

* pushed working code for PR review 2

* pushed working code for PR review 2

* fixing deployment bug

* fixing deployment bug 2

* fixing deployment bug 2

* fixing MUI gatsby bug issue

* fixing MUI gatsby bug issue

* fixed

* fixed

* checking production break bug

* fixed table design issue

* ade review

* ade review and fixed deployment bug

* ade review and fixed deployment bug2

* fixed filtering age selection bugs

* fixed #4

* quick fix

* testing gatsby-plugin-emotion

* fixing production bug

* fixing production bug

* fixing production bug

* added custom plugins back

* added custom plugins back

* added custom plugins back

* code review with harit

* fixing mui break issue

* fixing mui break issue

* fixing mui break issue in progress

* adjuster header button borderRadius size

* adjuster header button borderRadius size

* adjuster header padding effect

* feat(#860q6d3gu): rdi should be passed using context

* feat(#860q6d3gu): local useState is not needed

refactor the code to have better names in types

* code refactoring

* code refactoring done

* feat(#860q6d3gu): make variable naming clearer to domain

* fixed duplicate name issue on search results lists

* feat(#860q6d3gu): extract smaller components

* feat(#860q6d3gu): renaming to support code reading clarity

* feat(#860q6d3gu): more renaming to support code reading clarity

* feat(#860q6d3gu): do not recreate function in a loop

* feat(#860q6d3gu): rename argument for better clarity

* feat(#860q6d3gu): further renaming type

* feat(#860q6d3gu): create rowsByNutrientGroup

* feat(#860q6d3gu): add type to the story

* fixed duplicate name issue on search results lists

* remove slice funcion generate details page

* remove slice funcion generate details page

* refactoring search nutrition filter function

* refactoring search nutrition filter function

* refactoring search nutrition more update

* refactoring search nutrition more update

* refactoring search nutrition more update

* refactoring search nutrition done

* working nutrition table filters

* working nutrition table filters 2

* working nutrition table filters 3

* working nutrition table filters bug

* working nutrition table filters bug on production

* working nutrition table filters bug fixed

* working nutrition table filters bug fixed

* working nutrition table filters production bug fixed

* working nutrition table filters production bug fixed and checking

* working nutrition table filters production bug fixed correctly

* working nutrition table filters production bug fixed correctly

* working nutrition table filters production bug fixed correctly

* testing update on production

* testing update on production 2

* testing update on production 2

* working with indexDB

* CU_#860q6d3gu quick fix

* CU_#860q8w6dk quick fix

* CU_#860q8w6dk ready fo review

* CU_#860q6d3gu quick fix on social medium

* CU_#860q6d3gu quick fix on storybook deployment issue

* CU_#860q6d3gu quick fix on social medium

* CU_#860q6d3gu quick fix on storybook deployment issue

* CU_#860q8w6dk quick fix

* CU_#860q6d3gu quick fix on storybook deployment issue ongoing

* fixing chromatic build issue

* fixing chromatic build issue

* fixing chromatic build issue

* fixing chromatic build issue ongoing

* fixing chromatic build issue ongoing

* fixing chromatic build issue ongoing

* fixing chromatic build issue ongoing 2

* fixed searchNutrition select bug

* fixed searchNutrition select bug fixed

* fixed 1,2 and 4 Ade reviews

* fixed searchNutrition select bug fixed

* working on table sortings..

* fixed all Ade issues

* fixed all Ade issues reviews done

* quick fixes

* Fixed selected Age bug

* Fixed selected Age bug

* Fixing chromatic build env issue

* Fixing chromatic build env issued on testing

* remove download-data command from chromatic build

* fixed stories args errors

* fixed PR review comments

* quick fix

* quick fix

* Corrected vercel build errors

* fixed all issues

* fixed all issues and production bugs

* ready for PR review

* quick fix

* quick fix on storybook image loading

---------

Co-authored-by: hhimanshu <dev.atwork@yahoo.com>

* Ayomiku cu #860qderch the order of nutrient groups should be fixed (#29)

* CU_table sorted correctly #860qderch

* CU_#860qderch fixed table sorting bugs

* CU_#860qbngcy forkfacts logo updated (#27)

* CU_#860qbngcy forkfacts logo updated

* added cursor of pointer

* addressed PR 27 comments

* added seo content to generated food details page (#28)

* added seo content to generated food details page

* SEO code improved

* CU_#866a0gevy adjusted table row fonts (#30)

* CU_#866a0gevy adjusted table row fonts

* CU_#866a0gevy adjusted mobile nutrition table row fonts

* CU_#860qaa5gw Commingsoon component udpated for library and recipes (#26)

* CU_#860qaa5gw Commingsoon component udpated for library and recipes

* addressed PR 26 comments

* removed fs package

* CU_#860qder7x Nutrient's displayName should be shown if available is … (#33)

* CU_#860qder7x Nutrient's displayName should be shown if available is done

* add focus on search nutrition input field

* Ayomiku cu #860qdehpp enable sharing on social channels (#31)

* CU_#860qdehpp enabled share on social media

* CU_#860qdehpp enabled share on social media

* CU_#860qdehpp enabled share on social media done

* CU_#860qdehpp enabled share on social now working

* CU_#860qdehpp improved social media share configuration

* remove prop title from EmailShareButton and FacebookShareButton

* CU_#866a177w2 fixed nutrition facts are missing units (#32)

* CU_#866a177w2 fixed nutrition facts are missing units

* nutrient uni space adjusted

* CU_#860qewjwn SEO content improved

* quick fix

* Fixed duplicate of Food interface types and clearn DetailsPageGenerator.ts file

* feat(#860qewjwn): add 2 ways to ge energy calculation

* Ayomiku cu #866a1tbuc remove sorting from the nutrition table (#36)

* remove sort function

* removed sorting icon on nutrition table header

* removed cursor effect from nutrition table header

* CU_#860qewbq0 fixed desktop layout responsive issue (#34)

* CU_#860qewbq0 fixed desktop layout responsive issue

* CU_#860qewbq0 fixed desktop layout responsive issue

* CU_#860qewbq0 quick fix on Sidebar component

* CU_#860qewbq0 quick fix on Sidebar component

* quick fix on details page width

* Fixed nutrition responsive table issues

* quick fix on nutrition table

* addressing detailspage responsive issue

* CU_#860qewjwn SEO content improved

* quick fix

* fixed merge conflicts

* feat(#860qewjwn): add 2 ways to ge energy calculation

* CU_#860qewbq0 fixed desktop layout responsive issue

* removed console.log on AutoCompleteSearch component

* fixed merge conflicts and resolved conflict component

---------

Co-authored-by: hhimanshu <dev.atwork@yahoo.com>

* Ayomiku cu #860qf8v4c implement the recommended daily intake calculator (#37)

* progress made on tools page

* fixed custom theme bug

* select gender UI done

* age filter done

* more update

* quick fixes

* more update with storybook

* update flter comoponent

* rdi table dome

* more update added

* clear bugs  on rdi filter logic

* working code

* fixed mobile filter bug

* fix react-slick bug

* fixed all bugs

* quick fix on sidebar

* addressed PR issues

* fixed sidebar selected item bug

* fixed search food item path

* fixed table background row issue

* fixed design bugs

* added scroll to select nutrient dropdown

* quick fix on RDI table

* quick adjustment on Rdi desktop table

* minor issues fixed

* fixed bug Rdi mobile card sliders

* adaptive height issue is fixed

* removed single nutrient filtered button on Rdi mobile card

* removed overflow from layout component

* fixed major bugs

* quick fix

* quick fix on component types

* added light primary color to SCelectFilters component

* added SEO content to Rdi table page

* life stage card updated

* quick fix

* fixed age range bug on rdi table

* seo updated

* fixed PR comment issues

* banner updated (#39)

* feat(): update banner filename (#41)

* Ayomiku cu #866a5dn77 there should not be recipes in the url of a single food details (#42)

* banner updated

* recipes part removed

* feat(#860qhrxj0): update url, food name and create search index

* feat(#860qhrxj0): do not check-in .raw directory

* feat(#860qhrxj0): use hap_name in search results

* feat(#860qhrxj0): update recent searches

---------

Co-authored-by: Ayomikuolatunji <69473765+Ayomikuolatunji@users.noreply.github.com>
Co-authored-by: ayomikuolatunji <ayomikuolatunji@gmail.com>
  • Loading branch information
3 people committed May 4, 2023
1 parent 81c7ae6 commit b87487e
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -8,4 +8,5 @@ src/gatsby-types.d.ts
.env.production
.vscode
data
wget-log*
wget-log*
.raw
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -12,7 +12,7 @@
"scripts": {
"develop": "gatsby develop",
"start": "npm run download-data && gatsby develop",
"build": "npm run download-data && gatsby build",
"build": "npm run download-data && NODE_OPTIONS=--max-old-space-size=8192 gatsby build",
"serve": "gatsby serve",
"clean": "gatsby clean",
"typecheck": "tsc --noEmit",
Expand Down
4 changes: 3 additions & 1 deletion src/components/AutoCompleteSearch/AutoCompleteSearch.tsx
Expand Up @@ -46,6 +46,7 @@ type AutocompleteItem = Hit<{
category: any;
image: string;
name: string;
hap_name: string;
objectID: string;
url: string;
}>;
Expand Down Expand Up @@ -132,13 +133,14 @@ function AutoCompleteSearch(
if (props.searchLocation !== "") {
const searchData: SearchParams = {
name: item.name,
hap_name: item.hap_name,
category: item.category,
timestamp: new Date(),
searchLocation: props.searchLocation ?? "Food",
};
await addSearchEntry(searchData);
}
const path = `recipes/${spaceToDashes(item.name)}`;
const path = `${spaceToDashes(item.name)}`;
navigate(path);
};

Expand Down
Expand Up @@ -53,7 +53,7 @@ export default function SearchResultItem({ item, onSelectItem, multiple }: Searc
fontWeight: theme.typography.fontWeightLight,
}}
>
{item.name}
{item.hap_name}
</Typography>
</Box>
}
Expand Down
19 changes: 15 additions & 4 deletions src/generators/DetailsPageGenerator.ts
@@ -1,3 +1,5 @@
import { writeJsonToFile } from "../helpers/shared";

const path = require("path");
const ff_nutrition_facts = require("../../data/foundation_food_nutrition_facts.json");
const sr_legacy_nutrition_facts = require("../../data/sr_legacy_food_nutrition_facts.json");
Expand Down Expand Up @@ -33,8 +35,14 @@ export const createDetailsPage = (createPage: any) => {
}
};

const createNutritionTable = ({ createPageFunction, foods }: any) => {
let ffSearchIndex: any = [];
interface SearchIndexEntry {
name: string;
hap_name: string;
category: string;
url: string;
}
const createNutritionTable = ({ createPageFunction, foods, indexFileName }: any) => {
let ffSearchIndex: SearchIndexEntry[] = [];
const template = path.resolve("src/templates/DetailsPage.tsx");
foods.forEach((food: Food) => {
if (food.name) {
Expand All @@ -44,14 +52,15 @@ const createNutritionTable = ({ createPageFunction, foods }: any) => {
const carbohydrates = filterNutrient(food, CARBOHYDRATE_NAME, CARBOHYDRATE_UNIT);
const protein = filterNutrient(food, PROTEIN_NAME, PROTEIN_UNIT);
const seoInfo = generateSEOInfo(food.name, calories, protein, carbohydrates, fat);
const pagePath = spaceToDashes(food["name"].toString());
const foodName = indexFileName === "ff_search_index" ? food.hap_name : food.name; // todo: until the point when we have SR Legacy name clean up
const pagePath = spaceToDashes(food.name);
const seo: { title: string; description: string; pagePath: string } = {
title: seoInfo.title,
description: seoInfo.description,
pagePath,
};
createPageFunction({
path: `/recipes/${pagePath}`,
path: `${pagePath}`,
component: template,
context: {
food,
Expand All @@ -61,9 +70,11 @@ const createNutritionTable = ({ createPageFunction, foods }: any) => {
});
ffSearchIndex.push({
name: food.name,
hap_name: foodName,
category: food.category,
url: `/${pagePath}`,
});
}
});
writeJsonToFile(`${indexFileName}.json`, ffSearchIndex);
};
2 changes: 2 additions & 0 deletions src/helpers/forkfacts-recent-searches.ts
Expand Up @@ -6,6 +6,7 @@ interface DBData extends DBSchema {
value: {
timestamp: Date;
name: string;
hap_name: string;
category: string;
searchLocation: string;
searchId?: string;
Expand All @@ -17,6 +18,7 @@ interface DBData extends DBSchema {

export interface SearchParams {
name: string;
hap_name: string;
category: string;
timestamp: Date;
searchLocation: string;
Expand Down
10 changes: 10 additions & 0 deletions src/helpers/shared.ts
@@ -0,0 +1,10 @@
import * as fs from "fs";

const ARTIFACT_PATH = ".raw";
export const writeJsonToFile = (fileName: string, jsonData: any[]) => {
if (!fs.existsSync(ARTIFACT_PATH)) fs.mkdirSync(ARTIFACT_PATH);
fs.writeFile(`${ARTIFACT_PATH}/${fileName}`, JSON.stringify(jsonData), (err: any) => {
if (err) throw err;
console.log(`Done writing to file ${fileName}`);
});
};
1 change: 1 addition & 0 deletions src/models/components.d.ts
Expand Up @@ -5,6 +5,7 @@ import { SVGProps } from "react";

export interface SearchResultItemType {
name: string;
hap_name: string;
url: string;
image: string;
category: string;
Expand Down
1 change: 1 addition & 0 deletions src/models/pages.d.ts
Expand Up @@ -76,6 +76,7 @@ export type NutrientItem = {
export interface Food {
category: string;
name: string;
hap_name: string;
fdcId: number;
nutrients: {
amount: number;
Expand Down
2 changes: 1 addition & 1 deletion src/templates/DetailsPage.tsx
Expand Up @@ -202,7 +202,7 @@ const DetailsPageTemplate = ({ pageContext }: PageProps) => {
menuItems={menuItems}
foodsWithSameNames={[]}
foodOverview={{
name: food.name,
name: food.hap_name !== "" ? food.hap_name : food.name, // todo: changes when SR Legacy has updated name
category: food.category,
}}
tabItems={tabItems}
Expand Down
Binary file removed static/homeImg.png
Binary file not shown.

1 comment on commit b87487e

@vercel
Copy link

@vercel vercel bot commented on b87487e May 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.