File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed
Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -72,19 +72,21 @@ const IndexProducts = ({ products }) => {
7272 { onSale && (
7373 < div className = "flex justify-center" >
7474 < div className = "pt-1 text-gray-900" >
75- { variations && filteredVariantPrice ( price ) }
76- { ! variations && paddedPrice ( salePrice ) }
75+ { variations &&
76+ filteredVariantPrice ( paddedPrice ( price , 'kr' ) ) }
77+ { ! variations && paddedPrice ( salePrice , 'kr' ) }
7778 </ div >
7879 < div className = "pt-1 ml-2 text-gray-900 line-through" >
79- { variations && filteredVariantPrice ( price , 'right' ) }
80- { ! variations && paddedPrice ( regularPrice ) }
80+ { variations &&
81+ filteredVariantPrice ( paddedPrice ( price , 'kr' ) , 'right' ) }
82+ { ! variations && paddedPrice ( regularPrice , 'kr' ) }
8183 </ div >
8284 </ div >
8385 ) }
8486 { /* Display regular price when not on sale */ }
8587 { ! onSale && (
8688 < p className = "pt-1 text-center text-gray-900" >
87- { paddedPrice ( price ) }
89+ { paddedPrice ( price , 'kr' ) }
8890 </ p >
8991 ) }
9092 </ div >
Original file line number Diff line number Diff line change @@ -3,9 +3,11 @@ import { v4 as uuidv4 } from 'uuid';
33/**
44 * Add empty character after currency symbol
55 * @param {String } price The price string that we input
6+ * @param {String } symbol Currency symbol to add empty character/padding after
67 */
78
8- export const paddedPrice = ( price ) => price . split ( 'kr' ) . join ( 'kr ' ) ;
9+ export const paddedPrice = ( price , symbol ) =>
10+ price . split ( symbol ) . join ( `${ symbol } ` ) ;
911
1012/**
1113 * Shorten inputted string (usually product description) to a maximum of length
You can’t perform that action at this time.
0 commit comments