From f6944328fbee4686c884dee1c8c958f87cacf8b4 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Tue, 14 Nov 2023 13:06:58 +0100 Subject: [PATCH] Fix: Middle chart legend improved; Row height halfed, elements aligned, fontsize partially decreased --- components/chart/chart-legend.js | 15 ++++++++++++--- components/chart/cycle-day-label.js | 27 ++++++++++++++++++++------- 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/components/chart/chart-legend.js b/components/chart/chart-legend.js index 76d8014..9c59875 100644 --- a/components/chart/chart-legend.js +++ b/components/chart/chart-legend.js @@ -4,15 +4,19 @@ import { StyleSheet, View } from 'react-native' import AppText from '../common/app-text' -import { Typography } from '../../styles' +import { Sizes, Typography } from '../../styles' import { CHART_YAXIS_WIDTH } from '../../config' import { shared as labels } from '../../i18n/en/labels' const ChartLegend = ({ height }) => { return ( - # - {labels.date} + + # + + + {labels.date} + ) } @@ -27,8 +31,13 @@ const styles = StyleSheet.create({ justifyContent: 'flex-end', width: CHART_YAXIS_WIDTH, }, + singleLabelContainer: { + justifyContent: 'space-around', + alignItems: 'center', + }, text: { ...Typography.label, + fontSize: Sizes.footnote, }, textBold: { ...Typography.labelBold, diff --git a/components/chart/cycle-day-label.js b/components/chart/cycle-day-label.js index 45e0f2a..09c59ca 100644 --- a/components/chart/cycle-day-label.js +++ b/components/chart/cycle-day-label.js @@ -19,11 +19,20 @@ const CycleDayLabel = ({ height, date }) => { return ( - {cycleDayLabel} - - - {isFirstDayOfMonth ? momentDate.format('MMM') : dayOfMonth} - + + {cycleDayLabel} + + + + {isFirstDayOfMonth && ( + + {momentDate.format('MMM')} + + )} + + {!isFirstDayOfMonth && ( + {dayOfMonth} + )} {!isFirstDayOfMonth && ( {getOrdinalSuffix(dayOfMonth)} @@ -45,17 +54,21 @@ const styles = StyleSheet.create({ justifyContent: 'flex-end', left: 4, }, - text: { + textSmall: { ...Typography.label, fontSize: Sizes.small, }, + textFootnote: { + ...Typography.label, + fontSize: Sizes.footnote, + }, textBold: { ...Typography.labelBold, }, textLight: { ...Typography.labelLight, }, - dateLabel: { + labelRow: { flexDirection: 'row', justifyContent: 'space-around', alignItems: 'center',