fix lint errors
This commit is contained in:
parent
0a28cf16e3
commit
2bbb3f60ce
10 changed files with 19 additions and 176 deletions
|
@ -28,7 +28,7 @@ import { FAB, IconButton, Surface, withTheme } from 'react-native-paper';
|
||||||
import * as Animatable from 'react-native-animatable';
|
import * as Animatable from 'react-native-animatable';
|
||||||
import { StackNavigationProp } from '@react-navigation/stack';
|
import { StackNavigationProp } from '@react-navigation/stack';
|
||||||
import AutoHideHandler from '../../utils/AutoHideHandler';
|
import AutoHideHandler from '../../utils/AutoHideHandler';
|
||||||
import CustomTabBar, { TAB_BAR_HEIGHT } from '../Tabbar/CustomTabBar';
|
import { TAB_BAR_HEIGHT } from '../Tabbar/CustomTabBar';
|
||||||
|
|
||||||
const AnimatedFAB = Animatable.createAnimatableComponent(FAB);
|
const AnimatedFAB = Animatable.createAnimatableComponent(FAB);
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ import {
|
||||||
import { FAB } from 'react-native-paper';
|
import { FAB } from 'react-native-paper';
|
||||||
import * as Animatable from 'react-native-animatable';
|
import * as Animatable from 'react-native-animatable';
|
||||||
import AutoHideHandler from '../../utils/AutoHideHandler';
|
import AutoHideHandler from '../../utils/AutoHideHandler';
|
||||||
import CustomTabBar, { TAB_BAR_HEIGHT } from '../Tabbar/CustomTabBar';
|
import { TAB_BAR_HEIGHT } from '../Tabbar/CustomTabBar';
|
||||||
|
|
||||||
type PropsType = {
|
type PropsType = {
|
||||||
icon: string;
|
icon: string;
|
||||||
|
|
|
@ -21,7 +21,7 @@ import * as React from 'react';
|
||||||
import { useTheme } from 'react-native-paper';
|
import { useTheme } from 'react-native-paper';
|
||||||
import { Modalize } from 'react-native-modalize';
|
import { Modalize } from 'react-native-modalize';
|
||||||
import { View } from 'react-native-animatable';
|
import { View } from 'react-native-animatable';
|
||||||
import CustomTabBar, { TAB_BAR_HEIGHT } from '../Tabbar/CustomTabBar';
|
import { TAB_BAR_HEIGHT } from '../Tabbar/CustomTabBar';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Abstraction layer for Modalize component, using custom configuration
|
* Abstraction layer for Modalize component, using custom configuration
|
||||||
|
|
|
@ -46,7 +46,6 @@ import EquipmentConfirmScreen from '../screens/Amicale/Equipment/EquipmentConfir
|
||||||
import DashboardEditScreen from '../screens/Other/Settings/DashboardEditScreen';
|
import DashboardEditScreen from '../screens/Other/Settings/DashboardEditScreen';
|
||||||
import GameStartScreen from '../screens/Game/screens/GameStartScreen';
|
import GameStartScreen from '../screens/Game/screens/GameStartScreen';
|
||||||
import ImageGalleryScreen from '../screens/Media/ImageGalleryScreen';
|
import ImageGalleryScreen from '../screens/Media/ImageGalleryScreen';
|
||||||
import Test from '../screens/Test';
|
|
||||||
|
|
||||||
export enum MainRoutes {
|
export enum MainRoutes {
|
||||||
Main = 'main',
|
Main = 'main',
|
||||||
|
@ -102,8 +101,10 @@ function MainStackComponent(props: {
|
||||||
}) {
|
}) {
|
||||||
const { createTabNavigator } = props;
|
const { createTabNavigator } = props;
|
||||||
return (
|
return (
|
||||||
<MainStack.Navigator initialRouteName={MainRoutes.Main} headerMode="screen">
|
<MainStack.Navigator
|
||||||
<MainStack.Screen name={'test'} component={Test} />
|
initialRouteName={MainRoutes.Main}
|
||||||
|
headerMode={'screen'}
|
||||||
|
>
|
||||||
<MainStack.Screen
|
<MainStack.Screen
|
||||||
name={MainRoutes.Main}
|
name={MainRoutes.Main}
|
||||||
component={createTabNavigator}
|
component={createTabNavigator}
|
||||||
|
|
|
@ -69,7 +69,7 @@ export default class AboutDependenciesScreen extends React.Component<{}> {
|
||||||
);
|
);
|
||||||
|
|
||||||
getItemLayout = (
|
getItemLayout = (
|
||||||
data: Array<ListItemType> | null | undefined,
|
_data: Array<ListItemType> | null | undefined,
|
||||||
index: number
|
index: number
|
||||||
): { length: number; offset: number; index: number } => ({
|
): { length: number; offset: number; index: number } => ({
|
||||||
length: LIST_ITEM_HEIGHT,
|
length: LIST_ITEM_HEIGHT,
|
||||||
|
|
|
@ -31,9 +31,7 @@ import i18n from 'i18n-js';
|
||||||
import { StackNavigationProp } from '@react-navigation/stack';
|
import { StackNavigationProp } from '@react-navigation/stack';
|
||||||
import AuthenticatedScreen from '../../../components/Amicale/AuthenticatedScreen';
|
import AuthenticatedScreen from '../../../components/Amicale/AuthenticatedScreen';
|
||||||
import CustomHTML from '../../../components/Overrides/CustomHTML';
|
import CustomHTML from '../../../components/Overrides/CustomHTML';
|
||||||
import CustomTabBar, {
|
import { TAB_BAR_HEIGHT } from '../../../components/Tabbar/CustomTabBar';
|
||||||
TAB_BAR_HEIGHT,
|
|
||||||
} from '../../../components/Tabbar/CustomTabBar';
|
|
||||||
import type { ClubCategoryType, ClubType } from './ClubListScreen';
|
import type { ClubCategoryType, ClubType } from './ClubListScreen';
|
||||||
import { ERROR_TYPE } from '../../../utils/WebData';
|
import { ERROR_TYPE } from '../../../utils/WebData';
|
||||||
import CollapsibleScrollView from '../../../components/Collapsible/CollapsibleScrollView';
|
import CollapsibleScrollView from '../../../components/Collapsible/CollapsibleScrollView';
|
||||||
|
|
|
@ -25,9 +25,7 @@ import { StackNavigationProp } from '@react-navigation/stack';
|
||||||
import MaterialHeaderButtons, {
|
import MaterialHeaderButtons, {
|
||||||
Item,
|
Item,
|
||||||
} from '../../components/Overrides/CustomHeaderButton';
|
} from '../../components/Overrides/CustomHeaderButton';
|
||||||
import CustomTabBar, {
|
import { TAB_BAR_HEIGHT } from '../../components/Tabbar/CustomTabBar';
|
||||||
TAB_BAR_HEIGHT,
|
|
||||||
} from '../../components/Tabbar/CustomTabBar';
|
|
||||||
import type { FeedItemType } from './HomeScreen';
|
import type { FeedItemType } from './HomeScreen';
|
||||||
import CollapsibleScrollView from '../../components/Collapsible/CollapsibleScrollView';
|
import CollapsibleScrollView from '../../components/Collapsible/CollapsibleScrollView';
|
||||||
import ImageGalleryButton from '../../components/Media/ImageGalleryButton';
|
import ImageGalleryButton from '../../components/Media/ImageGalleryButton';
|
||||||
|
|
|
@ -26,9 +26,7 @@ import i18n from 'i18n-js';
|
||||||
import { PERMISSIONS, request, RESULTS } from 'react-native-permissions';
|
import { PERMISSIONS, request, RESULTS } from 'react-native-permissions';
|
||||||
import URLHandler from '../../utils/URLHandler';
|
import URLHandler from '../../utils/URLHandler';
|
||||||
import AlertDialog from '../../components/Dialogs/AlertDialog';
|
import AlertDialog from '../../components/Dialogs/AlertDialog';
|
||||||
import CustomTabBar, {
|
import { TAB_BAR_HEIGHT } from '../../components/Tabbar/CustomTabBar';
|
||||||
TAB_BAR_HEIGHT,
|
|
||||||
} from '../../components/Tabbar/CustomTabBar';
|
|
||||||
import LoadingConfirmDialog from '../../components/Dialogs/LoadingConfirmDialog';
|
import LoadingConfirmDialog from '../../components/Dialogs/LoadingConfirmDialog';
|
||||||
import { MASCOT_STYLE } from '../../components/Mascot/Mascot';
|
import { MASCOT_STYLE } from '../../components/Mascot/Mascot';
|
||||||
import MascotPopup from '../../components/Mascot/MascotPopup';
|
import MascotPopup from '../../components/Mascot/MascotPopup';
|
||||||
|
|
|
@ -123,10 +123,14 @@ function ProximoMainScreen() {
|
||||||
const getHeaderButtons = () => {
|
const getHeaderButtons = () => {
|
||||||
return (
|
return (
|
||||||
<MaterialHeaderButtons>
|
<MaterialHeaderButtons>
|
||||||
<Item title="magnify" iconName="magnify" onPress={onPressSearchBtn} />
|
|
||||||
<Item
|
<Item
|
||||||
title="information"
|
title={'magnify'}
|
||||||
iconName="information"
|
iconName={'magnify'}
|
||||||
|
onPress={onPressSearchBtn}
|
||||||
|
/>
|
||||||
|
<Item
|
||||||
|
title={'information'}
|
||||||
|
iconName={'information'}
|
||||||
onPress={onPressAboutBtn}
|
onPress={onPressAboutBtn}
|
||||||
/>
|
/>
|
||||||
</MaterialHeaderButtons>
|
</MaterialHeaderButtons>
|
||||||
|
@ -181,7 +185,7 @@ function ProximoMainScreen() {
|
||||||
<List.Icon
|
<List.Icon
|
||||||
color={props.color}
|
color={props.color}
|
||||||
style={props.style}
|
style={props.style}
|
||||||
icon="chevron-right"
|
icon={'chevron-right'}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
style={{
|
style={{
|
||||||
|
|
|
@ -1,156 +0,0 @@
|
||||||
import { useNavigation } from '@react-navigation/core';
|
|
||||||
import { StackNavigationProp } from '@react-navigation/stack';
|
|
||||||
import React from 'react';
|
|
||||||
import { Animated, View } from 'react-native';
|
|
||||||
import { Text } from 'react-native-paper';
|
|
||||||
import {
|
|
||||||
Collapsible,
|
|
||||||
useCollapsibleHeader,
|
|
||||||
} from 'react-navigation-collapsible';
|
|
||||||
import CollapsibleFlatList from '../components/Collapsible/CollapsibleFlatList';
|
|
||||||
import FeedItem from '../components/Home/FeedItem';
|
|
||||||
import WebSectionList from '../components/Screens/WebSectionList';
|
|
||||||
import withCollapsible from '../utils/withCollapsible';
|
|
||||||
import { FeedItemType } from './Home/HomeScreen';
|
|
||||||
import i18n from 'i18n-js';
|
|
||||||
import CollapsibleSectionList from '../components/Collapsible/CollapsibleSectionList';
|
|
||||||
|
|
||||||
// export default function Test() {
|
|
||||||
// const {
|
|
||||||
// onScroll /* Event handler */,
|
|
||||||
// onScrollWithListener /* Event handler creator */,
|
|
||||||
// containerPaddingTop /* number */,
|
|
||||||
// scrollIndicatorInsetTop /* number */,
|
|
||||||
// /* Animated.AnimatedValue contentOffset from scrolling */
|
|
||||||
// positionY /* 0.0 ~ length of scrollable component (contentOffset)
|
|
||||||
// /* Animated.AnimatedInterpolation by scrolling */,
|
|
||||||
// translateY /* 0.0 ~ -headerHeight */,
|
|
||||||
// progress /* 0.0 ~ 1.0 */,
|
|
||||||
// opacity /* 1.0 ~ 0.0 */,
|
|
||||||
// } = useCollapsibleHeader();
|
|
||||||
|
|
||||||
// const renderItem = () => {
|
|
||||||
// return (
|
|
||||||
// <View
|
|
||||||
// style={{
|
|
||||||
// marginTop: 50,
|
|
||||||
// marginBottom: 50,
|
|
||||||
// }}
|
|
||||||
// >
|
|
||||||
// <Text>TEST</Text>
|
|
||||||
// </View>
|
|
||||||
// );
|
|
||||||
// };
|
|
||||||
|
|
||||||
// return (
|
|
||||||
// <Animated.FlatList
|
|
||||||
// onScroll={onScroll}
|
|
||||||
// contentContainerStyle={{ paddingTop: containerPaddingTop }}
|
|
||||||
// scrollIndicatorInsets={{ top: scrollIndicatorInsetTop }}
|
|
||||||
// data={[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}
|
|
||||||
// renderItem={renderItem}
|
|
||||||
// />
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
|
|
||||||
type Props = {
|
|
||||||
navigation: StackNavigationProp<any>;
|
|
||||||
collapsibleStack: Collapsible;
|
|
||||||
};
|
|
||||||
|
|
||||||
const DATA_URL =
|
|
||||||
'https://etud.insa-toulouse.fr/~amicale_app/v2/dashboard/dashboard_data.json';
|
|
||||||
const FEED_ITEM_HEIGHT = 500;
|
|
||||||
|
|
||||||
const REFRESH_TIME = 1000 * 20; // Refresh every 20 seconds
|
|
||||||
class Test extends React.Component<Props> {
|
|
||||||
createDataset = (): Array<{
|
|
||||||
title: string;
|
|
||||||
data: [] | Array<FeedItemType>;
|
|
||||||
id: string;
|
|
||||||
}> => {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
title: 'title',
|
|
||||||
data: [
|
|
||||||
{
|
|
||||||
id: '0',
|
|
||||||
message: 'message',
|
|
||||||
image: '',
|
|
||||||
link: '',
|
|
||||||
page_id: 'amicale.deseleves',
|
|
||||||
time: 0,
|
|
||||||
url: '',
|
|
||||||
video: '',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: '1',
|
|
||||||
message: 'message',
|
|
||||||
image: '',
|
|
||||||
link: '',
|
|
||||||
page_id: 'amicale.deseleves',
|
|
||||||
time: 0,
|
|
||||||
url: '',
|
|
||||||
video: '',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: '2',
|
|
||||||
message: 'message',
|
|
||||||
image: '',
|
|
||||||
link: '',
|
|
||||||
page_id: 'amicale.deseleves',
|
|
||||||
time: 0,
|
|
||||||
url: '',
|
|
||||||
video: '',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
id: '0',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
};
|
|
||||||
getRenderItem = ({ item }: { item: FeedItemType }) => (
|
|
||||||
<FeedItem item={item} height={FEED_ITEM_HEIGHT} />
|
|
||||||
);
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const renderItem = () => {
|
|
||||||
return (
|
|
||||||
<View
|
|
||||||
style={{
|
|
||||||
marginTop: 50,
|
|
||||||
marginBottom: 50,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Text>TEST</Text>
|
|
||||||
</View>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const props = this.props;
|
|
||||||
// return (
|
|
||||||
// <CollapsibleFlatList
|
|
||||||
// data={[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}
|
|
||||||
// renderItem={renderItem}
|
|
||||||
// />
|
|
||||||
// );
|
|
||||||
// return (
|
|
||||||
// <CollapsibleSectionList
|
|
||||||
// sections={[{ title: '', data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] }]}
|
|
||||||
// renderItem={renderItem}
|
|
||||||
// />
|
|
||||||
// );
|
|
||||||
return (
|
|
||||||
<WebSectionList
|
|
||||||
createDataset={this.createDataset}
|
|
||||||
autoRefreshTime={REFRESH_TIME}
|
|
||||||
refreshOnFocus
|
|
||||||
fetchUrl={DATA_URL}
|
|
||||||
renderItem={this.getRenderItem}
|
|
||||||
itemHeight={FEED_ITEM_HEIGHT}
|
|
||||||
showError={false}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Test;
|
|
Loading…
Reference in a new issue