chore: update
This commit is contained in:
@@ -29,6 +29,7 @@ function TiersSection({
|
||||
colors,
|
||||
s,
|
||||
accentColor,
|
||||
active,
|
||||
}: {
|
||||
title: string;
|
||||
tiers: PointsTier[];
|
||||
@@ -36,6 +37,7 @@ function TiersSection({
|
||||
colors: any;
|
||||
s: any;
|
||||
accentColor: string;
|
||||
active: boolean;
|
||||
}) {
|
||||
const updateTier = (i: number, field: keyof PointsTier, raw: string) => {
|
||||
const val = field === "points" ? parseInt(raw, 10) : parseFloat(raw);
|
||||
@@ -54,7 +56,22 @@ function TiersSection({
|
||||
|
||||
return (
|
||||
<View style={s.section}>
|
||||
<Text style={s.sectionTitle}>{title}</Text>
|
||||
<View style={{ flexDirection: "row", alignItems: "center", justifyContent: "space-between", paddingRight: spacing.l }}>
|
||||
<Text style={s.sectionTitle}>{title}</Text>
|
||||
<View style={{
|
||||
paddingHorizontal: spacing.s,
|
||||
paddingVertical: 2,
|
||||
borderRadius: 10,
|
||||
backgroundColor: active ? accentColor + "25" : colors.border + "40",
|
||||
borderWidth: 1,
|
||||
borderColor: active ? accentColor : colors.border,
|
||||
marginBottom: spacing.s,
|
||||
}}>
|
||||
<Text style={{ fontSize: fontSize.xs, fontWeight: "700", color: active ? accentColor : colors.textMuted }}>
|
||||
{active ? "Actif" : "Ignoré"}
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
<Text style={s.hint}>
|
||||
Définissez chaque palier : de X€ à Y€ = N points.{"\n"}
|
||||
Max = 0 signifie illimité (pas de borne supérieure).
|
||||
@@ -319,10 +336,8 @@ export default function SettingsScreen() {
|
||||
const ZIP_COLOR = "#9333ea";
|
||||
const TOTAL_COLOR = "#f97316";
|
||||
|
||||
// Chips disponibles selon le mode
|
||||
const availableChips: PoolAssignment[] = settings.points_separated
|
||||
? ["weed", "zipette", "none"] // mode séparé : T désactivé
|
||||
: ["total", "none"]; // mode non-séparé : W/Z désactivés
|
||||
// Tous les chips toujours disponibles — la config reste modifiable à tout moment
|
||||
const allChips: PoolAssignment[] = ["weed", "zipette", "total", "none"];
|
||||
|
||||
return (
|
||||
<View style={s.container}>
|
||||
@@ -430,29 +445,25 @@ export default function SettingsScreen() {
|
||||
<Text style={s.sectionTitle}>Attribution des catégories aux points</Text>
|
||||
<Text style={s.hint}>
|
||||
{settings.points_separated
|
||||
? "Mode séparé : W = pool Weed, Z = pool Zipette."
|
||||
: "Mode non-séparé : T = pool Total (barème sur W+Z). W et Z désactivés."}
|
||||
? "Mode séparé actif : W et Z utilisés pour le calcul. T ignoré."
|
||||
: "Mode non-séparé actif : T utilisé pour le calcul. W et Z ignorés."}
|
||||
{"\n"}Vous pouvez modifier les attributions à tout moment.
|
||||
</Text>
|
||||
|
||||
{/* Légende */}
|
||||
<View style={{ flexDirection: "row", gap: spacing.m, paddingHorizontal: spacing.l, paddingBottom: spacing.m, flexWrap: "wrap" }}>
|
||||
{settings.points_separated ? (
|
||||
<>
|
||||
<View style={{ flexDirection: "row", alignItems: "center", gap: spacing.xs }}>
|
||||
<View style={[s.colorDot, { backgroundColor: WEED_COLOR }]} />
|
||||
<Text style={{ fontSize: fontSize.sm, color: colors.textMuted }}>Weed</Text>
|
||||
</View>
|
||||
<View style={{ flexDirection: "row", alignItems: "center", gap: spacing.xs }}>
|
||||
<View style={[s.colorDot, { backgroundColor: ZIP_COLOR }]} />
|
||||
<Text style={{ fontSize: fontSize.sm, color: colors.textMuted }}>Zipette</Text>
|
||||
</View>
|
||||
</>
|
||||
) : (
|
||||
<View style={{ flexDirection: "row", alignItems: "center", gap: spacing.xs }}>
|
||||
<View style={[s.colorDot, { backgroundColor: TOTAL_COLOR }]} />
|
||||
<Text style={{ fontSize: fontSize.sm, color: colors.textMuted }}>Total</Text>
|
||||
</View>
|
||||
)}
|
||||
<View style={{ flexDirection: "row", alignItems: "center", gap: spacing.xs }}>
|
||||
<View style={[s.colorDot, { backgroundColor: WEED_COLOR }]} />
|
||||
<Text style={{ fontSize: fontSize.sm, color: colors.textMuted }}>Weed</Text>
|
||||
</View>
|
||||
<View style={{ flexDirection: "row", alignItems: "center", gap: spacing.xs }}>
|
||||
<View style={[s.colorDot, { backgroundColor: ZIP_COLOR }]} />
|
||||
<Text style={{ fontSize: fontSize.sm, color: colors.textMuted }}>Zipette</Text>
|
||||
</View>
|
||||
<View style={{ flexDirection: "row", alignItems: "center", gap: spacing.xs }}>
|
||||
<View style={[s.colorDot, { backgroundColor: TOTAL_COLOR }]} />
|
||||
<Text style={{ fontSize: fontSize.sm, color: colors.textMuted }}>Total</Text>
|
||||
</View>
|
||||
<View style={{ flexDirection: "row", alignItems: "center", gap: spacing.xs }}>
|
||||
<View style={[s.colorDot, { backgroundColor: colors.border }]} />
|
||||
<Text style={{ fontSize: fontSize.sm, color: colors.textMuted }}>Aucun</Text>
|
||||
@@ -474,7 +485,7 @@ export default function SettingsScreen() {
|
||||
/>
|
||||
<Text style={s.catName}>{cat.name}</Text>
|
||||
<View style={s.chips}>
|
||||
{availableChips.map((p) => {
|
||||
{allChips.map((p) => {
|
||||
const active = pool === p;
|
||||
const chipColor =
|
||||
p === "weed"
|
||||
@@ -541,6 +552,7 @@ export default function SettingsScreen() {
|
||||
colors={colors}
|
||||
s={s}
|
||||
accentColor={WEED_COLOR}
|
||||
active={settings.points_separated}
|
||||
/>
|
||||
<TiersSection
|
||||
title="Barème Zipette"
|
||||
@@ -549,6 +561,7 @@ export default function SettingsScreen() {
|
||||
colors={colors}
|
||||
s={s}
|
||||
accentColor={ZIP_COLOR}
|
||||
active={settings.points_separated}
|
||||
/>
|
||||
<TiersSection
|
||||
title="Barème Total"
|
||||
@@ -557,6 +570,7 @@ export default function SettingsScreen() {
|
||||
colors={colors}
|
||||
s={s}
|
||||
accentColor={TOTAL_COLOR}
|
||||
active={!settings.points_separated}
|
||||
/>
|
||||
|
||||
<TouchableOpacity
|
||||
|
||||
Reference in New Issue
Block a user