feat: basic structure for calendar

This commit is contained in:
Jakob Stornig 2023-12-20 22:55:19 +01:00
parent 37b38d33fc
commit 65c32a9298
5 changed files with 94 additions and 12 deletions

View file

@ -2,12 +2,18 @@ import React from 'react';
import { ColorValue, StyleSheet, Text, View } from 'react-native';
import { SIZES } from '../../../constants/theme';
import { useThemeColor } from '../../../hooks/useThemeColor';
import { useTheme } from '../../../app/contexts/ThemeContext';
import CustomCard from "../../common/CustomCard";
import { SimpleDate } from '../../../util/SimpleDate';
export type ExpenseItemProps = {color: ColorValue, category: string, title: string, date: string, value : string}
type ISOdateString = string
export type ExpenseItemProps = {color: ColorValue, category: string, title: string, date: ISOdateString, value : string}
export default function ExpenseItem(itemProps : ExpenseItemProps) {
const textColor = useThemeColor("primaryText");
const backgroundColor = useThemeColor("backgroundColor")
const {colors} = useTheme()
const textColor = colors.primaryText
const backgroundColor = colors.containerColor
const date: SimpleDate = new SimpleDate(new Date(itemProps.date))
return (
<CustomCard>
<View style={[styles.colorTip, {backgroundColor: itemProps.color}]}></View>
@ -23,7 +29,7 @@ export default function ExpenseItem(itemProps : ExpenseItemProps) {
<Text style={{
fontSize: SIZES.small,
color: textColor
}} numberOfLines={1}>{itemProps.date}</Text>
}} numberOfLines={1}>{date.format("DD.MM.YYYY")}</Text>
</View>
<View style={[styles.valueSection, {backgroundColor: backgroundColor}]}>
<Text style={{