Fix wrong text color on primary buttons - 1.187 🚀
This commit is contained in:
parent
3544392002
commit
0592a9d695
|
@ -12,13 +12,14 @@ import { Button, Card, TouchableRipple } from "react-native-paper";
|
|||
import AppInput from "./AppInput";
|
||||
import { StackParams } from "./AppStack";
|
||||
import ConfirmDialog from "./ConfirmDialog";
|
||||
import PrimaryButton from "./PrimaryButton";
|
||||
import StackHeader from "./StackHeader";
|
||||
import { MARGIN, PADDING } from "./constants";
|
||||
import { getNow, planRepo, setRepo, settingsRepo } from "./db";
|
||||
import { DrawerParams } from "./drawer-params";
|
||||
import { fixNumeric } from "./fix-numeric";
|
||||
import GymSet, { defaultSet } from "./gym-set";
|
||||
import Settings from "./settings";
|
||||
import StackHeader from "./StackHeader";
|
||||
import { toast } from "./toast";
|
||||
|
||||
export default function EditExercise() {
|
||||
|
@ -189,14 +190,9 @@ export default function EditExercise() {
|
|||
</Button>
|
||||
)}
|
||||
</ScrollView>
|
||||
<Button
|
||||
disabled={!name}
|
||||
mode="contained"
|
||||
icon="content-save"
|
||||
onPress={save}
|
||||
>
|
||||
<PrimaryButton disabled={!name} icon="content-save" onPress={save}>
|
||||
Save
|
||||
</Button>
|
||||
</PrimaryButton>
|
||||
<ConfirmDialog
|
||||
title="Remove image"
|
||||
onOk={handleRemove}
|
||||
|
|
|
@ -20,6 +20,7 @@ import { fixNumeric } from "./fix-numeric";
|
|||
import Settings from "./settings";
|
||||
import StackHeader from "./StackHeader";
|
||||
import { toast } from "./toast";
|
||||
import PrimaryButton from "./PrimaryButton";
|
||||
|
||||
export default function EditExercises() {
|
||||
const { params } = useRoute<RouteProp<StackParams, "EditExercises">>();
|
||||
|
@ -187,14 +188,9 @@ export default function EditExercises() {
|
|||
</Button>
|
||||
)}
|
||||
</ScrollView>
|
||||
<Button
|
||||
disabled={!name}
|
||||
mode="contained"
|
||||
icon="content-save"
|
||||
onPress={update}
|
||||
>
|
||||
<PrimaryButton disabled={!name} icon="content-save" onPress={update}>
|
||||
Save
|
||||
</Button>
|
||||
</PrimaryButton>
|
||||
<ConfirmDialog
|
||||
title="Remove image"
|
||||
onOk={handleRemove}
|
||||
|
|
29
EditPlan.tsx
29
EditPlan.tsx
|
@ -8,7 +8,6 @@ import { useCallback, useEffect, useState } from "react";
|
|||
import { Pressable, StyleSheet, View } from "react-native";
|
||||
import {
|
||||
ActivityIndicator,
|
||||
Button,
|
||||
IconButton,
|
||||
Switch as PaperSwitch,
|
||||
Text,
|
||||
|
@ -18,13 +17,14 @@ import ReorderableList, {
|
|||
} from "react-native-reorderable-list";
|
||||
import AppInput from "./AppInput";
|
||||
import { StackParams } from "./AppStack";
|
||||
import PrimaryButton from "./PrimaryButton";
|
||||
import StackHeader from "./StackHeader";
|
||||
import Switch from "./Switch";
|
||||
import { MARGIN, PADDING } from "./constants";
|
||||
import { DAYS } from "./days";
|
||||
import { planRepo, setRepo } from "./db";
|
||||
import { DrawerParams } from "./drawer-params";
|
||||
import GymSet, { defaultSet } from "./gym-set";
|
||||
import StackHeader from "./StackHeader";
|
||||
import Switch from "./Switch";
|
||||
|
||||
export default function EditPlan() {
|
||||
const { params } = useRoute<RouteProp<StackParams, "EditPlan">>();
|
||||
|
@ -189,19 +189,18 @@ export default function EditPlan() {
|
|||
containerStyle={{ flex: 1 }}
|
||||
/>
|
||||
)}
|
||||
|
||||
<Button
|
||||
disabled={exercises.length === 0 && days.length === 0}
|
||||
mode="contained"
|
||||
icon="content-save"
|
||||
onPress={async () => {
|
||||
await save();
|
||||
drawerNavigate("Plans");
|
||||
}}
|
||||
>
|
||||
Save
|
||||
</Button>
|
||||
</View>
|
||||
|
||||
<PrimaryButton
|
||||
disabled={exercises.length === 0 && days.length === 0}
|
||||
icon="content-save"
|
||||
onPress={async () => {
|
||||
await save();
|
||||
drawerNavigate("Plans");
|
||||
}}
|
||||
>
|
||||
Save
|
||||
</PrimaryButton>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@ import Select from "./Select";
|
|||
import Settings from "./settings";
|
||||
import StackHeader from "./StackHeader";
|
||||
import { toast } from "./toast";
|
||||
import PrimaryButton from "./PrimaryButton";
|
||||
|
||||
export default function EditSet() {
|
||||
const { params } = useRoute<RouteProp<StackParams, "EditSet">>();
|
||||
|
@ -340,15 +341,14 @@ export default function EditSet() {
|
|||
)}
|
||||
</View>
|
||||
|
||||
<Button
|
||||
<PrimaryButton
|
||||
disabled={!name}
|
||||
mode="contained"
|
||||
icon="content-save"
|
||||
style={{ margin: MARGIN }}
|
||||
onPress={handleSubmit}
|
||||
>
|
||||
Save
|
||||
</Button>
|
||||
</PrimaryButton>
|
||||
|
||||
<ConfirmDialog
|
||||
title="Remove image"
|
||||
|
|
10
EditSets.tsx
10
EditSets.tsx
|
@ -13,13 +13,14 @@ import { In } from "typeorm";
|
|||
import AppInput from "./AppInput";
|
||||
import { StackParams } from "./AppStack";
|
||||
import ConfirmDialog from "./ConfirmDialog";
|
||||
import Select from "./Select";
|
||||
import StackHeader from "./StackHeader";
|
||||
import { MARGIN, PADDING } from "./constants";
|
||||
import { setRepo, settingsRepo } from "./db";
|
||||
import { DrawerParams } from "./drawer-params";
|
||||
import GymSet from "./gym-set";
|
||||
import Select from "./Select";
|
||||
import Settings from "./settings";
|
||||
import StackHeader from "./StackHeader";
|
||||
import PrimaryButton from "./PrimaryButton";
|
||||
|
||||
export default function EditSets() {
|
||||
const { params } = useRoute<RouteProp<StackParams, "EditSets">>();
|
||||
|
@ -181,14 +182,13 @@ export default function EditSets() {
|
|||
)}
|
||||
</View>
|
||||
|
||||
<Button
|
||||
mode="contained"
|
||||
<PrimaryButton
|
||||
icon="content-save"
|
||||
style={{ margin: MARGIN }}
|
||||
onPress={save}
|
||||
>
|
||||
Save
|
||||
</Button>
|
||||
</PrimaryButton>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -9,17 +9,18 @@ import {
|
|||
import { format } from "date-fns";
|
||||
import { useCallback, useRef, useState } from "react";
|
||||
import { TextInput, View } from "react-native";
|
||||
import { Button, IconButton } from "react-native-paper";
|
||||
import { IconButton } from "react-native-paper";
|
||||
import AppInput from "./AppInput";
|
||||
import { StackParams } from "./AppStack";
|
||||
import ConfirmDialog from "./ConfirmDialog";
|
||||
import PrimaryButton from "./PrimaryButton";
|
||||
import Select from "./Select";
|
||||
import StackHeader from "./StackHeader";
|
||||
import { MARGIN, PADDING } from "./constants";
|
||||
import { AppDataSource } from "./data-source";
|
||||
import { getNow, settingsRepo, weightRepo } from "./db";
|
||||
import { DrawerParams } from "./drawer-params";
|
||||
import Select from "./Select";
|
||||
import Settings from "./settings";
|
||||
import StackHeader from "./StackHeader";
|
||||
import { toast } from "./toast";
|
||||
import Weight from "./weight";
|
||||
|
||||
|
@ -149,15 +150,14 @@ export default function EditWeight() {
|
|||
)}
|
||||
</View>
|
||||
|
||||
<Button
|
||||
<PrimaryButton
|
||||
disabled={!value}
|
||||
mode="contained"
|
||||
icon="content-save"
|
||||
style={{ margin: MARGIN }}
|
||||
onPress={submit}
|
||||
>
|
||||
Save
|
||||
</Button>
|
||||
</PrimaryButton>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
import { ComponentProps } from "react";
|
||||
import { Button, useTheme } from "react-native-paper";
|
||||
|
||||
type PrimaryButtonProps = Omit<Partial<ComponentProps<typeof Button>>, "mode">;
|
||||
|
||||
export default function PrimaryButton(props: PrimaryButtonProps) {
|
||||
const { colors } = useTheme();
|
||||
|
||||
return (
|
||||
<Button mode="contained" textColor={colors.background} {...props}>
|
||||
{props.children}
|
||||
</Button>
|
||||
);
|
||||
}
|
|
@ -12,6 +12,7 @@ import {
|
|||
Button,
|
||||
IconButton,
|
||||
ProgressBar,
|
||||
useTheme,
|
||||
} from "react-native-paper";
|
||||
import { check, PERMISSIONS, request, RESULTS } from "react-native-permissions";
|
||||
import AppInput from "./AppInput";
|
||||
|
@ -29,6 +30,7 @@ import Settings from "./settings";
|
|||
import StackHeader from "./StackHeader";
|
||||
import StartPlanItem from "./StartPlanItem";
|
||||
import { toast } from "./toast";
|
||||
import PrimaryButton from "./PrimaryButton";
|
||||
|
||||
export default function StartPlan() {
|
||||
const { params } = useRoute<RouteProp<StackParams, "StartPlan">>();
|
||||
|
@ -38,6 +40,7 @@ export default function StartPlan() {
|
|||
const [selected, setSelected] = useState(0);
|
||||
const [settings, setSettings] = useState<Settings>();
|
||||
const [counts, setCounts] = useState<CountMany[]>();
|
||||
const { colors } = useTheme();
|
||||
const weightRef = useRef<TextInput>(null);
|
||||
const repsRef = useRef<TextInput>(null);
|
||||
const exercises = useMemo(() => params.plan.exercises.split(","), [params]);
|
||||
|
@ -241,9 +244,9 @@ export default function StartPlan() {
|
|||
/>
|
||||
)}
|
||||
</View>
|
||||
<Button mode="contained" icon="content-save" onPress={handleSubmit}>
|
||||
<PrimaryButton icon="content-save" onPress={handleSubmit}>
|
||||
Save
|
||||
</Button>
|
||||
</PrimaryButton>
|
||||
</View>
|
||||
</>
|
||||
);
|
||||
|
|
|
@ -85,8 +85,8 @@ android {
|
|||
applicationId "com.massive"
|
||||
minSdkVersion rootProject.ext.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||
versionCode 36212
|
||||
versionName "1.186"
|
||||
versionCode 36213
|
||||
versionName "1.187"
|
||||
}
|
||||
signingConfigs {
|
||||
release {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "massive",
|
||||
"version": "1.186",
|
||||
"version": "1.187",
|
||||
"private": true,
|
||||
"license": "GPL-3.0-only",
|
||||
"scripts": {
|
||||
|
|
Loading…
Reference in New Issue