Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GEN-637 - feat: added a service to retrieve Trustpilot data (#2705)
## Describe your changes * Adds a `TrustpilotBlock` that displays _Trustpilot_ data. How the whole thing works: 1. Real data is stored in store's [_Edge Config_ storage](https://vercel.com/hedvig/hedvig-dot-com/stores/edge-config/ecfg_viia3ntdquafelygrc3g6lfs3d2a/items#item=trustpilot); 2. This PR will set a cron job that's going to update it every Monday at 8:00 (just picked that number. Gonna double check if that's enough) - check `apps/store/vercel.json` and `apps/store/src/pages/api/cron/trustpilot.ts` files 3. There's a new service - `apps/store/src/services/trustpilot/trustpilot.tsx` - which is responsible to provide a way to retrieve that data from the storage. It also gonna store it in a Jotai's atom so it can be available in the whole app. We then fetch that data and proper hydrate the atom in the `apps/store/src/pages/[[...slug]].tsx` and `apps/store/src/components/LayoutWithMenu/LayoutWithMenu.tsx` files respectively. 4. `TrustpilotBlock` then reads that data from the atom and proper display it. <img width="974" alt="Screenshot 2023-07-06 at 17 41 54" src="https://github.com/HedvigInsurance/racoon/assets/19200662/50d291c1-cbac-491b-b7ac-de9cc9c54d14"> ## Justify why they are needed Requested by design/editors Can be tested [here](https://hedvig-dot-com-git-gen-637-feattrustpilot-blocksplit2-hedvig.vercel.app/se/test-home?__vercel_draft=1)
- Loading branch information
e5bd5b3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
onboarding – ./apps/onboarding
onboarding-git-main-hedvig.vercel.app
onboarding-hedvig.vercel.app
racoon-onboarding.vercel.app
e5bd5b3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
hedvig-dot-com – ./apps/store
www.store.dev.hedvigit.com
store.dev.hedvigit.com
www.dev.hedvigit.com
www.hedvig.com
hedvig-dot-com-hedvig.vercel.app
hedvig.com
racoon-store-staging.vercel.app
racoon-store.vercel.app
www.new.hedvig.com
new.hedvig.com
hedvig-dot-com-git-main-hedvig.vercel.app