chore: build
This commit is contained in:
@@ -5,6 +5,8 @@ import { useNavigate } from "react-router-dom";
|
|||||||
import { isUserAuthenticated, getProductById, getMediaUrl } from "../../api/api";
|
import { isUserAuthenticated, getProductById, getMediaUrl } from "../../api/api";
|
||||||
import type { Product } from "../../api/api";
|
import type { Product } from "../../api/api";
|
||||||
import { Trash2, ShoppingCart, AlertTriangle, Leaf, X } from "lucide-react";
|
import { Trash2, ShoppingCart, AlertTriangle, Leaf, X } from "lucide-react";
|
||||||
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
|
import { faGift } from "@fortawesome/free-solid-svg-icons";
|
||||||
import "./Cart.css";
|
import "./Cart.css";
|
||||||
|
|
||||||
interface CartItemWithMedia {
|
interface CartItemWithMedia {
|
||||||
@@ -180,8 +182,9 @@ function Cart() {
|
|||||||
<p className="cart-row-name">
|
<p className="cart-row-name">
|
||||||
{item.name_product}
|
{item.name_product}
|
||||||
{item.is_reward && (
|
{item.is_reward && (
|
||||||
<span style={{ marginLeft: "6px", fontSize: "0.7rem", fontWeight: 700, color: "#f59e0b", background: "rgba(245,158,11,0.12)", borderRadius: "4px", padding: "1px 6px" }}>
|
<span style={{ display: "inline-flex", alignItems: "center", gap: "4px", marginLeft: "6px", fontSize: "0.7rem", fontWeight: 700, color: "#f59e0b", background: "rgba(245,158,11,0.12)", borderRadius: "4px", padding: "1px 6px" }}>
|
||||||
🎁 Récompense
|
<FontAwesomeIcon icon={faGift} />
|
||||||
|
Récompense
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ function ConsultationHistorique() {
|
|||||||
if (res.success) {
|
if (res.success) {
|
||||||
const text =
|
const text =
|
||||||
res.product_added && res.product_names?.length
|
res.product_added && res.product_names?.length
|
||||||
? `🎁 ${res.product_names.join(", ")} ajouté${res.product_names.length > 1 ? "s" : ""} à votre panier ! Commandez au moins un produit pour en profiter.`
|
? `${res.product_names.join(", ")} ajouté${res.product_names.length > 1 ? "s" : ""} à votre panier ! Commandez au moins un produit pour en profiter.`
|
||||||
: res.description || "Récompense réclamée !";
|
: res.description || "Récompense réclamée !";
|
||||||
setClaimFeedback({ pool: poolKey, type: "success", text });
|
setClaimFeedback({ pool: poolKey, type: "success", text });
|
||||||
getMyPointsRewards().then((r) => {
|
getMyPointsRewards().then((r) => {
|
||||||
@@ -505,6 +505,15 @@ function ConsultationHistorique() {
|
|||||||
<p
|
<p
|
||||||
className={`reward-feedback reward-feedback-${feedback.type}`}
|
className={`reward-feedback reward-feedback-${feedback.type}`}
|
||||||
>
|
>
|
||||||
|
{feedback.type ===
|
||||||
|
"success" && (
|
||||||
|
<FontAwesomeIcon
|
||||||
|
icon={faGift}
|
||||||
|
style={{
|
||||||
|
marginRight: 6,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
{feedback.text}
|
{feedback.text}
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ export default function OrderHistoryScreen() {
|
|||||||
if (res.success) {
|
if (res.success) {
|
||||||
const text =
|
const text =
|
||||||
res.product_added && res.product_name
|
res.product_added && res.product_name
|
||||||
? `🎁 ${res.product_name} ajouté à votre panier ! Commandez au moins un produit pour en profiter.`
|
? `${res.product_name} ajouté à votre panier ! Commandez au moins un produit pour en profiter.`
|
||||||
: res.description || "Récompense réclamée !";
|
: res.description || "Récompense réclamée !";
|
||||||
setClaimFeedback({ pool: poolKey, type: "success", text });
|
setClaimFeedback({ pool: poolKey, type: "success", text });
|
||||||
getMyPointsRewards().then((r) => {
|
getMyPointsRewards().then((r) => {
|
||||||
@@ -882,6 +882,23 @@ export default function OrderHistoryScreen() {
|
|||||||
: `Encore ${remaining} pts pour une récompense`}
|
: `Encore ${remaining} pts pour une récompense`}
|
||||||
</Text>
|
</Text>
|
||||||
{feedback && (
|
{feedback && (
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
flexDirection:
|
||||||
|
"row",
|
||||||
|
alignItems:
|
||||||
|
"center",
|
||||||
|
gap: 4,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{feedback.type ===
|
||||||
|
"success" && (
|
||||||
|
<Ionicons
|
||||||
|
name="gift-outline"
|
||||||
|
size={12}
|
||||||
|
color="#10b981"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
<Text
|
<Text
|
||||||
style={
|
style={
|
||||||
feedback.type ===
|
feedback.type ===
|
||||||
@@ -892,6 +909,7 @@ export default function OrderHistoryScreen() {
|
|||||||
>
|
>
|
||||||
{feedback.text}
|
{feedback.text}
|
||||||
</Text>
|
</Text>
|
||||||
|
</View>
|
||||||
)}
|
)}
|
||||||
{pool.rewards_available > 0 && (
|
{pool.rewards_available > 0 && (
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
|
|||||||
Reference in New Issue
Block a user