Compare commits
4 Commits
master
...
homeScreen
Author | SHA1 | Date |
---|---|---|
Denis Kurmansky | 526da8d808 | 3 years ago |
Denis Kurmansky | b21f3ab1a8 | 3 years ago |
Denis Kurmansky | 7e9c4ff37f | 3 years ago |
Denis Kurmansky | 4fb115eaae | 3 years ago |
25 changed files with 995 additions and 56 deletions
Binary file not shown.
Binary file not shown.
@ -0,0 +1,84 @@
@@ -0,0 +1,84 @@
|
||||
import React, {FC, useState} from 'react'; |
||||
import {StyleSheet, TextInput, TouchableOpacity, View} from 'react-native'; |
||||
import {$size, getTheme, IconComponent} from '@/shared'; |
||||
|
||||
interface IProps { |
||||
searchString: string; |
||||
onSearchValChange: (val: string) => void; |
||||
onPressFilter: () => void; |
||||
} |
||||
|
||||
export const FilterSearchHeaderComponent: FC<IProps> = ({ |
||||
searchString, |
||||
onPressFilter, |
||||
onSearchValChange, |
||||
}) => { |
||||
const [onFocus, setFocus] = useState<boolean>(false); |
||||
|
||||
return ( |
||||
<View style={styles.container}> |
||||
<TouchableOpacity |
||||
onPress={onPressFilter} |
||||
style={[styles.baseWrap, styles.filterBtnWrap]}> |
||||
<IconComponent |
||||
name={'slidershorizontal-1'} |
||||
size={$size(25)} |
||||
color={getTheme().icon.$defaultColor} |
||||
/> |
||||
</TouchableOpacity> |
||||
|
||||
<View style={[styles.baseWrap, styles.searchFieldWrap]}> |
||||
<IconComponent |
||||
name={'magnifyingglass-1'} |
||||
size={$size(25)} |
||||
style={styles.searchIcon} |
||||
color={ |
||||
onFocus || searchString |
||||
? getTheme().icon.$activeColor |
||||
: getTheme().icon.$defaultColor |
||||
} |
||||
/> |
||||
|
||||
<TextInput |
||||
value={searchString} |
||||
onChangeText={onSearchValChange} |
||||
onBlur={() => setFocus(false)} |
||||
onFocus={() => setFocus(true)} |
||||
placeholder="Знайдіть задачу, групу" |
||||
/> |
||||
</View> |
||||
</View> |
||||
); |
||||
}; |
||||
|
||||
const styles = StyleSheet.create({ |
||||
container: { |
||||
width: '100%', |
||||
flexDirection: 'row', |
||||
justifyContent: 'space-between', |
||||
paddingBottom: $size(10), |
||||
borderBottomWidth: 1, |
||||
borderBottomColor: getTheme().$border, |
||||
}, |
||||
|
||||
baseWrap: { |
||||
width: $size(40), |
||||
backgroundColor: getTheme().$white, |
||||
borderRadius: 10, |
||||
alignItems: 'center', |
||||
}, |
||||
|
||||
filterBtnWrap: { |
||||
justifyContent: 'center', |
||||
height: $size(40), |
||||
}, |
||||
|
||||
searchFieldWrap: { |
||||
width: $size(285), |
||||
flexDirection: 'row', |
||||
}, |
||||
|
||||
searchIcon: { |
||||
marginHorizontal: $size(10), |
||||
}, |
||||
}); |
@ -0,0 +1,82 @@
@@ -0,0 +1,82 @@
|
||||
import {$size, SelfItemComponent} from '@/shared'; |
||||
import React, {FC} from 'react'; |
||||
import { |
||||
Dimensions, |
||||
FlatList, |
||||
StyleSheet, |
||||
View, |
||||
Text, |
||||
TouchableOpacity, |
||||
} from 'react-native'; |
||||
import {groupsData} from '../mock/groups-data.mock'; |
||||
|
||||
const {width} = Dimensions.get('window'); |
||||
const ITEM_SIZE = width * 0.92; |
||||
|
||||
interface IProps { |
||||
title: string; |
||||
onPressSeeAll: () => void; |
||||
onPressInfo: () => void; |
||||
} |
||||
|
||||
export const HorizontalListComponent: FC<IProps> = ({ |
||||
title, |
||||
onPressSeeAll, |
||||
onPressInfo, |
||||
}) => { |
||||
return ( |
||||
<View style={styles.container}> |
||||
<View style={styles.listHeader}> |
||||
<Text style={styles.title}>{title}</Text> |
||||
|
||||
<TouchableOpacity onPress={onPressSeeAll}> |
||||
<Text style={styles.seeAll}>Дивитись усі</Text> |
||||
</TouchableOpacity> |
||||
</View> |
||||
|
||||
<FlatList |
||||
horizontal |
||||
showsHorizontalScrollIndicator={false} |
||||
snapToInterval={ITEM_SIZE} |
||||
decelerationRate={0} |
||||
contentContainerStyle={{alignItems: 'center'}} |
||||
data={groupsData} |
||||
renderItem={({item, index}) => { |
||||
return ( |
||||
<SelfItemComponent |
||||
{...item} |
||||
onPressInfo={onPressInfo} |
||||
style={ |
||||
groupsData.length - 1 !== index && { |
||||
marginRight: 10, |
||||
} |
||||
} |
||||
/> |
||||
); |
||||
}} |
||||
/> |
||||
</View> |
||||
); |
||||
}; |
||||
|
||||
const styles = StyleSheet.create({ |
||||
container: { |
||||
marginVertical: $size(10), |
||||
}, |
||||
|
||||
listHeader: { |
||||
flexDirection: 'row', |
||||
justifyContent: 'space-between', |
||||
marginHorizontal: $size(5), |
||||
}, |
||||
|
||||
title: { |
||||
fontSize: 16, |
||||
fontWeight: '600', |
||||
}, |
||||
|
||||
seeAll: { |
||||
fontSize: 14, |
||||
fontWeight: '300', |
||||
}, |
||||
}); |
@ -0,0 +1,3 @@
@@ -0,0 +1,3 @@
|
||||
export * from './filter-search-header.component'; |
||||
export * from './horizontal-list.component'; |
||||
export * from './my-tasks-list.component'; |
@ -0,0 +1,70 @@
@@ -0,0 +1,70 @@
|
||||
import {$size, FlatListItemComponent, getTheme} from '@/shared'; |
||||
import React, {FC} from 'react'; |
||||
import {StyleSheet, View, Text, TouchableOpacity, FlatList} from 'react-native'; |
||||
import {myTasksData} from '../mock/my-tasks-data.mock'; |
||||
|
||||
interface IProps { |
||||
checkboxVal: boolean; |
||||
onPressCheckbox: () => void; |
||||
} |
||||
|
||||
export const MyTasksListComponent: FC<IProps> = ({ |
||||
checkboxVal, |
||||
onPressCheckbox, |
||||
}) => { |
||||
return ( |
||||
<View style={styles.container}> |
||||
<View style={styles.listHeader}> |
||||
<Text style={styles.title}>Моï задачi</Text> |
||||
|
||||
<TouchableOpacity> |
||||
<Text style={styles.seeAll}>Дивитись усі</Text> |
||||
</TouchableOpacity> |
||||
</View> |
||||
|
||||
<FlatList |
||||
data={myTasksData} |
||||
scrollEnabled={false} |
||||
contentContainerStyle={styles.listContainer} |
||||
renderItem={({item}) => { |
||||
return ( |
||||
<FlatListItemComponent |
||||
{...item} |
||||
checkboxVal={checkboxVal} |
||||
onPressCheckbox={onPressCheckbox} |
||||
/> |
||||
); |
||||
}} |
||||
/> |
||||
</View> |
||||
); |
||||
}; |
||||
|
||||
const styles = StyleSheet.create({ |
||||
container: { |
||||
marginBottom: $size(30), |
||||
}, |
||||
|
||||
listHeader: { |
||||
flexDirection: 'row', |
||||
justifyContent: 'space-between', |
||||
marginHorizontal: $size(5), |
||||
marginVertical: $size(20), |
||||
}, |
||||
|
||||
title: { |
||||
fontSize: 16, |
||||
fontWeight: '600', |
||||
}, |
||||
|
||||
seeAll: { |
||||
fontSize: 14, |
||||
fontWeight: '300', |
||||
}, |
||||
|
||||
listContainer: { |
||||
paddingTop: $size(20), |
||||
borderRadius: 20, |
||||
backgroundColor: getTheme().$white, |
||||
}, |
||||
}); |
@ -0,0 +1 @@
@@ -0,0 +1 @@
|
||||
export * from './screens'; |
@ -0,0 +1,38 @@
@@ -0,0 +1,38 @@
|
||||
export const groupsData = [ |
||||
{ |
||||
title: 'Development', |
||||
info: '35 tasks', |
||||
}, |
||||
{ |
||||
title: 'Design', |
||||
info: '35 tasks', |
||||
}, |
||||
{ |
||||
title: 'Management', |
||||
info: '35 tasks', |
||||
}, |
||||
{ |
||||
title: 'Development', |
||||
info: '35 tasks', |
||||
}, |
||||
{ |
||||
title: 'Design', |
||||
info: '35 tasks', |
||||
}, |
||||
{ |
||||
title: 'Management', |
||||
info: '35 tasks', |
||||
}, |
||||
{ |
||||
title: 'Development', |
||||
info: '35 tasks', |
||||
}, |
||||
{ |
||||
title: 'Design', |
||||
info: '35 tasks', |
||||
}, |
||||
{ |
||||
title: 'Management', |
||||
info: '35 tasks', |
||||
}, |
||||
]; |
@ -0,0 +1,282 @@
@@ -0,0 +1,282 @@
|
||||
export const myTasksData = [ |
||||
{ |
||||
title: 'Створити план розвитку нашої компанії', |
||||
count: 1234, |
||||
date: '21.03.2021', |
||||
userName: 'User', |
||||
imageUri: null, |
||||
icons: { |
||||
chat: true, |
||||
star: false, |
||||
}, |
||||
}, |
||||
{ |
||||
title: 'Звіт за лютий', |
||||
count: 3, |
||||
date: '21.03.2021', |
||||
userName: 'User', |
||||
imageUri: null, |
||||
icons: { |
||||
clip: false, |
||||
chat: true, |
||||
star: false, |
||||
}, |
||||
}, |
||||
{ |
||||
title: 'Створити дизайн', |
||||
count: 3123, |
||||
date: '21.03.2021', |
||||
userName: 'User', |
||||
imageUri: null, |
||||
icons: { |
||||
clip: true, |
||||
chat: true, |
||||
star: true, |
||||
}, |
||||
}, |
||||
{ |
||||
title: 'Створити план розвитку нашої компанії', |
||||
count: 1234, |
||||
date: '21.03.2021', |
||||
userName: 'User', |
||||
imageUri: null, |
||||
icons: { |
||||
chat: true, |
||||
star: false, |
||||
}, |
||||
}, |
||||
{ |
||||
title: 'Звіт за лютий', |
||||
count: 3, |
||||
date: '21.03.2021', |
||||
userName: 'User', |
||||
imageUri: null, |
||||
icons: { |
||||
clip: false, |
||||
chat: true, |
||||
star: false, |
||||
}, |
||||
}, |
||||
{ |
||||
title: 'Створити дизайн', |
||||
count: 3123, |
||||
date: '21.03.2021', |
||||
userName: 'User', |
||||
imageUri: null, |
||||
icons: { |
||||
clip: true, |
||||
chat: true, |
||||
star: true, |
||||
}, |
||||
}, |
||||
{ |
||||
title: 'Створити план розвитку нашої компанії', |
||||
count: 1234, |
||||
date: '21.03.2021', |
||||
userName: 'User', |
||||
imageUri: null, |
||||
icons: { |
||||
chat: true, |
||||
star: false, |
||||
}, |
||||
}, |
||||
{ |
||||
title: 'Звіт за лютий', |
||||
count: 3, |
||||
date: '21.03.2021', |
||||
userName: 'User', |
||||
imageUri: null, |
||||
icons: { |
||||
clip: false, |
||||
chat: true, |
||||
star: false, |
||||
}, |
||||
}, |
||||
{ |
||||
title: 'Створити дизайн', |
||||
count: 3123, |
||||
date: '21.03.2021', |
||||
userName: 'User', |
||||
imageUri: null, |
||||
icons: { |
||||
clip: true, |
||||
chat: true, |
||||
star: true, |
||||
}, |
||||
}, |
||||
{ |
||||
title: 'Створити план розвитку нашої компанії', |
||||
count: 1234, |
||||
date: '21.03.2021', |
||||
userName: 'User', |
||||
imageUri: null, |
||||
icons: { |
||||
chat: true, |
||||
star: false, |
||||
}, |
||||
}, |
||||
{ |
||||
title: 'Звіт за лютий', |
||||
count: 3, |
||||
date: '21.03.2021', |
||||
userName: 'User', |
||||
imageUri: null, |
||||
icons: { |
||||
clip: false, |
||||
chat: true, |
||||
star: false, |
||||
}, |
||||
}, |
||||
{ |
||||
title: 'Створити дизайн', |
||||
count: 3123, |
||||
date: '21.03.2021', |
||||
userName: 'User', |
||||
imageUri: null, |
||||
icons: { |
||||
clip: true, |
||||
chat: true, |
||||
star: true, |
||||
}, |
||||
}, |
||||
{ |
||||
title: 'Створити план розвитку нашої компанії', |
||||
count: 1234, |
||||
date: '21.03.2021', |
||||
userName: 'User', |
||||
imageUri: null, |
||||
icons: { |
||||
chat: true, |
||||
star: false, |
||||
}, |
||||
}, |
||||
{ |
||||
title: 'Звіт за лютий', |
||||
count: 3, |
||||
date: '21.03.2021', |
||||
userName: 'User', |
||||
imageUri: null, |
||||
icons: { |
||||
clip: false, |
||||
chat: true, |
||||
star: false, |
||||
}, |
||||
}, |
||||
{ |
||||
title: 'Створити дизайн', |
||||
count: 3123, |
||||
date: '21.03.2021', |
||||
userName: 'User', |
||||
imageUri: null, |
||||
icons: { |
||||
clip: true, |
||||
chat: true, |
||||
star: true, |
||||
}, |
||||
}, |
||||
{ |
||||
title: 'Створити план розвитку нашої компанії', |
||||
count: 1234, |
||||
date: '21.03.2021', |
||||
userName: 'User', |
||||
imageUri: null, |
||||
icons: { |
||||
chat: true, |
||||
star: false, |
||||
}, |
||||
}, |
||||
{ |
||||
title: 'Звіт за лютий', |
||||
count: 3, |
||||
date: '21.03.2021', |
||||
userName: 'User', |
||||
imageUri: null, |
||||
icons: { |
||||
clip: false, |
||||
chat: true, |
||||
star: false, |
||||
}, |
||||
}, |
||||
{ |
||||
title: 'Створити дизайн', |
||||
count: 3123, |
||||
date: '21.03.2021', |
||||
userName: 'User', |
||||
imageUri: null, |
||||
icons: { |
||||
clip: true, |
||||
chat: true, |
||||
star: true, |
||||
}, |
||||
}, |
||||
{ |
||||
title: 'Створити план розвитку нашої компанії', |
||||
count: 1234, |
||||
date: '21.03.2021', |
||||
userName: 'User', |
||||
imageUri: null, |
||||
icons: { |
||||
chat: true, |
||||
star: false, |
||||
}, |
||||
}, |
||||
{ |
||||
title: 'Звіт за лютий', |
||||
count: 3, |
||||
date: '21.03.2021', |
||||
userName: 'User', |
||||
imageUri: null, |
||||
icons: { |
||||
clip: false, |
||||
chat: true, |
||||
star: false, |
||||
}, |
||||
}, |
||||
{ |
||||
title: 'Створити дизайн', |
||||
count: 3123, |
||||
date: '21.03.2021', |
||||
userName: 'User', |
||||
imageUri: null, |
||||
icons: { |
||||
clip: true, |
||||
chat: true, |
||||
star: true, |
||||
}, |
||||
}, |
||||
{ |
||||
title: 'Створити план розвитку нашої компанії', |
||||
count: 1234, |
||||
date: '21.03.2021', |
||||
userName: 'User', |
||||
imageUri: null, |
||||
icons: { |
||||
chat: true, |
||||
star: false, |
||||
}, |
||||
}, |
||||
{ |
||||
title: 'Звіт за лютий', |
||||
count: 3, |
||||
date: '21.03.2021', |
||||
userName: 'User', |
||||
imageUri: null, |
||||
icons: { |
||||
clip: false, |
||||
chat: true, |
||||
star: false, |
||||
}, |
||||
}, |
||||
{ |
||||
title: 'Створити дизайн', |
||||
count: 3123, |
||||
date: '21.03.2021', |
||||
userName: 'User', |
||||
imageUri: null, |
||||
icons: { |
||||
clip: true, |
||||
chat: true, |
||||
star: true, |
||||
}, |
||||
}, |
||||
]; |
@ -0,0 +1,38 @@
@@ -0,0 +1,38 @@
|
||||
import React, {FC} from 'react'; |
||||
import { |
||||
FilterSearchHeaderComponent, |
||||
HorizontalListComponent, |
||||
MyTasksListComponent, |
||||
} from '../components'; |
||||
import {FlatListItemComponent, ScreenLayout} from '@/shared'; |
||||
|
||||
export const HomeScreen: FC = () => { |
||||
return ( |
||||
<ScreenLayout needScroll> |
||||
<> |
||||
<FilterSearchHeaderComponent |
||||
searchString="" |
||||
onSearchValChange={() => {}} |
||||
onPressFilter={() => {}} |
||||
/> |
||||
|
||||
<HorizontalListComponent |
||||
title="Групи" |
||||
onPressSeeAll={() => {}} |
||||
onPressInfo={() => {}} |
||||
/> |
||||
|
||||
<HorizontalListComponent |
||||
title="Виконавцi" |
||||
onPressSeeAll={() => {}} |
||||
onPressInfo={() => {}} |
||||
/> |
||||
|
||||
<MyTasksListComponent |
||||
checkboxVal={false} |
||||
onPressCheckbox={() => {}} |
||||
/> |
||||
</> |
||||
</ScreenLayout> |
||||
); |
||||
}; |
@ -0,0 +1 @@
@@ -0,0 +1 @@
|
||||
export * from './home.screen'; |
@ -0,0 +1,38 @@
@@ -0,0 +1,38 @@
|
||||
import {getTheme} from '@/shared/themes'; |
||||
import React, {FC} from 'react'; |
||||
import {StyleSheet, TouchableOpacity, ViewStyle} from 'react-native'; |
||||
import {IconComponent} from './icon.component'; |
||||
|
||||
interface IProps { |
||||
value: boolean; |
||||
size: number; |
||||
containerStyle?: ViewStyle; |
||||
onPress: () => void; |
||||
} |
||||
|
||||
export const CheckBox: FC<IProps> = ({ |
||||
value, |
||||
size, |
||||
containerStyle, |
||||
onPress, |
||||
}) => { |
||||
return ( |
||||
<TouchableOpacity onPress={onPress} style={containerStyle}> |
||||
{value ? ( |
||||
<IconComponent |
||||
name={'checksquare-1'} |
||||
size={size} |
||||
color={getTheme().icon.$activeColor} |
||||
/> |
||||
) : ( |
||||
<IconComponent |
||||
name={'checksquare-1-1'} |
||||
size={size} |
||||
color={getTheme().icon.$defaultColor} |
||||
/> |
||||
)} |
||||
</TouchableOpacity> |
||||
); |
||||
}; |
||||
|
||||
const styles = StyleSheet.create({}); |
@ -0,0 +1,150 @@
@@ -0,0 +1,150 @@
|
||||
import {$size} from '@/shared/helpers'; |
||||
import {getTheme} from '@/shared/themes'; |
||||
import React, {FC} from 'react'; |
||||
import {Image, StyleSheet, View, Text} from 'react-native'; |
||||
import {CheckBox} from './checkbox.component'; |
||||
import {IconComponent} from './icon.component'; |
||||
|
||||
interface IProps { |
||||
title: string; |
||||
count: number; |
||||
date: string; |
||||
userName?: string; |
||||
imageUri?: string; |
||||
checkboxVal?: boolean; |
||||
icons?: { |
||||
clip?: boolean; |
||||
chat?: boolean; |
||||
star?: boolean; |
||||
}; |
||||
onPressCheckbox: () => void; |
||||
} |
||||
|
||||
export const FlatListItemComponent: FC<IProps> = ({ |
||||
title, |
||||
count, |
||||
date, |
||||
imageUri, |
||||
checkboxVal, |
||||
userName, |
||||
icons, |
||||
onPressCheckbox, |
||||
}) => { |
||||
const tabBarIcons = ['paperclip-1', 'chat-2', 'vectorstar']; |
||||
|
||||
return ( |
||||
<View style={styles.container}> |
||||
<View style={styles.iconWrap}> |
||||
{imageUri ? ( |
||||
<Image source={{uri: imageUri}} /> |
||||
) : ( |
||||
<Text style={styles.noIcon}>{userName[0]}</Text> |
||||
)} |
||||
</View> |
||||
|
||||
<View style={styles.contentWrap}> |
||||
<View style={styles.topBarWrap}> |
||||
<View style={styles.tabBarIcons}> |
||||
{tabBarIcons.map((item, i) => { |
||||
icons[i]; |
||||
return ( |
||||
<View key={`icon-${i}`}> |
||||
<IconComponent |
||||
name={item} |
||||
size={$size(16)} |
||||
color={getTheme().icon.$darkGray} |
||||
style={styles.tabBaIcon} |
||||
/> |
||||
{icons[i] && ( |
||||
<View style={styles.indicator} /> |
||||
)} |
||||
</View> |
||||
); |
||||
})} |
||||
</View> |
||||
|
||||
<Text style={styles.count}>{`#${count}, ${date}`}</Text> |
||||
</View> |
||||
|
||||
<Text style={[styles.title]}>{title}</Text> |
||||
</View> |
||||
|
||||
<CheckBox |
||||
size={$size(19)} |
||||
value={checkboxVal} |
||||
containerStyle={styles.checkbox} |
||||
onPress={onPressCheckbox} |
||||
/> |
||||
</View> |
||||
); |
||||
}; |
||||
|
||||
const styles = StyleSheet.create({ |
||||
container: { |
||||
backgroundColor: '#fff', |
||||
flexDirection: 'row', |
||||
alignItems: 'center', |
||||
}, |
||||
|
||||
iconWrap: { |
||||
width: $size(35), |
||||
height: $size(35), |
||||
backgroundColor: getTheme().$layoutBg, |
||||
alignItems: 'center', |
||||
justifyContent: 'center', |
||||
borderRadius: 100, |
||||
margin: $size(20), |
||||
overflow: 'hidden', |
||||
}, |
||||
|
||||
noIcon: { |
||||
fontSize: 18, |
||||
fontWeight: '500', |
||||
color: getTheme().icon.$defaultColor, |
||||
}, |
||||
|
||||
contentWrap: { |
||||
paddingBottom: $size(3), |
||||
}, |
||||
|
||||
topBarWrap: { |
||||
flexDirection: 'row', |
||||
justifyContent: 'space-between', |
||||
}, |
||||
|
||||
tabBarIcons: { |
||||
flexDirection: 'row', |
||||
marginRight: $size(20), |
||||
}, |
||||
|
||||
indicator: { |
||||
width: $size(6), |
||||
height: $size(6), |
||||
position: 'absolute', |
||||
bottom: $size(1), |
||||
right: $size(7), |
||||
backgroundColor: getTheme().$secondary, |
||||
borderColor: getTheme().$white, |
||||
borderWidth: 1, |
||||
borderRadius: 100, |
||||
}, |
||||
|
||||
tabBaIcon: { |
||||
marginRight: $size(7), |
||||
}, |
||||
|
||||
count: { |
||||
color: getTheme().icon.$darkGray, |
||||
}, |
||||
|
||||
title: { |
||||
fontSize: 16, |
||||
maxWidth: $size(200), |
||||
marginVertical: $size(6), |
||||
}, |
||||
|
||||
checkbox: { |
||||
position: 'absolute', |
||||
right: $size(24), |
||||
}, |
||||
}); |
@ -1,24 +1,25 @@
@@ -1,24 +1,25 @@
|
||||
import React from 'react'; |
||||
import { createIconSetFromFontello } from 'react-native-vector-icons'; |
||||
import { fontelloConfig } from '@/config/fontello.config'; |
||||
import {createIconSetFromFontello} from 'react-native-vector-icons'; |
||||
import {fontelloConfig} from '@/config/fontello.config'; |
||||
import {ColorValue} from 'react-native'; |
||||
const Icon = createIconSetFromFontello(fontelloConfig); |
||||
|
||||
interface IProps { |
||||
name: string |
||||
size: number |
||||
color: string |
||||
style?: any |
||||
onPress?: () => void |
||||
name: string; |
||||
size: number; |
||||
color: ColorValue; |
||||
style?: any; |
||||
onPress?: () => void; |
||||
} |
||||
|
||||
export const IconComponent = (props: IProps) => { |
||||
return ( |
||||
<Icon |
||||
name={props.name} |
||||
size={props.size} |
||||
color={props.color} |
||||
style={props.style} |
||||
onPress={props.onPress} |
||||
/> |
||||
) |
||||
} |
||||
return ( |
||||
<Icon |
||||
name={props.name} |
||||
size={props.size} |
||||
color={props.color} |
||||
style={props.style} |
||||
onPress={props.onPress} |
||||
/> |
||||
); |
||||
}; |
@ -1,2 +1,6 @@
@@ -1,2 +1,6 @@
|
||||
export * from './txt.component'; |
||||
export * from './icon.component' |
||||
export * from './icon.component'; |
||||
export * from './logo.component'; |
||||
export * from './self-item.component'; |
||||
export * from './flat-list-item.component'; |
||||
export * from './checkbox.component' |
@ -0,0 +1,106 @@
@@ -0,0 +1,106 @@
|
||||
import {$size} from '@/shared/helpers'; |
||||
import {getTheme} from '@/shared/themes'; |
||||
import React, {FC} from 'react'; |
||||
import { |
||||
StyleSheet, |
||||
View, |
||||
Text, |
||||
TouchableOpacity, |
||||
ViewStyle, |
||||
Image, |
||||
} from 'react-native'; |
||||
import {IconComponent} from './icon.component'; |
||||
|
||||
interface IProps { |
||||
title: string; |
||||
info: string; |
||||
imageUri?: string; |
||||
style?: ViewStyle; |
||||
onPressInfo: () => void; |
||||
} |
||||
|
||||
export const SelfItemComponent: FC<IProps> = ({ |
||||
title, |
||||
info, |
||||
style, |
||||
imageUri, |
||||
onPressInfo, |
||||
}) => { |
||||
return ( |
||||
<View style={[styles.container, style]}> |
||||
<View style={styles.iconWrap}> |
||||
{imageUri ? ( |
||||
<Image source={{uri: imageUri}} style={styles.icon} /> |
||||
) : ( |
||||
<Text style={styles.noIcon}>{title[0]}</Text> |
||||
)} |
||||
</View> |
||||
|
||||
<View style={styles.content}> |
||||
<Text style={styles.title}>{title}</Text> |
||||
<Text style={styles.info}>{info}</Text> |
||||
</View> |
||||
|
||||
<TouchableOpacity onPress={onPressInfo} style={styles.infoBtnWrap}> |
||||
<IconComponent |
||||
name={'info'} |
||||
size={$size(20)} |
||||
color={getTheme().icon.$defaultColor} |
||||
/> |
||||
</TouchableOpacity> |
||||
</View> |
||||
); |
||||
}; |
||||
|
||||
const styles = StyleSheet.create({ |
||||
container: { |
||||
width: $size(335), |
||||
height: $size(80), |
||||
padding: $size(20), |
||||
backgroundColor: getTheme().$white, |
||||
marginVertical: $size(10), |
||||
borderRadius: 20, |
||||
alignItems: 'center', |
||||
flexDirection: 'row', |
||||
}, |
||||
|
||||
iconWrap: { |
||||
width: $size(50), |
||||
height: $size(50), |
||||
backgroundColor: getTheme().$layoutBg, |
||||
borderRadius: 100, |
||||
alignItems: 'center', |
||||
justifyContent: 'center', |
||||
overflow: 'hidden', |
||||
}, |
||||
|
||||
icon: { |
||||
width: $size(50), |
||||
height: $size(50), |
||||
}, |
||||
|
||||
noIcon: { |
||||
fontSize: 22, |
||||
color: getTheme().icon.$defaultColor, |
||||
}, |
||||
|
||||
content: { |
||||
marginLeft: $size(15), |
||||
}, |
||||
|
||||
title: { |
||||
fontSize: 16, |
||||
fontWeight: '500', |
||||
}, |
||||
|
||||
info: { |
||||
fontSize: 14, |
||||
fontWeight: '300', |
||||
marginLeft: $size(3), |
||||
}, |
||||
|
||||
infoBtnWrap: { |
||||
position: 'absolute', |
||||
right: $size(20), |
||||
}, |
||||
}); |
@ -1,16 +1,21 @@
@@ -1,16 +1,21 @@
|
||||
import {ColorValue} from 'react-native'; |
||||
|
||||
export interface Colors { |
||||
$primary: string; |
||||
$secondary: string; |
||||
$white: ColorValue; |
||||
$primary: ColorValue; |
||||
$secondary: ColorValue; |
||||
|
||||
$success: ColorValue; |
||||
$successText: ColorValue; |
||||
|
||||
$success: string; |
||||
$successText: string; |
||||
$error: ColorValue; |
||||
$errorText: ColorValue; |
||||
|
||||
$error: string; |
||||
$errorText: string; |
||||
$warning: ColorValue; |
||||
|
||||
$warning: string; |
||||
$layoutBg: ColorValue; |
||||
|
||||
$layoutBg: string; |
||||
$border: ColorValue; |
||||
|
||||
$textPrimary: string; |
||||
$textPrimary: ColorValue; |
||||
} |
||||
|
@ -1,7 +1,8 @@
@@ -1,7 +1,8 @@
|
||||
import {ColorValue} from 'react-native'; |
||||
export interface NavigationColors { |
||||
tabBar: { |
||||
$activeIconColor: string; |
||||
$iconColor: string; |
||||
$shadowColor: string; |
||||
}; |
||||
tabBar: { |
||||
$activeIconColor: ColorValue; |
||||
$iconColor: ColorValue; |
||||
$shadowColor: ColorValue; |
||||
}; |
||||
} |
||||
|
@ -1,28 +1,37 @@
@@ -1,28 +1,37 @@
|
||||
import {ColorValue} from 'react-native'; |
||||
export interface ButtonsColors { |
||||
primaryBtn: { |
||||
$bg: string; |
||||
$text: string; |
||||
$bg: ColorValue; |
||||
$text: ColorValue; |
||||
}; |
||||
borderBtn: { |
||||
$bg: string; |
||||
$text: string; |
||||
$borderColor: string |
||||
} |
||||
$bg: ColorValue; |
||||
$text: ColorValue; |
||||
$borderColor: ColorValue; |
||||
}; |
||||
} |
||||
|
||||
export interface InputColors { |
||||
iconInput: { |
||||
$icon: string; |
||||
$iconBg: string; |
||||
$placeholder: string; |
||||
$text: string; |
||||
$icon: ColorValue; |
||||
$iconBg: ColorValue; |
||||
$placeholder: ColorValue; |
||||
$text: ColorValue; |
||||
}; |
||||
|
||||
input: { |
||||
$icon: string; |
||||
$placeholder: string; |
||||
$text: string; |
||||
$icon: ColorValue; |
||||
$placeholder: ColorValue; |
||||
$text: ColorValue; |
||||
}; |
||||
} |
||||
|
||||
export interface IconColors { |
||||
icon: { |
||||
$defaultColor: ColorValue; |
||||
$darkGray: ColorValue |
||||
$activeColor: ColorValue; |
||||
}; |
||||
} |
||||
|
||||
export type SharedComponentsColors = ButtonsColors & InputColors; |
||||
export type SharedComponentsColors = ButtonsColors & InputColors & IconColors; |
||||
|
@ -1,9 +1,10 @@
@@ -1,9 +1,10 @@
|
||||
import { NavigationColors } from "../interfaces/navigation.interface"; |
||||
import {sharedComponentsColors} from './shared-components'; |
||||
import {NavigationColors} from '../interfaces/navigation.interface'; |
||||
|
||||
export const navigation: NavigationColors = { |
||||
tabBar: { |
||||
$activeIconColor: '#DE253B', |
||||
$iconColor: '#B2B3B7', |
||||
$shadowColor: 'rgba(221, 37, 59, 0.35)' |
||||
} |
||||
$iconColor: sharedComponentsColors.icon.$defaultColor, |
||||
$activeIconColor: sharedComponentsColors.icon.$activeColor, |
||||
$shadowColor: 'rgba(221, 37, 59, 0.35)', |
||||
}, |
||||
}; |
||||
|
Loading…
Reference in new issue