Fix text color inconsistency in plan editing

This commit is contained in:
Brandon Presley 2022-09-25 18:11:50 +13:00
parent 063425cd82
commit be5571a965
3 changed files with 7 additions and 7 deletions

View File

@ -6,15 +6,15 @@ import {
useRoute, useRoute,
} from '@react-navigation/native'; } from '@react-navigation/native';
import React, {useCallback, useEffect, useState} from 'react'; import React, {useCallback, useEffect, useState} from 'react';
import {ScrollView, StyleSheet, Text, View} from 'react-native'; import {ScrollView, StyleSheet, View} from 'react-native';
import {Button, IconButton} from 'react-native-paper'; import {Button, IconButton, Text} from 'react-native-paper';
import {MARGIN, PADDING} from './constants'; import {MARGIN, PADDING} from './constants';
import {DrawerParamList} from './drawer-param-list'; import {DrawerParamList} from './drawer-param-list';
import MassiveSwitch from './MassiveSwitch'; import MassiveSwitch from './MassiveSwitch';
import {PlanPageParams} from './plan-page-params'; import {PlanPageParams} from './plan-page-params';
import {addPlan, updatePlan} from './plan.service'; import {addPlan, updatePlan} from './plan.service';
import {getNames} from './set.service'; import {getNames} from './set.service';
import {days} from './time'; import {DAYS} from './time';
export default function EditPlan() { export default function EditPlan() {
const {params} = useRoute<RouteProp<PlanPageParams, 'EditPlan'>>(); const {params} = useRoute<RouteProp<PlanPageParams, 'EditPlan'>>();
@ -90,7 +90,7 @@ export default function EditPlan() {
<View style={{padding: PADDING}}> <View style={{padding: PADDING}}>
<ScrollView style={{height: '90%'}}> <ScrollView style={{height: '90%'}}>
<Text style={styles.title}>Days</Text> <Text style={styles.title}>Days</Text>
{days.map(day => ( {DAYS.map(day => (
<View key={day} style={[styles.row, {alignItems: 'center'}]}> <View key={day} style={[styles.row, {alignItems: 'center'}]}>
<MassiveSwitch <MassiveSwitch
value={days.includes(day)} value={days.includes(day)}

View File

@ -1,6 +1,6 @@
import {db} from './db'; import {db} from './db';
import {Plan} from './plan'; import {Plan} from './plan';
import {days} from './time'; import {DAYS} from './time';
export const getPlans = async (search: string): Promise<Plan[]> => { export const getPlans = async (search: string): Promise<Plan[]> => {
const select = ` const select = `
@ -12,7 +12,7 @@ export const getPlans = async (search: string): Promise<Plan[]> => {
}; };
export const getTodaysPlan = async (): Promise<Plan[]> => { export const getTodaysPlan = async (): Promise<Plan[]> => {
const today = days[new Date().getDay()]; const today = DAYS[new Date().getDay()];
const [result] = await db.executeSql( const [result] = await db.executeSql(
`SELECT * FROM plans WHERE days LIKE ? LIMIT 1`, `SELECT * FROM plans WHERE days LIKE ? LIMIT 1`,
[`%${today}%`], [`%${today}%`],

View File

@ -1,4 +1,4 @@
export const days = [ export const DAYS = [
'Sunday', 'Sunday',
'Monday', 'Monday',
'Tuesday', 'Tuesday',