Skip to content

Commit

Permalink
Merge pull request #4 from n1kko777/1.0.13
Browse files Browse the repository at this point in the history
1.0.13
  • Loading branch information
n1kko777 authored Feb 12, 2021
2 parents ab71a8c + ec37e5f commit 675b835
Show file tree
Hide file tree
Showing 54 changed files with 1,382 additions and 1,435 deletions.
6 changes: 3 additions & 3 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"ios",
"android"
],
"version": "1.0.12",
"version": "1.0.13",
"orientation": "portrait",
"icon": "./assets/logo.png",
"splash": {
Expand All @@ -25,11 +25,11 @@
"ios": {
"supportsTablet": true,
"bundleIdentifier": "ru.mncntrl.n1kko777",
"buildNumber": "1.0.12"
"buildNumber": "1.0.13"
},
"android": {
"package": "ru.mncntrl.n1kko777",
"versionCode": 12,
"versionCode": 13,
"permissions": [
"CAMERA",
"READ_EXTERNAL_STORAGE",
Expand Down
18 changes: 18 additions & 0 deletions package-lock.json

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

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
"eject": "expo eject",
"debug": "open \"rndebugger://set-debugger-loc?host=localhost&port=19001\" && expo start"
},
"dependencies": {
"@eva-design/eva": "^1.4.0",
"@expo/vector-icons": "^10.0.0",
"@react-native-async-storage/async-storage": "^1.13.2",
"@react-native-community/masked-view": "0.1.10",
"@react-navigation/bottom-tabs": "5.1.1",
"@react-navigation/native": "^5.0.9",
Expand All @@ -19,6 +21,7 @@
"@ui-kitten/moment": "^4.4.1",
"axios": "^0.21.1",
"expo": "^38.0.0",
"expo-clipboard": "^1.0.1",
"expo-font": "~8.2.1",
"expo-haptics": "~8.2.1",
"expo-image-picker": "~8.3.0",
Expand Down Expand Up @@ -46,6 +49,7 @@
"react-navigation-tabs": "^2.7.0",
"react-redux": "^7.1.3",
"redux": "^4.0.5",
"redux-devtools-extension": "^2.13.8",
"redux-thunk": "^2.3.0"
},
"devDependencies": {
Expand Down
3 changes: 3 additions & 0 deletions src/components/CustomDatePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
StyleSheet,
TouchableOpacity,
TouchableWithoutFeedback,
Dimensions,
} from "react-native";

import { useTheme, RangeCalendar, Button, Text } from "@ui-kitten/components";
Expand Down Expand Up @@ -147,6 +148,8 @@ const styles = StyleSheet.create({
width: 0,
height: 2,
},
width: Dimensions.get("window").width - 24,
maxWidth: 600,
shadowOpacity: 0.25,
shadowRadius: 3.84,
elevation: 5,
Expand Down
23 changes: 23 additions & 0 deletions src/components/FlexibleView.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React, { memo, useCallback, useState } from "react";
import { ScrollView, Dimensions } from "react-native";
const { height } = Dimensions.get("window");

export const FlexibleView = memo(({ children }) => {
const [screenHeight, setScreenHeight] = useState(0);

const onContentSizeChange = useCallback((contentWidth, contentHeight) => {
// Save the content height in state
setScreenHeight(contentHeight);
}, []);
const scrollEnabled = screenHeight > height;

return (
<ScrollView
style={{ flex: 1 }}
scrollEnabled={scrollEnabled}
onContentSizeChange={onContentSizeChange}
>
{children}
</ScrollView>
);
});
2 changes: 0 additions & 2 deletions src/components/account/AccountList.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { useSelector } from "react-redux";

import { AccountListItem } from "./AccountListItem";

let renderCounter = 0;

export const AccountList = memo(({ navigation }) => {
const store = useSelector((store) => store);
const { profile } = store.profile;
Expand Down
57 changes: 30 additions & 27 deletions src/components/company/CompanyProfileListItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,36 @@ export const CompanyProfileListItem = memo(({ item, onClick }) => {
const themeContext = React.useContext(ThemeContext);
const kittenTheme = useTheme();

const renderItemIcon = useCallback((item, style) => {
delete style.tintColor;
return item.image !== null ? (
<Avatar
style={{
...style,
width: 30,
height: 30,
}}
source={{
uri: item.image,
}}
/>
) : (
<ProfileIcon
fill={
kittenTheme[
`color-primary-${themeContext.theme === "light" ? 800 : 100}`
]
}
style={{
width: 30,
height: 30,
}}
/>
);
}, []);
const renderItemIcon = useCallback(
(item, style) => {
delete style.tintColor;
return item.image !== null ? (
<Avatar
style={{
...style,
width: 30,
height: 30,
}}
source={{
uri: item.image,
}}
/>
) : (
<ProfileIcon
fill={
kittenTheme[
`color-primary-${themeContext.theme === "light" ? 800 : 100}`
]
}
style={{
width: 30,
height: 30,
}}
/>
);
},
[item, themeContext]
);

const renderItemAccessory = (balance) => (
<Text category="s1">{`${splitToDigits(balance)} ₽`}</Text>
Expand Down
23 changes: 18 additions & 5 deletions src/components/home/BalanceComponent.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { memo, useCallback } from "react";
import React, { memo, useCallback, useEffect } from "react";
import { View, StyleSheet } from "react-native";
import { Button, Text, useTheme } from "@ui-kitten/components";

Expand All @@ -15,6 +15,7 @@ import {
} from "../../themes/icons";
import { useSelector } from "react-redux";

let FONT_SIZE = 22;
export const BalanceComponent = memo(({ balance = null }) => {
const themeContext = React.useContext(ThemeContext);
const kittenTheme = useTheme();
Expand All @@ -35,6 +36,14 @@ export const BalanceComponent = memo(({ balance = null }) => {
totalTransactions.toString().replace(/\s/g, "")
);

useEffect(() => {
if (totalActions > 1000000 || totalTransactions > 1000000) {
FONT_SIZE = 20;
} else {
FONT_SIZE = 22;
}
}, [totalActions, totalTransactions]);

const toggleVisibleBalance = useCallback(() => {
setIsVisibleBalance(!isVisibleBalance);
}, [isVisibleBalance]);
Expand All @@ -49,7 +58,7 @@ export const BalanceComponent = memo(({ balance = null }) => {
],
}}
>
{balance !== null && (
{balance !== null ? (
<View style={{ alignItems: "center" }}>
<Text style={{ fontSize: 12, textAlign: "center" }}>{`Баланс ${
isAdmin ? "компании" : "счетов"
Expand Down Expand Up @@ -78,7 +87,7 @@ export const BalanceComponent = memo(({ balance = null }) => {
onPress={toggleVisibleBalance}
/>
</View>
)}
) : null}

<View style={{ flexDirection: "row", justifyContent: "center" }}>
<View style={styles.creaseItem}>
Expand All @@ -94,8 +103,10 @@ export const BalanceComponent = memo(({ balance = null }) => {
style={{
fontWeight: "600",
color: kittenTheme["color-success-600"],
fontWeight: "600",
fontSize: FONT_SIZE,
lineHeight: FONT_SIZE * 1.45,
}}
category="h5"
>
{action}
</Text>
Expand Down Expand Up @@ -124,8 +135,10 @@ export const BalanceComponent = memo(({ balance = null }) => {
style={{
fontWeight: "600",
color: kittenTheme["color-danger-600"],
fontWeight: "600",
fontSize: FONT_SIZE,
lineHeight: FONT_SIZE * 1.45,
}}
category="h5"
>
{transaction}
</Text>
Expand Down
Loading

0 comments on commit 675b835

Please sign in to comment.