-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(core): cart page fragment colocation (#830)
- Loading branch information
Showing
20 changed files
with
225 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
16 changes: 16 additions & 0 deletions
16
apps/core/app/[locale]/(default)/cart/_components/coupon-code/fragment.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { graphql } from '~/client/graphql'; | ||
|
||
export const CouponCodeFragment = graphql(` | ||
fragment CouponCodeFragment on Checkout { | ||
entityId | ||
coupons { | ||
code | ||
discountedAmount { | ||
value | ||
} | ||
} | ||
cart { | ||
currencyCode | ||
} | ||
} | ||
`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
apps/core/app/[locale]/(default)/cart/_components/shipping-estimator/fragment.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { graphql } from '~/client/graphql'; | ||
|
||
import { ShippingInfoFragment } from '../shipping-info/fragment'; | ||
import { ShippingOptionsFragment } from '../shipping-options/fragment'; | ||
|
||
export const ShippingEstimatorFragment = graphql( | ||
` | ||
fragment ShippingEstimatorFragment on Checkout { | ||
...ShippingInfoFragment | ||
entityId | ||
shippingConsignments { | ||
...ShippingOptionsFragment | ||
selectedShippingOption { | ||
entityId | ||
description | ||
} | ||
} | ||
handlingCostTotal { | ||
value | ||
} | ||
shippingCostTotal { | ||
currencyCode | ||
value | ||
} | ||
cart { | ||
currencyCode | ||
} | ||
} | ||
`, | ||
[ShippingOptionsFragment, ShippingInfoFragment], | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
apps/core/app/[locale]/(default)/cart/_components/shipping-info/fragment.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { graphql } from '~/client/graphql'; | ||
|
||
export const ShippingInfoFragment = graphql(` | ||
fragment ShippingInfoFragment on Checkout { | ||
entityId | ||
shippingConsignments { | ||
entityId | ||
selectedShippingOption { | ||
entityId | ||
} | ||
address { | ||
city | ||
countryCode | ||
stateOrProvince | ||
postalCode | ||
} | ||
} | ||
cart { | ||
lineItems { | ||
physicalItems { | ||
entityId | ||
quantity | ||
} | ||
} | ||
} | ||
} | ||
`); |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
15 changes: 15 additions & 0 deletions
15
apps/core/app/[locale]/(default)/cart/_components/shipping-options/fragment.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { graphql } from '~/client/graphql'; | ||
|
||
export const ShippingOptionsFragment = graphql(` | ||
fragment ShippingOptionsFragment on CheckoutShippingConsignment { | ||
entityId | ||
availableShippingOptions { | ||
cost { | ||
value | ||
} | ||
description | ||
entityId | ||
isRecommended | ||
} | ||
} | ||
`); |
Oops, something went wrong.