chore: add button in settings for restore color
Frontend Admin - EAS Build / build (push) Successful in 2h19m19s
Frontend Admin - EAS Build / build (push) Successful in 2h19m19s
This commit is contained in:
@@ -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() {
|
export default function SettingsScreen() {
|
||||||
const { colors, refreshColors } = useTheme();
|
const { colors, refreshColors } = useTheme();
|
||||||
const { alert, showError, showSuccess, hideAlert } = useAlert();
|
const { alert, showError, showSuccess, showConfirm, hideAlert } = useAlert();
|
||||||
const navigation = useNavigation();
|
const navigation = useNavigation();
|
||||||
const { width: screenWidth } = useWindowDimensions();
|
const { width: screenWidth } = useWindowDimensions();
|
||||||
const inputMd = screenWidth < 380 ? 64 : 80;
|
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.
|
Personnalisez les couleurs de l'espace admin et de l'app client / site web.
|
||||||
</Text>
|
</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) => (
|
{(["admin", "client"] as const).map((scope) => (
|
||||||
<View key={scope}>
|
<View key={scope}>
|
||||||
<Text style={[s.rowLabel, { paddingHorizontal: spacing.l, paddingTop: spacing.l, paddingBottom: spacing.xs }]}>
|
<Text style={[s.rowLabel, { paddingHorizontal: spacing.l, paddingTop: spacing.l, paddingBottom: spacing.xs }]}>
|
||||||
|
|||||||
Reference in New Issue
Block a user