Skip to content

Commit

Permalink
Merge pull request #9 from n1kko777/1.1.1
Browse files Browse the repository at this point in the history
1.1.1
  • Loading branch information
n1kko777 authored May 8, 2021
2 parents 4d81d96 + 619a9db commit 458335f
Show file tree
Hide file tree
Showing 12 changed files with 500 additions and 214 deletions.
6 changes: 3 additions & 3 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"description": "Corporate Money Control – мобильное приложение для автоматизации профессиональной деятельности, существенно облегчает и автоматизирует экономические, технические, аналитические процессы, повышая скорость и снижая время и средства на проведение различного рода операций.",
"privacy": "public",
"platforms": ["ios", "android"],
"version": "1.1.0",
"version": "1.1.1",
"orientation": "portrait",
"icon": "./assets/logo.png",
"splash": {
Expand All @@ -20,11 +20,11 @@
"ios": {
"supportsTablet": true,
"bundleIdentifier": "ru.mncntrl.n1kko777",
"buildNumber": "1.1.0"
"buildNumber": "1.1.1"
},
"android": {
"package": "ru.mncntrl.n1kko777",
"versionCode": 110,
"versionCode": 111,
"permissions": [
"CAMERA",
"READ_EXTERNAL_STORAGE",
Expand Down
37 changes: 7 additions & 30 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
]
},
"dependencies": {
"@dietime/react-native-date-picker": "^1.1.1",
"@eva-design/eva": "^2.0.0",
"@expo/vector-icons": "^12.0.0",
"@react-native-async-storage/async-storage": "^1.13.0",
Expand All @@ -43,6 +42,7 @@
"expo-font": "~9.1.0",
"expo-haptics": "~10.0.0",
"expo-image-picker": "~10.1.3",
"expo-linear-gradient": "~9.1.0",
"install": "^0.13.0",
"moment": "^2.29.1",
"npm": "^7.6.3",
Expand Down
21 changes: 19 additions & 2 deletions src/components/company/CompanyProfileList.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,41 @@
import React, { memo, useCallback } from "react";
import { FlatList, RefreshControl } from "react-native";
import { useDispatch } from "react-redux";
import { useDispatch, useSelector } from "react-redux";
import { getShortName } from "../../getShortName";
import { getProfileListData } from "../../store/actions/apiAction";
import { setFilterParams } from "../../store/actions/layoutAction";
import { getLayoutFilterParams } from "../../store/selectors";
import { CompanyProfileListItem } from "./CompanyProfileListItem";

export const CompanyProfileList = memo(
({ dataList, onCompanyRefresh, navigation }) => {
const keyExtractor = useCallback((item) => item.id.toString(), []);

const filteredParams = useSelector(getLayoutFilterParams);

const dispatch = useDispatch();

const onNavigateHandler = useCallback(
(item) => {
dispatch(getProfileListData(item.id)).then(() => {
const targetProfile = {
...(filteredParams !== null ? filteredParams : {}),
profile: [
{
index: 0,
text: getShortName(`${item.first_name} ${item.last_name}`),
title: getShortName(`${item.first_name} ${item.last_name}`),
id: item.id,
},
],
};
dispatch(setFilterParams(targetProfile));
navigation.navigate("CompanyMember", {
profile: item,
});
});
},
[dispatch, navigation]
[dispatch, filteredParams, navigation]
);

const renderItem = useCallback(
Expand Down
37 changes: 9 additions & 28 deletions src/components/home/HomeCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { StyleSheet, View } from "react-native";

import { TouchableOpacity } from "react-native-gesture-handler";
import { AddSmallIcon, RightIcon } from "../../themes/icons";
import { HomeCardItem } from "./HomeCardItem";

import { ThemeContext } from "../../themes/theme-context";
import { HomeCardItem } from "./HomeCardItem";

const { layoutStyle, viewStyle, otherViewStyle } = StyleSheet.create({
layoutStyle: {
Expand All @@ -31,6 +31,8 @@ const { layoutStyle, viewStyle, otherViewStyle } = StyleSheet.create({
export const HomeCard = memo(({ item, navigation, isNavigate }) => {
const themeContext = React.useContext(ThemeContext);
const kittenTheme = useTheme();
const iconFillColor =
kittenTheme[`color-primary-${themeContext.theme === "light" ? 800 : 100}`];

const titleNavigationHandler = useCallback(() => {
navigation.navigate(item.navigate);
Expand All @@ -52,38 +54,16 @@ export const HomeCard = memo(({ item, navigation, isNavigate }) => {
justifyContent: "center",
alignSelf: "center",
}}
onPress={() => titleNavigationHandler()}
onPress={titleNavigationHandler}
>
{item.navigate !== "Operation" ? (
<AddSmallIcon
fill={
kittenTheme[
`color-primary-${themeContext.theme === "light" ? 800 : 100}`
]
}
width={24}
height={24}
/>
<AddSmallIcon fill={iconFillColor} width={24} height={24} />
) : (
<RightIcon
fill={
kittenTheme[
`color-primary-${themeContext.theme === "light" ? 800 : 100}`
]
}
width={30}
height={30}
/>
<RightIcon fill={iconFillColor} width={30} height={30} />
)}
</TouchableOpacity>
),
[
isNavigate,
item.navigate,
kittenTheme,
themeContext.theme,
titleNavigationHandler,
]
[iconFillColor, isNavigate, item.navigate, titleNavigationHandler]
);

const memoHomeCardItem = useMemo(
Expand All @@ -93,14 +73,15 @@ export const HomeCard = memo(({ item, navigation, isNavigate }) => {
<HomeCardItem
kittenTheme={kittenTheme}
themeContext={themeContext}
navigation={navigation}
key={elem.last_updated}
item={elem}
/>
))
) : (
<Text>Список пуст</Text>
),
[item.data, kittenTheme, themeContext]
[item.data, kittenTheme, navigation, themeContext]
);

const renderToallItems = useMemo(
Expand Down
Loading

0 comments on commit 458335f

Please sign in to comment.