ordering-ui-react-native 0.15.46 → 0.15.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-react-native",
3
- "version": "0.15.46",
3
+ "version": "0.15.47",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -446,7 +446,7 @@ export const ProductOptionsUI = (props: any) => {
446
446
  </WrapperIngredients>
447
447
  </View>
448
448
  )}
449
- {product?.extras.map((extra: any) => extra.options.map((option: any) => {
449
+ {product?.extras.map((extra: any) => extra.options.sort((a: any, b: any) => a.rank - b.rank).map((option: any) => {
450
450
  const currentState = productCart.options[`id:${option.id}`] || {}
451
451
  return (
452
452
  <React.Fragment key={option.id}>
@@ -460,7 +460,7 @@ export const ProductOptionsUI = (props: any) => {
460
460
  >
461
461
  <WrapperSubOption style={{ backgroundColor: isError(option.id) }}>
462
462
  {
463
- option.suboptions.map((suboption: any) => {
463
+ option.suboptions.sort((a: any, b: any) => a.rank - b.rank).map((suboption: any) => {
464
464
  const currentState = productCart.options[`id:${option.id}`]?.suboptions[`id:${suboption.id}`] || {}
465
465
  const balance = productCart.options[`id:${option.id}`]?.balance || 0
466
466
  return (
@@ -695,7 +695,7 @@ export const ProductOptionsUI = (props: any) => {
695
695
  </View>
696
696
  )}
697
697
  {product?.extras.map((extra: any) =>
698
- extra.options.map((option: any) => {
698
+ extra.options.sort((a: any, b: any) => a.rank - b.rank).map((option: any) => {
699
699
  const currentState =
700
700
  productCart.options[`id:${option.id}`] || {};
701
701
  return (
@@ -711,7 +711,7 @@ export const ProductOptionsUI = (props: any) => {
711
711
  backgroundColor: isError(option.id),
712
712
  borderRadius: 7.6
713
713
  }}>
714
- {option.suboptions.map(
714
+ {option.suboptions.sort((a: any, b: any) => a.rank - b.rank).map(
715
715
  (suboption: any) => {
716
716
  const currentState =
717
717
  productCart.options[
@@ -779,7 +779,7 @@ export const ProductOptionsUI = (props: any) => {
779
779
  ) : (
780
780
  <>
781
781
  {product?.extras.map((extra: any) =>
782
- extra.options.map((option: any) => {
782
+ extra.options.sort((a: any, b: any) => a.rank - b.rank).map((option: any) => {
783
783
  if (
784
784
  option.id == selOpt ||
785
785
  (hasRespected(
@@ -804,7 +804,7 @@ export const ProductOptionsUI = (props: any) => {
804
804
  option.id,
805
805
  ),
806
806
  }}>
807
- {option.suboptions.map(
807
+ {option.suboptions.sort((a: any, b: any) => a.rank - b.rank).map(
808
808
  (suboption: any) => {
809
809
  const currentState =
810
810
  productCart.options[