Compare commits
4 commits
b9269934a7
...
2b7ec560d2
| Author | SHA1 | Date | |
|---|---|---|---|
| 2b7ec560d2 | |||
| 4af00b8802 | |||
| ea33e1c017 | |||
| f15b489989 |
7 changed files with 57 additions and 47 deletions
3
App.js
3
App.js
|
|
@ -16,6 +16,7 @@ import ConnectionManager from "./src/managers/ConnectionManager";
|
||||||
import URLHandler from "./src/utils/URLHandler";
|
import URLHandler from "./src/utils/URLHandler";
|
||||||
import {setSafeBounceHeight} from "react-navigation-collapsible";
|
import {setSafeBounceHeight} from "react-navigation-collapsible";
|
||||||
import SplashScreen from 'react-native-splash-screen'
|
import SplashScreen from 'react-native-splash-screen'
|
||||||
|
import {OverflowMenuProvider} from "react-navigation-header-buttons";
|
||||||
|
|
||||||
// Native optimizations https://reactnavigation.org/docs/react-native-screens
|
// Native optimizations https://reactnavigation.org/docs/react-native-screens
|
||||||
// Crashes app when navigating away from webview on android 9+
|
// Crashes app when navigating away from webview on android 9+
|
||||||
|
|
@ -189,6 +190,7 @@ export default class App extends React.Component<Props, State> {
|
||||||
} else {
|
} else {
|
||||||
return (
|
return (
|
||||||
<PaperProvider theme={this.state.currentTheme}>
|
<PaperProvider theme={this.state.currentTheme}>
|
||||||
|
<OverflowMenuProvider>
|
||||||
<View style={{backgroundColor: ThemeManager.getCurrentTheme().colors.background, flex: 1}}>
|
<View style={{backgroundColor: ThemeManager.getCurrentTheme().colors.background, flex: 1}}>
|
||||||
<NavigationContainer theme={this.state.currentTheme} ref={this.navigatorRef}>
|
<NavigationContainer theme={this.state.currentTheme} ref={this.navigatorRef}>
|
||||||
<MainNavigator
|
<MainNavigator
|
||||||
|
|
@ -197,6 +199,7 @@ export default class App extends React.Component<Props, State> {
|
||||||
/>
|
/>
|
||||||
</NavigationContainer>
|
</NavigationContainer>
|
||||||
</View>
|
</View>
|
||||||
|
</OverflowMenuProvider>
|
||||||
</PaperProvider>
|
</PaperProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ import com.android.build.OutputFile
|
||||||
|
|
||||||
project.ext.react = [
|
project.ext.react = [
|
||||||
entryFile: "index.js",
|
entryFile: "index.js",
|
||||||
enableHermes: true,
|
enableHermes: false,
|
||||||
]
|
]
|
||||||
|
|
||||||
apply from: "../../node_modules/react-native/react.gradle"
|
apply from: "../../node_modules/react-native/react.gradle"
|
||||||
|
|
@ -136,8 +136,8 @@ android {
|
||||||
applicationId 'fr.amicaleinsat.application'
|
applicationId 'fr.amicaleinsat.application'
|
||||||
minSdkVersion rootProject.ext.minSdkVersion
|
minSdkVersion rootProject.ext.minSdkVersion
|
||||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||||
versionCode 17
|
versionCode 19
|
||||||
versionName "3.0.0"
|
versionName "3.0.2"
|
||||||
missingDimensionStrategy 'react-native-camera', 'general'
|
missingDimensionStrategy 'react-native-camera', 'general'
|
||||||
}
|
}
|
||||||
splits {
|
splits {
|
||||||
|
|
|
||||||
10
package.json
10
package.json
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "campus",
|
"name": "campus",
|
||||||
"version": "3.0.0",
|
"version": "3.0.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "react-native start",
|
"start": "react-native start",
|
||||||
|
|
@ -43,8 +43,8 @@
|
||||||
"react-native-keychain": "^6.0.0",
|
"react-native-keychain": "^6.0.0",
|
||||||
"react-native-linear-gradient": "^2.5.6",
|
"react-native-linear-gradient": "^2.5.6",
|
||||||
"react-native-localize": "^1.4.0",
|
"react-native-localize": "^1.4.0",
|
||||||
"react-native-modalize": "^1.3.6",
|
"react-native-modalize": "^2.0.4",
|
||||||
"react-native-paper": "^3.9.0",
|
"react-native-paper": "^3.10.1",
|
||||||
"react-native-permissions": "^2.1.4",
|
"react-native-permissions": "^2.1.4",
|
||||||
"react-native-push-notification": "^3.3.1",
|
"react-native-push-notification": "^3.3.1",
|
||||||
"react-native-reanimated": "^1.8.0",
|
"react-native-reanimated": "^1.8.0",
|
||||||
|
|
@ -54,8 +54,8 @@
|
||||||
"react-native-splash-screen": "^3.2.0",
|
"react-native-splash-screen": "^3.2.0",
|
||||||
"react-native-vector-icons": "^6.6.0",
|
"react-native-vector-icons": "^6.6.0",
|
||||||
"react-native-webview": "^9.4.0",
|
"react-native-webview": "^9.4.0",
|
||||||
"react-navigation-collapsible": "^5.5.0",
|
"react-navigation-collapsible": "^5.6.0",
|
||||||
"react-navigation-header-buttons": "^3.0.5"
|
"react-navigation-header-buttons": "^4.0.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.9.6",
|
"@babel/core": "^7.9.6",
|
||||||
|
|
|
||||||
|
|
@ -6,26 +6,20 @@ import {HeaderButton, HeaderButtons} from 'react-navigation-header-buttons';
|
||||||
import {withTheme} from "react-native-paper";
|
import {withTheme} from "react-native-paper";
|
||||||
import * as Touchable from "react-native/Libraries/Components/Touchable/TouchableNativeFeedback.android";
|
import * as Touchable from "react-native/Libraries/Components/Touchable/TouchableNativeFeedback.android";
|
||||||
|
|
||||||
const MaterialHeaderButton = (props: Object) => <HeaderButton
|
const MaterialHeaderButton = (props: Object) =>
|
||||||
|
<HeaderButton
|
||||||
|
{...props}
|
||||||
IconComponent={MaterialCommunityIcons}
|
IconComponent={MaterialCommunityIcons}
|
||||||
iconSize={26}
|
iconSize={26}
|
||||||
color={props.color != null ? props.color : props.theme.colors.text}
|
color={props.color != null ? props.color : props.theme.colors.text}
|
||||||
background={Touchable.Ripple(props.theme.colors.ripple, true)}
|
background={Touchable.Ripple(props.theme.colors.ripple, true)}
|
||||||
{...props}
|
|
||||||
/>;
|
/>;
|
||||||
|
|
||||||
const MaterialHeaderButtons = (props: Object) => {
|
const MaterialHeaderButtons = (props: Object) => {
|
||||||
return (
|
return (
|
||||||
<HeaderButtons
|
<HeaderButtons
|
||||||
HeaderButtonComponent={withTheme(MaterialHeaderButton)}
|
|
||||||
OverflowIcon={
|
|
||||||
<MaterialCommunityIcons
|
|
||||||
name="dots-vertical"
|
|
||||||
size={26}
|
|
||||||
color={props.theme.colors.text}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
{...props}
|
{...props}
|
||||||
|
HeaderButtonComponent={withTheme(MaterialHeaderButton)}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -6,16 +6,22 @@ import BasicLoadingScreen from "./BasicLoadingScreen";
|
||||||
import ErrorView from "./ErrorView";
|
import ErrorView from "./ErrorView";
|
||||||
import {ERROR_TYPE} from "../../utils/WebData";
|
import {ERROR_TYPE} from "../../utils/WebData";
|
||||||
import MaterialHeaderButtons, {Item} from '../Overrides/CustomHeaderButton';
|
import MaterialHeaderButtons, {Item} from '../Overrides/CustomHeaderButton';
|
||||||
import {HiddenItem} from "react-navigation-header-buttons";
|
import {Divider, HiddenItem, OverflowMenu} from "react-navigation-header-buttons";
|
||||||
import i18n from 'i18n-js';
|
import i18n from 'i18n-js';
|
||||||
import {Animated, BackHandler, Linking} from "react-native";
|
import {Animated, BackHandler, Linking} from "react-native";
|
||||||
import {withCollapsible} from "../../utils/withCollapsible";
|
import {withCollapsible} from "../../utils/withCollapsible";
|
||||||
|
import MaterialCommunityIcons from "react-native-vector-icons/MaterialCommunityIcons";
|
||||||
|
import {withTheme} from "react-native-paper";
|
||||||
|
import type {CustomTheme} from "../../managers/ThemeManager";
|
||||||
|
import {StackNavigationProp} from "@react-navigation/stack";
|
||||||
|
import {Collapsible} from "react-navigation-collapsible";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
navigation: Object,
|
navigation: StackNavigationProp,
|
||||||
|
theme: CustomTheme,
|
||||||
url: string,
|
url: string,
|
||||||
customJS: string,
|
customJS: string,
|
||||||
collapsibleStack: Object,
|
collapsibleStack: Collapsible,
|
||||||
onMessage: Function,
|
onMessage: Function,
|
||||||
onScroll: Function,
|
onScroll: Function,
|
||||||
showAdvancedControls: boolean,
|
showAdvancedControls: boolean,
|
||||||
|
|
@ -104,19 +110,28 @@ class WebViewScreen extends React.PureComponent<Props> {
|
||||||
<Item
|
<Item
|
||||||
title="refresh"
|
title="refresh"
|
||||||
iconName="refresh"
|
iconName="refresh"
|
||||||
onPress={this.onRefreshClicked}/>
|
onPress={this.onRefreshClicked}
|
||||||
|
/>
|
||||||
|
<OverflowMenu
|
||||||
|
style={{marginHorizontal: 10}}
|
||||||
|
OverflowIcon={
|
||||||
|
<MaterialCommunityIcons
|
||||||
|
name="dots-vertical"
|
||||||
|
size={26}
|
||||||
|
color={this.props.theme.colors.text}
|
||||||
|
/>}
|
||||||
|
>
|
||||||
<HiddenItem
|
<HiddenItem
|
||||||
title={i18n.t("general.goBack")}
|
title={i18n.t("general.goBack")}
|
||||||
iconName="arrow-left"
|
|
||||||
onPress={this.onGoBackClicked}/>
|
onPress={this.onGoBackClicked}/>
|
||||||
<HiddenItem
|
<HiddenItem
|
||||||
title={i18n.t("general.goForward")}
|
title={i18n.t("general.goForward")}
|
||||||
iconName="arrow-right"
|
|
||||||
onPress={this.onGoForwardClicked}/>
|
onPress={this.onGoForwardClicked}/>
|
||||||
|
<Divider/>
|
||||||
<HiddenItem
|
<HiddenItem
|
||||||
title={i18n.t("general.openInBrowser")}
|
title={i18n.t("general.openInBrowser")}
|
||||||
iconName="web"
|
|
||||||
onPress={this.onOpenClicked}/>
|
onPress={this.onOpenClicked}/>
|
||||||
|
</OverflowMenu>
|
||||||
</MaterialHeaderButtons>
|
</MaterialHeaderButtons>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -179,4 +194,4 @@ class WebViewScreen extends React.PureComponent<Props> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default withCollapsible(WebViewScreen);
|
export default withCollapsible(withTheme(WebViewScreen));
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import {FlatList, Linking, Platform, View} from 'react-native';
|
||||||
import i18n from "i18n-js";
|
import i18n from "i18n-js";
|
||||||
import AsyncStorageManager from "../../managers/AsyncStorageManager";
|
import AsyncStorageManager from "../../managers/AsyncStorageManager";
|
||||||
import {Avatar, Card, List, Title, withTheme} from 'react-native-paper';
|
import {Avatar, Card, List, Title, withTheme} from 'react-native-paper';
|
||||||
|
import packageJson from "../../../package.json";
|
||||||
|
|
||||||
const links = {
|
const links = {
|
||||||
appstore: 'https://apps.apple.com/us/app/campus-amicale-insat/id1477722148',
|
appstore: 'https://apps.apple.com/us/app/campus-amicale-insat/id1477722148',
|
||||||
|
|
@ -217,7 +218,7 @@ class AboutScreen extends React.Component<Props, State> {
|
||||||
<Card style={{marginBottom: 10}}>
|
<Card style={{marginBottom: 10}}>
|
||||||
<Card.Title
|
<Card.Title
|
||||||
title={"Campus"}
|
title={"Campus"}
|
||||||
subtitle={"2.0.0"}
|
subtitle={packageJson.version}
|
||||||
left={this.getAppIcon}/>
|
left={this.getAppIcon}/>
|
||||||
<Card.Content>
|
<Card.Content>
|
||||||
<FlatList
|
<FlatList
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@ import {stringMatchQuery} from "../../../utils/Search";
|
||||||
import ProximoListItem from "../../../components/Lists/Proximo/ProximoListItem";
|
import ProximoListItem from "../../../components/Lists/Proximo/ProximoListItem";
|
||||||
import MaterialHeaderButtons, {Item} from "../../../components/Overrides/CustomHeaderButton";
|
import MaterialHeaderButtons, {Item} from "../../../components/Overrides/CustomHeaderButton";
|
||||||
import {withCollapsible} from "../../../utils/withCollapsible";
|
import {withCollapsible} from "../../../utils/withCollapsible";
|
||||||
import CustomTabBar from "../../../components/Tabbar/CustomTabBar";
|
|
||||||
|
|
||||||
function sortPrice(a, b) {
|
function sortPrice(a, b) {
|
||||||
return a.price - b.price;
|
return a.price - b.price;
|
||||||
|
|
@ -306,7 +305,6 @@ class ProximoListScreen extends React.Component<Props, State> {
|
||||||
<CustomModal onRef={this.onModalRef}>
|
<CustomModal onRef={this.onModalRef}>
|
||||||
{this.state.modalCurrentDisplayItem}
|
{this.state.modalCurrentDisplayItem}
|
||||||
</CustomModal>
|
</CustomModal>
|
||||||
{/*$FlowFixMe*/}
|
|
||||||
<Animated.FlatList
|
<Animated.FlatList
|
||||||
data={this.listData}
|
data={this.listData}
|
||||||
extraData={this.state.currentSearchString + this.state.currentSortMode}
|
extraData={this.state.currentSearchString + this.state.currentSortMode}
|
||||||
|
|
@ -320,7 +318,6 @@ class ProximoListScreen extends React.Component<Props, State> {
|
||||||
onScroll={onScroll}
|
onScroll={onScroll}
|
||||||
contentContainerStyle={{
|
contentContainerStyle={{
|
||||||
paddingTop: containerPaddingTop,
|
paddingTop: containerPaddingTop,
|
||||||
paddingBottom: CustomTabBar.TAB_BAR_HEIGHT
|
|
||||||
}}
|
}}
|
||||||
scrollIndicatorInsets={{top: scrollIndicatorInsetTop}}
|
scrollIndicatorInsets={{top: scrollIndicatorInsetTop}}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue