fix lint errors

This commit is contained in:
Arnaud Vergnet 2021-05-10 17:55:47 +02:00
parent 0a28cf16e3
commit 2bbb3f60ce
10 changed files with 19 additions and 176 deletions

View file

@ -28,7 +28,7 @@ import { FAB, IconButton, Surface, withTheme } from 'react-native-paper';
import * as Animatable from 'react-native-animatable';
import { StackNavigationProp } from '@react-navigation/stack';
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);

View file

@ -27,7 +27,7 @@ import {
import { FAB } from 'react-native-paper';
import * as Animatable from 'react-native-animatable';
import AutoHideHandler from '../../utils/AutoHideHandler';
import CustomTabBar, { TAB_BAR_HEIGHT } from '../Tabbar/CustomTabBar';
import { TAB_BAR_HEIGHT } from '../Tabbar/CustomTabBar';
type PropsType = {
icon: string;

View file

@ -21,7 +21,7 @@ import * as React from 'react';
import { useTheme } from 'react-native-paper';
import { Modalize } from 'react-native-modalize';
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

View file

@ -46,7 +46,6 @@ import EquipmentConfirmScreen from '../screens/Amicale/Equipment/EquipmentConfir
import DashboardEditScreen from '../screens/Other/Settings/DashboardEditScreen';
import GameStartScreen from '../screens/Game/screens/GameStartScreen';
import ImageGalleryScreen from '../screens/Media/ImageGalleryScreen';
import Test from '../screens/Test';
export enum MainRoutes {
Main = 'main',
@ -102,8 +101,10 @@ function MainStackComponent(props: {
}) {
const { createTabNavigator } = props;
return (
<MainStack.Navigator initialRouteName={MainRoutes.Main} headerMode="screen">
<MainStack.Screen name={'test'} component={Test} />
<MainStack.Navigator
initialRouteName={MainRoutes.Main}
headerMode={'screen'}
>
<MainStack.Screen
name={MainRoutes.Main}
component={createTabNavigator}

View file

@ -69,7 +69,7 @@ export default class AboutDependenciesScreen extends React.Component<{}> {
);
getItemLayout = (
data: Array<ListItemType> | null | undefined,
_data: Array<ListItemType> | null | undefined,
index: number
): { length: number; offset: number; index: number } => ({
length: LIST_ITEM_HEIGHT,

View file

@ -31,9 +31,7 @@ import i18n from 'i18n-js';
import { StackNavigationProp } from '@react-navigation/stack';
import AuthenticatedScreen from '../../../components/Amicale/AuthenticatedScreen';
import CustomHTML from '../../../components/Overrides/CustomHTML';
import CustomTabBar, {
TAB_BAR_HEIGHT,
} from '../../../components/Tabbar/CustomTabBar';
import { TAB_BAR_HEIGHT } from '../../../components/Tabbar/CustomTabBar';
import type { ClubCategoryType, ClubType } from './ClubListScreen';
import { ERROR_TYPE } from '../../../utils/WebData';
import CollapsibleScrollView from '../../../components/Collapsible/CollapsibleScrollView';

View file

@ -25,9 +25,7 @@ import { StackNavigationProp } from '@react-navigation/stack';
import MaterialHeaderButtons, {
Item,
} from '../../components/Overrides/CustomHeaderButton';
import CustomTabBar, {
TAB_BAR_HEIGHT,
} from '../../components/Tabbar/CustomTabBar';
import { TAB_BAR_HEIGHT } from '../../components/Tabbar/CustomTabBar';
import type { FeedItemType } from './HomeScreen';
import CollapsibleScrollView from '../../components/Collapsible/CollapsibleScrollView';
import ImageGalleryButton from '../../components/Media/ImageGalleryButton';

View file

@ -26,9 +26,7 @@ import i18n from 'i18n-js';
import { PERMISSIONS, request, RESULTS } from 'react-native-permissions';
import URLHandler from '../../utils/URLHandler';
import AlertDialog from '../../components/Dialogs/AlertDialog';
import CustomTabBar, {
TAB_BAR_HEIGHT,
} from '../../components/Tabbar/CustomTabBar';
import { TAB_BAR_HEIGHT } from '../../components/Tabbar/CustomTabBar';
import LoadingConfirmDialog from '../../components/Dialogs/LoadingConfirmDialog';
import { MASCOT_STYLE } from '../../components/Mascot/Mascot';
import MascotPopup from '../../components/Mascot/MascotPopup';

View file

@ -123,10 +123,14 @@ function ProximoMainScreen() {
const getHeaderButtons = () => {
return (
<MaterialHeaderButtons>
<Item title="magnify" iconName="magnify" onPress={onPressSearchBtn} />
<Item
title="information"
iconName="information"
title={'magnify'}
iconName={'magnify'}
onPress={onPressSearchBtn}
/>
<Item
title={'information'}
iconName={'information'}
onPress={onPressAboutBtn}
/>
</MaterialHeaderButtons>
@ -181,7 +185,7 @@ function ProximoMainScreen() {
<List.Icon
color={props.color}
style={props.style}
icon="chevron-right"
icon={'chevron-right'}
/>
)}
style={{

View file

@ -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;