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

View File

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

View File

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