chore: add button in settings for restore color
Frontend Admin - EAS Build / build (push) Successful in 2h19m19s

This commit is contained in:
Nuxgrid
2026-07-30 10:10:23 +02:00
parent 45e8e75be9
commit 075dc45ca1
@@ -1156,9 +1156,25 @@ function CentralRewardSection({
);
}
// Palette violette d'origine de l'application (thème par défaut historique)
const ORIGINAL_THEME_COLORS = {
admin_color_primary: "#7c3aed",
admin_color_secondary: "#22d3ee",
admin_color_success: "#4ade80",
admin_color_danger: "#ef4444",
admin_color_warning: "#f59e0b",
client_color_primary: "#7c3aed",
client_color_secondary: "#22d3ee",
client_color_success: "#4ade80",
client_color_danger: "#ef4444",
client_color_warning: "#f59e0b",
client_title_gradient_from: "#a78bfa",
client_title_gradient_to: "#22d3ee",
} as const;
export default function SettingsScreen() {
const { colors, refreshColors } = useTheme();
const { alert, showError, showSuccess, hideAlert } = useAlert();
const { alert, showError, showSuccess, showConfirm, hideAlert } = useAlert();
const navigation = useNavigation();
const { width: screenWidth } = useWindowDimensions();
const inputMd = screenWidth < 380 ? 64 : 80;
@@ -2271,6 +2287,36 @@ export default function SettingsScreen() {
Personnalisez les couleurs de l'espace admin et de l'app client / site web.
</Text>
<TouchableOpacity
onPress={() => showConfirm(
"Restaurer le thème d'origine",
"Toutes les couleurs personnalisées seront remplacées par le violet de base des premières versions de l'application. Continuer ?",
() => {
setSettings((p) => ({ ...p, ...ORIGINAL_THEME_COLORS }));
},
"Restaurer",
"Annuler",
)}
style={{
flexDirection: "row",
alignItems: "center",
gap: spacing.xs,
marginHorizontal: spacing.l,
marginTop: spacing.m,
paddingVertical: spacing.s,
paddingHorizontal: spacing.m,
borderRadius: borderRadius.sm,
borderWidth: 1,
borderColor: "#7c3aed",
alignSelf: "flex-start",
}}
>
<Ionicons name="color-palette-outline" size={16} color="#7c3aed" />
<Text style={{ fontSize: fontSize.sm, color: "#7c3aed", fontWeight: "600" }}>
Restaurer les couleurs de base
</Text>
</TouchableOpacity>
{(["admin", "client"] as const).map((scope) => (
<View key={scope}>
<Text style={[s.rowLabel, { paddingHorizontal: spacing.l, paddingTop: spacing.l, paddingBottom: spacing.xs }]}>