Skip to content

Commit

Permalink
add remaining statc props reactioncommerce#2
Browse files Browse the repository at this point in the history
Signed-off-by: Janus Reith <mail@janusreith.de>
  • Loading branch information
Janus Reith committed May 19, 2020
1 parent 0e53ac6 commit b26d0e8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
4 changes: 3 additions & 1 deletion pages/cart/checkout.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -212,7 +213,8 @@ Checkout.propTypes = {
export async function getStaticProps() {
return {
props: {
...await fetchPrimaryShop()
...await fetchPrimaryShop("en"),
...await fetchAllTags()
}
};
}
Expand Down
4 changes: 3 additions & 1 deletion pages/cart/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -124,7 +125,8 @@ Login.propTypes = {
export async function getStaticProps() {
return {
props: {
...await fetchPrimaryShop()
...await fetchPrimaryShop("en"),
...await fetchAllTags()
}
};
}
Expand Down
12 changes: 12 additions & 0 deletions pages/checkout/order/[orderId].js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)));

0 comments on commit b26d0e8

Please sign in to comment.