parent
1a75d8897d
commit
f1e0911488
20
ViewBest.tsx
20
ViewBest.tsx
|
@ -16,8 +16,8 @@ import Volume from './volume'
|
||||||
|
|
||||||
export default function ViewBest() {
|
export default function ViewBest() {
|
||||||
const {params} = useRoute<RouteProp<BestPageParams, 'ViewBest'>>()
|
const {params} = useRoute<RouteProp<BestPageParams, 'ViewBest'>>()
|
||||||
const [weights, setWeights] = useState<GymSet[]>([])
|
const [weights, setWeights] = useState<GymSet[]>()
|
||||||
const [volumes, setVolumes] = useState<Volume[]>([])
|
const [volumes, setVolumes] = useState<Volume[]>()
|
||||||
const [metric, setMetric] = useState(Metrics.Weight)
|
const [metric, setMetric] = useState(Metrics.Weight)
|
||||||
const [period, setPeriod] = useState(Periods.Monthly)
|
const [period, setPeriod] = useState(Periods.Monthly)
|
||||||
|
|
||||||
|
@ -64,12 +64,12 @@ export default function ViewBest() {
|
||||||
|
|
||||||
const charts = useMemo(() => {
|
const charts = useMemo(() => {
|
||||||
if (
|
if (
|
||||||
(metric === Metrics.Volume && volumes.length === 0) ||
|
(metric === Metrics.Volume && volumes?.length === 0) ||
|
||||||
(metric === Metrics.Weight && weights.length === 0) ||
|
(metric === Metrics.Weight && weights?.length === 0) ||
|
||||||
(metric === Metrics.OneRepMax && weights.length === 0)
|
(metric === Metrics.OneRepMax && weights?.length === 0)
|
||||||
)
|
)
|
||||||
return <List.Item title="No data yet." />
|
return <List.Item title="No data yet." />
|
||||||
if (metric === Metrics.Volume)
|
if (metric === Metrics.Volume && volumes?.length && weights?.length)
|
||||||
return (
|
return (
|
||||||
<Chart
|
<Chart
|
||||||
yData={volumes.map(v => v.value)}
|
yData={volumes.map(v => v.value)}
|
||||||
|
@ -87,11 +87,11 @@ export default function ViewBest() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Chart
|
<Chart
|
||||||
yData={weights.map(set => set.weight)}
|
yData={weights?.map(set => set.weight) || []}
|
||||||
yFormat={value => `${value}${weights[0].unit}`}
|
yFormat={value => `${value}${weights?.[0].unit}`}
|
||||||
xData={weights}
|
xData={weights || []}
|
||||||
xFormat={(_value, index) =>
|
xFormat={(_value, index) =>
|
||||||
format(new Date(weights[index].created), 'd/M')
|
format(new Date(weights?.[index].created), 'd/M')
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
|
|
|
@ -41,8 +41,8 @@ android {
|
||||||
missingDimensionStrategy "RNNotifications.reactNativeVersion", "reactNative60"
|
missingDimensionStrategy "RNNotifications.reactNativeVersion", "reactNative60"
|
||||||
minSdkVersion rootProject.ext.minSdkVersion
|
minSdkVersion rootProject.ext.minSdkVersion
|
||||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||||
versionCode 36145
|
versionCode 36148
|
||||||
versionName "1.119"
|
versionName "1.122"
|
||||||
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
|
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
|
||||||
|
|
||||||
if (isNewArchitectureEnabled()) {
|
if (isNewArchitectureEnabled()) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "massive",
|
"name": "massive",
|
||||||
"version": "1.119",
|
"version": "1.122",
|
||||||
"private": true,
|
"private": true,
|
||||||
"license": "GPL-3.0-only",
|
"license": "GPL-3.0-only",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user