chore: build
This commit is contained in:
@@ -73,6 +73,9 @@ export default function ProfilePage() {
|
||||
const [twoFAAdminEnabled, setTwoFAAdminEnabled] = useState(false);
|
||||
const [twoFALoading, setTwoFALoading] = useState(false);
|
||||
|
||||
// SAV Telegram
|
||||
const [savTelegramUrl, setSavTelegramUrl] = useState("");
|
||||
|
||||
// Modals confirmation
|
||||
const [showSaveModal, setShowSaveModal] = useState(false);
|
||||
const [showConfirmAddressModal, setShowConfirmAddressModal] =
|
||||
@@ -100,6 +103,14 @@ export default function ProfilePage() {
|
||||
([status, pub]) => {
|
||||
setTwoFAEnabled(status.two_fa_enabled);
|
||||
setTwoFAAdminEnabled(pub.two_fa_enabled);
|
||||
if (pub.contact_telegram) {
|
||||
const ct = pub.contact_telegram;
|
||||
setSavTelegramUrl(
|
||||
ct.startsWith("http")
|
||||
? ct
|
||||
: `https://t.me/${ct.replace(/^@/, "")}`,
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
@@ -422,6 +433,33 @@ export default function ProfilePage() {
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Section SAV Telegram */}
|
||||
{savTelegramUrl && (
|
||||
<div className="profile-card">
|
||||
<h2 className="profile-card-title">
|
||||
<FontAwesomeIcon
|
||||
icon={faPaperPlane}
|
||||
className="profile-card-icon profile-card-icon--telegram"
|
||||
/>
|
||||
Contacter le SAV
|
||||
</h2>
|
||||
<p className="profile-hint">
|
||||
Un problème avec votre commande ? Contactez notre
|
||||
service après-vente directement sur Telegram.
|
||||
</p>
|
||||
<a
|
||||
href={savTelegramUrl}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="profile-btn profile-btn--telegram"
|
||||
style={{ textDecoration: "none" }}
|
||||
>
|
||||
<FontAwesomeIcon icon={faPaperPlane} /> Contacter
|
||||
le SAV sur Telegram
|
||||
</a>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Section 2FA — visible uniquement si l'admin l'a activé ET Telegram est lié */}
|
||||
{twoFAAdminEnabled && tgLinked && (
|
||||
<div className="profile-card">
|
||||
|
||||
@@ -67,6 +67,9 @@ export default function ProfileScreen() {
|
||||
const [twoFAAdminEnabled, setTwoFAAdminEnabled] = useState(false);
|
||||
const [twoFALoading, setTwoFALoading] = useState(false);
|
||||
|
||||
// SAV Telegram
|
||||
const [savTelegramUrl, setSavTelegramUrl] = useState("");
|
||||
|
||||
// Modals confirmation sauvegarde
|
||||
const [showSaveModal, setShowSaveModal] = useState(false);
|
||||
const [showConfirmContactModal, setShowConfirmContactModal] =
|
||||
@@ -120,6 +123,14 @@ export default function ProfileScreen() {
|
||||
setTelegramEnabled(tgStatus.enabled);
|
||||
setTwoFAEnabled(twoFAStatus.two_fa_enabled);
|
||||
setTwoFAAdminEnabled(pubSettings.two_fa_enabled);
|
||||
if (pubSettings.contact_telegram) {
|
||||
const ct = pubSettings.contact_telegram;
|
||||
setSavTelegramUrl(
|
||||
ct.startsWith("http")
|
||||
? ct
|
||||
: `https://t.me/${ct.replace(/^@/, "")}`,
|
||||
);
|
||||
}
|
||||
|
||||
if (savedAddress !== null) setDefaultAddress(savedAddress);
|
||||
if (savedPhone !== null) setDefaultPhone(savedPhone);
|
||||
@@ -839,6 +850,42 @@ export default function ProfileScreen() {
|
||||
</View>
|
||||
)}
|
||||
|
||||
{/* Carte SAV Telegram */}
|
||||
{savTelegramUrl !== "" && (
|
||||
<View style={styles.card}>
|
||||
<View style={styles.cardTitle}>
|
||||
<Ionicons
|
||||
name="paper-plane-outline"
|
||||
size={18}
|
||||
color="#2AABEE"
|
||||
/>
|
||||
<Text style={styles.cardTitleText}>
|
||||
Contacter le SAV
|
||||
</Text>
|
||||
</View>
|
||||
<Text style={styles.hint}>
|
||||
Un problème avec votre commande ? Contactez notre
|
||||
service après-vente directement sur Telegram.
|
||||
</Text>
|
||||
<TouchableOpacity
|
||||
style={[
|
||||
styles.saveBtn,
|
||||
{ backgroundColor: "#2AABEE" },
|
||||
]}
|
||||
onPress={() => Linking.openURL(savTelegramUrl)}
|
||||
>
|
||||
<Ionicons
|
||||
name="paper-plane-outline"
|
||||
size={16}
|
||||
color="#fff"
|
||||
/>
|
||||
<Text style={styles.saveBtnText}>
|
||||
Contacter le SAV sur Telegram
|
||||
</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
)}
|
||||
|
||||
{/* Carte 2FA — visible uniquement si l'admin l'a activé ET Telegram est lié */}
|
||||
{twoFAAdminEnabled && telegramLinked && (
|
||||
<View style={styles.card}>
|
||||
|
||||
Reference in New Issue
Block a user