From 0a047a4e8780bb984a3fdf93128980c9bebcae16 Mon Sep 17 00:00:00 2001 From: Janus Reith Date: Sun, 29 Mar 2020 12:16:39 +0200 Subject: [PATCH] add remaining statc props #2 Signed-off-by: Janus Reith --- pages/cart/checkout.js | 4 +++- pages/cart/login.js | 4 +++- pages/checkout/order/[orderId].js | 12 ++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/pages/cart/checkout.js b/pages/cart/checkout.js index a76ce12ef4..8ef8800450 100644 --- a/pages/cart/checkout.js +++ b/pages/cart/checkout.js @@ -19,6 +19,7 @@ import useTranslation from "hooks/useTranslation"; import definedPaymentMethods from "custom/paymentMethods"; import fetchPrimaryShop from "staticUtils/shop/fetchPrimaryShop"; +import fetchAllTags from "staticUtils/tags/fetchAllTags"; const useStyles = makeStyles((theme) => ({ checkoutActions: { @@ -212,7 +213,8 @@ Checkout.propTypes = { export async function getStaticProps() { return { props: { - ...await fetchPrimaryShop() + ...await fetchPrimaryShop("en"), + ...await fetchAllTags() } }; } diff --git a/pages/cart/login.js b/pages/cart/login.js index 1ed9ed56ae..c691d2183a 100644 --- a/pages/cart/login.js +++ b/pages/cart/login.js @@ -13,6 +13,7 @@ import useShop from "hooks/shop/useShop"; import useTranslation from "hooks/useTranslation"; import fetchPrimaryShop from "staticUtils/shop/fetchPrimaryShop"; +import fetchAllTags from "staticUtils/tags/fetchAllTags"; const useStyles = makeStyles((theme) => ({ checkoutActions: { @@ -124,7 +125,8 @@ Login.propTypes = { export async function getStaticProps() { return { props: { - ...await fetchPrimaryShop() + ...await fetchPrimaryShop("en"), + ...await fetchAllTags() } }; } diff --git a/pages/checkout/order/[orderId].js b/pages/checkout/order/[orderId].js index ef84800a96..3d6a235987 100644 --- a/pages/checkout/order/[orderId].js +++ b/pages/checkout/order/[orderId].js @@ -10,6 +10,9 @@ import withOrder from "containers/order/withOrder"; import OrderCard from "components/OrderCard"; import { withApollo } from "lib/apollo/withApollo"; +import fetchPrimaryShop from "staticUtils/shop/fetchPrimaryShop"; +import fetchAllTags from "staticUtils/tags/fetchAllTags"; + const styles = (theme) => ({ orderThankYou: { marginBottom: theme.spacing(3) @@ -80,4 +83,13 @@ class CheckoutComplete extends Component { } } +export async function getStaticProps() { + return { + props: { + ...await fetchPrimaryShop("en"), + ...await fetchAllTags() + } + }; +} + export default withApollo()(withOrder(withStyles(styles, { withTheme: true })(CheckoutComplete)));