removed folder wrapper from components
This commit is contained in:
parent
645b805aa7
commit
1e48c7b667
5 changed files with 22 additions and 29 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import { View, Text, StyleSheet, Switch, SwitchProps, useColorScheme, TouchableOpacityProps, TouchableOpacity } from 'react-native'
|
||||
import React from 'react'
|
||||
import { SIZES } from '../../../constants/theme'
|
||||
import { useTheme } from '../../../app/contexts/ThemeContext';
|
||||
import React from 'react';
|
||||
import { StyleSheet, Switch, SwitchProps, Text, TouchableOpacity, TouchableOpacityProps, View } from 'react-native';
|
||||
import { useTheme } from '../../app/contexts/ThemeContext';
|
||||
import { SIZES } from '../../constants/theme';
|
||||
|
||||
interface ToggleSettingProps extends SwitchProps {
|
||||
settingsTitle: string;
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
import React from 'react'
|
||||
import { Image, Text, View, ViewProps } from 'react-native'
|
||||
import { TouchableOpacity } from 'react-native-gesture-handler'
|
||||
import { MARGINS, SIZES } from '../../../constants/theme'
|
||||
import { useTheme } from '../../../app/contexts/ThemeContext'
|
||||
import { MARGINS, SIZES } from '../../constants/theme'
|
||||
import { useThemeColor } from '../../hooks/useThemeColor'
|
||||
|
||||
type WelcomeProps = ViewProps & {name: string, image : any, onPress: () => void | undefined}
|
||||
|
||||
|
|
@ -28,13 +28,13 @@ function getTimeOfDay(date: Date) : string {
|
|||
|
||||
|
||||
export default function Welcome(props: WelcomeProps) {
|
||||
const {colors} = useTheme()
|
||||
const date = new Date()
|
||||
const dateString = formatDate(date)
|
||||
const timeOfDay = getTimeOfDay(date)
|
||||
const onpress = props.onPress
|
||||
|
||||
const textcolor = colors.primaryText
|
||||
const textcolor = useThemeColor("primaryText")
|
||||
//const backgroundColor: string = useThemeColor("backgroundColor")
|
||||
|
||||
return (
|
||||
<View style={{
|
||||
|
|
@ -1,18 +1,13 @@
|
|||
import React from 'react';
|
||||
import { ColorValue, StyleSheet, Text, View } from 'react-native';
|
||||
import { SIZES } from '../../../constants/theme';
|
||||
import { useTheme } from '../../../app/contexts/ThemeContext';
|
||||
import CustomCard from "../../common/CustomCard";
|
||||
import { SimpleDate } from '../../../util/SimpleDate';
|
||||
import { SIZES } from '../../constants/theme';
|
||||
import { useThemeColor } from '../../hooks/useThemeColor';
|
||||
import CustomCard from "../common/CustomCard";
|
||||
|
||||
type ISOdateString = string
|
||||
|
||||
export type ExpenseItemProps = {color: ColorValue, category: string, title: string, date: ISOdateString, value : string}
|
||||
export type ExpenseItemProps = {color: ColorValue, category: string, title: string, date: string, value : string}
|
||||
export default function ExpenseItem(itemProps : ExpenseItemProps) {
|
||||
const {colors} = useTheme()
|
||||
const textColor = colors.primaryText
|
||||
const backgroundColor = colors.containerColor
|
||||
const date: SimpleDate = new SimpleDate(new Date(itemProps.date))
|
||||
const textColor = useThemeColor("primaryText");
|
||||
const backgroundColor = useThemeColor("backgroundColor")
|
||||
return (
|
||||
<CustomCard>
|
||||
<View style={[styles.colorTip, {backgroundColor: itemProps.color}]}></View>
|
||||
|
|
@ -28,7 +23,7 @@ export default function ExpenseItem(itemProps : ExpenseItemProps) {
|
|||
<Text style={{
|
||||
fontSize: SIZES.small,
|
||||
color: textColor
|
||||
}} numberOfLines={1}>{date.format("DD.MM.YYYY")}</Text>
|
||||
}} numberOfLines={1}>{itemProps.date}</Text>
|
||||
</View>
|
||||
<View style={[styles.valueSection, {backgroundColor: backgroundColor}]}>
|
||||
<Text style={{
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
//home
|
||||
import ExpenseItem from "./home/expenseItem/expenseItem"
|
||||
import Welcome from "./home/Welcome/Welcome"
|
||||
import { ToggleSetting, ButtonSetting } from "./home/userSettings/Setting"
|
||||
import { ButtonSetting, ToggleSetting } from "./home/Setting"
|
||||
import Welcome from "./home/Welcome"
|
||||
import ExpenseItem from "./home/expenseItem"
|
||||
|
||||
//common
|
||||
import LoadingSymbol from "./common/loadingSymbol"
|
||||
|
|
@ -14,10 +14,8 @@ import CustomCard from "./common/CustomCard"
|
|||
import Input from "./login/input"
|
||||
|
||||
export {
|
||||
ExpenseItem, Input,
|
||||
ButtonSetting, CustomCard, ExpenseItem, Input,
|
||||
LoadingSymbol, Plus,
|
||||
SearchBar, Welcome,
|
||||
ToggleSetting, CustomCard,
|
||||
ButtonSetting
|
||||
SearchBar, ToggleSetting, Welcome
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import React from 'react';
|
||||
import {View, Text, TextInput, StyleSheet} from 'react-native';
|
||||
import { NativeSyntheticEvent } from 'react-native/Libraries/Types/CoreEventTypes';
|
||||
import { StyleSheet, Text, TextInput, View } from 'react-native';
|
||||
import { TextInputEndEditingEventData } from 'react-native/Libraries/Components/TextInput/TextInput';
|
||||
import { NativeSyntheticEvent } from 'react-native/Libraries/Types/CoreEventTypes';
|
||||
|
||||
interface InputProps {
|
||||
label? : string,
|
||||
|
|
|
|||
Reference in a new issue