Browse Source

Organized custom components

Arnaud Vergnet 1 year ago
parent
commit
3f576c2287
37 changed files with 43 additions and 43 deletions
  1. 1
    1
      App.js
  2. 2
    2
      components/Amicale/AuthenticatedScreen.js
  3. 1
    1
      components/Amicale/LogoutDialog.js
  4. 0
    0
      components/Custom/AlertDialog.js
  5. 0
    0
      components/Custom/CustomAgenda.js
  6. 2
    2
      components/Custom/CustomIntroSlider.js
  7. 0
    0
      components/Custom/CustomModal.js
  8. 0
    0
      components/Custom/HeaderButton.js
  9. 0
    0
      components/Custom/NetworkErrorComponent.js
  10. 0
    0
      components/Home/EventDashboardItem.js
  11. 1
    1
      components/Home/FeedItem.js
  12. 1
    1
      components/Home/PreviewEventDashboardItem.js
  13. 0
    0
      components/Home/SquareDashboardItem.js
  14. 0
    0
      components/Lists/EmptyWebSectionListItem.js
  15. 1
    1
      components/Lists/ProxiwashListItem.js
  16. 0
    0
      components/Lists/PureFlatList.js
  17. 1
    1
      components/Lists/WebSectionList.js
  18. 1
    1
      components/Screens/WebViewScreen.js
  19. 4
    4
      components/Sidebar/Sidebar.js
  20. 0
    0
      components/Sidebar/SidebarDivider.js
  21. 0
    0
      components/Sidebar/SidebarItem.js
  22. 2
    2
      navigation/DrawerNavigator.js
  23. 1
    1
      navigation/MainTabNavigator.js
  24. 1
    1
      screens/About/AboutScreen.js
  25. 1
    1
      screens/About/DebugScreen.js
  26. 1
    1
      screens/Amicale/LoginScreen.js
  27. 3
    3
      screens/Amicale/ProfileScreen.js
  28. 5
    5
      screens/HomeScreen.js
  29. 1
    1
      screens/Planning/PlanningScreen.js
  30. 2
    2
      screens/Proximo/ProximoListScreen.js
  31. 2
    2
      screens/Proximo/ProximoMainScreen.js
  32. 4
    4
      screens/Proxiwash/ProxiwashScreen.js
  33. 1
    1
      screens/SelfMenuScreen.js
  34. 1
    1
      screens/Tetris/TetrisScreen.js
  35. 1
    1
      screens/Websites/AvailableRoomScreen.js
  36. 1
    1
      screens/Websites/BibScreen.js
  37. 1
    1
      screens/Websites/PlanexScreen.js

+ 1
- 1
App.js View File

@@ -4,7 +4,7 @@ import * as React from 'react';
4 4
 import {Platform, StatusBar} from 'react-native';
5 5
 import LocaleManager from './managers/LocaleManager';
6 6
 import AsyncStorageManager from "./managers/AsyncStorageManager";
7
-import CustomIntroSlider from "./components/CustomIntroSlider";
7
+import CustomIntroSlider from "./components/Custom/CustomIntroSlider";
8 8
 import {SplashScreen} from 'expo';
9 9
 import ThemeManager from './managers/ThemeManager';
10 10
 import {NavigationContainer} from '@react-navigation/native';

components/AuthenticatedScreen.js → components/Amicale/AuthenticatedScreen.js View File

@@ -3,8 +3,8 @@
3 3
 import * as React from 'react';
4 4
 import {View} from "react-native";
5 5
 import {ActivityIndicator, withTheme} from 'react-native-paper';
6
-import ConnectionManager, {ERROR_TYPE} from "../managers/ConnectionManager";
7
-import NetworkErrorComponent from "./NetworkErrorComponent";
6
+import ConnectionManager, {ERROR_TYPE} from "../../managers/ConnectionManager";
7
+import NetworkErrorComponent from "../Custom/NetworkErrorComponent";
8 8
 import i18n from 'i18n-js';
9 9
 
10 10
 type Props = {

components/LogoutDialog.js → components/Amicale/LogoutDialog.js View File

@@ -2,7 +2,7 @@
2 2
 
3 3
 import * as React from 'react';
4 4
 import {ActivityIndicator, Button, Dialog, Paragraph, Portal, withTheme} from 'react-native-paper';
5
-import ConnectionManager from "../managers/ConnectionManager";
5
+import ConnectionManager from "../../managers/ConnectionManager";
6 6
 import i18n from 'i18n-js';
7 7
 
8 8
 type Props = {

components/AlertDialog.js → components/Custom/AlertDialog.js View File


components/CustomAgenda.js → components/Custom/CustomAgenda.js View File


components/CustomIntroSlider.js → components/Custom/CustomIntroSlider.js View File

@@ -7,7 +7,7 @@ import {MaterialCommunityIcons} from "@expo/vector-icons";
7 7
 import {Text} from "react-native-paper";
8 8
 import i18n from 'i18n-js';
9 9
 import AppIntroSlider from "react-native-app-intro-slider";
10
-import Update from "../constants/Update";
10
+import Update from "../../constants/Update";
11 11
 
12 12
 type Props = {
13 13
     onDone: Function,
@@ -34,7 +34,7 @@ export default class CustomIntroSlider extends React.Component<Props> {
34 34
                 key: '1',
35 35
                 title: i18n.t('intro.slide1.title'),
36 36
                 text: i18n.t('intro.slide1.text'),
37
-                image: require('../assets/splash.png'),
37
+                image: require('../../assets/splash.png'),
38 38
                 colors: ['#e01928', '#be1522'],
39 39
             },
40 40
             {

components/CustomModal.js → components/Custom/CustomModal.js View File


components/HeaderButton.js → components/Custom/HeaderButton.js View File


components/NetworkErrorComponent.js → components/Custom/NetworkErrorComponent.js View File


components/EventDashboardItem.js → components/Home/EventDashboardItem.js View File


components/FeedItem.js → components/Home/FeedItem.js View File

@@ -4,7 +4,7 @@ import {TouchableOpacity, View} from "react-native";
4 4
 import Autolink from "react-native-autolink";
5 5
 import i18n from "i18n-js";
6 6
 
7
-const ICON_AMICALE = require('../assets/amicale.png');
7
+const ICON_AMICALE = require('../../assets/amicale.png');
8 8
 
9 9
 /**
10 10
  * Gets the amicale INSAT logo

components/PreviewEventDashboardItem.js → components/Home/PreviewEventDashboardItem.js View File

@@ -5,7 +5,7 @@ import {StyleSheet, View} from "react-native";
5 5
 import HTML from "react-native-render-html";
6 6
 import i18n from "i18n-js";
7 7
 import {Avatar, Button, Card, withTheme} from 'react-native-paper';
8
-import {getFormattedEventTime, isDescriptionEmpty} from "../utils/Planning";
8
+import {getFormattedEventTime, isDescriptionEmpty} from "../../utils/Planning";
9 9
 
10 10
 /**
11 11
  * Component used to display an event preview if an event is available

components/SquareDashboardItem.js → components/Home/SquareDashboardItem.js View File


components/EmptyWebSectionListItem.js → components/Lists/EmptyWebSectionListItem.js View File


components/ProxiwashListItem.js → components/Lists/ProxiwashListItem.js View File

@@ -1,7 +1,7 @@
1 1
 import * as React from 'react';
2 2
 import {Avatar, Card, Text, withTheme} from 'react-native-paper';
3 3
 import {StyleSheet, View} from "react-native";
4
-import ProxiwashConstants from "../constants/ProxiwashConstants";
4
+import ProxiwashConstants from "../../constants/ProxiwashConstants";
5 5
 
6 6
 /**
7 7
  * Component used to display a proxiwash item, showing machine progression and state

components/PureFlatList.js → components/Lists/PureFlatList.js View File


components/WebSectionList.js → components/Lists/WebSectionList.js View File

@@ -1,7 +1,7 @@
1 1
 // @flow
2 2
 
3 3
 import * as React from 'react';
4
-import {readData} from "../utils/WebData";
4
+import {readData} from "../../utils/WebData";
5 5
 import i18n from "i18n-js";
6 6
 import {Snackbar} from 'react-native-paper';
7 7
 import {RefreshControl, SectionList, View} from "react-native";

components/WebViewScreen.js → components/Screens/WebViewScreen.js View File

@@ -4,7 +4,7 @@ import * as React from 'react';
4 4
 import {View} from 'react-native';
5 5
 import WebView from "react-native-webview";
6 6
 import {ActivityIndicator, withTheme} from 'react-native-paper';
7
-import HeaderButton from "./HeaderButton";
7
+import HeaderButton from "../Custom/HeaderButton";
8 8
 
9 9
 type Props = {
10 10
     navigation: Object,

components/Sidebar.js → components/Sidebar/Sidebar.js View File

@@ -3,12 +3,12 @@
3 3
 import * as React from 'react';
4 4
 import {Dimensions, FlatList, Image, Platform, StyleSheet, View,} from 'react-native';
5 5
 import i18n from "i18n-js";
6
-import {openBrowser} from "../utils/WebBrowser";
6
+import {openBrowser} from "../../utils/WebBrowser";
7 7
 import SidebarDivider from "./SidebarDivider";
8 8
 import SidebarItem from "./SidebarItem";
9 9
 import {TouchableRipple, withTheme} from "react-native-paper";
10
-import ConnectionManager from "../managers/ConnectionManager";
11
-import LogoutDialog from "./LogoutDialog";
10
+import ConnectionManager from "../../managers/ConnectionManager";
11
+import LogoutDialog from "../Amicale/LogoutDialog";
12 12
 
13 13
 const deviceWidth = Dimensions.get("window").width;
14 14
 
@@ -226,7 +226,7 @@ class SideBar extends React.PureComponent<Props, State> {
226 226
                     onPress={onPress}
227 227
                 >
228 228
                     <Image
229
-                        source={require("../assets/drawer-cover.png")}
229
+                        source={require("../../assets/drawer-cover.png")}
230 230
                         style={styles.drawerCover}
231 231
                     />
232 232
                 </TouchableRipple>

components/SidebarDivider.js → components/Sidebar/SidebarDivider.js View File


components/SidebarItem.js → components/Sidebar/SidebarItem.js View File


+ 2
- 2
navigation/DrawerNavigator.js View File

@@ -11,9 +11,9 @@ import AvailableRoomScreen from "../screens/Websites/AvailableRoomScreen";
11 11
 import BibScreen from "../screens/Websites/BibScreen";
12 12
 import TetrisScreen from "../screens/Tetris/TetrisScreen";
13 13
 import DebugScreen from '../screens/About/DebugScreen';
14
-import Sidebar from "../components/Sidebar";
14
+import Sidebar from "../components/Sidebar/Sidebar";
15 15
 import {createStackNavigator, TransitionPresets} from "@react-navigation/stack";
16
-import HeaderButton from "../components/HeaderButton";
16
+import HeaderButton from "../components/Custom/HeaderButton";
17 17
 import i18n from "i18n-js";
18 18
 import LoginScreen from "../screens/Amicale/LoginScreen";
19 19
 import ProfileScreen from "../screens/Amicale/ProfileScreen";

+ 1
- 1
navigation/MainTabNavigator.js View File

@@ -13,7 +13,7 @@ import ProximoAboutScreen from "../screens/Proximo/ProximoAboutScreen";
13 13
 import PlanexScreen from '../screens/Websites/PlanexScreen';
14 14
 import {MaterialCommunityIcons} from "@expo/vector-icons";
15 15
 import AsyncStorageManager from "../managers/AsyncStorageManager";
16
-import HeaderButton from "../components/HeaderButton";
16
+import HeaderButton from "../components/Custom/HeaderButton";
17 17
 import {withTheme} from 'react-native-paper';
18 18
 import i18n from "i18n-js";
19 19
 

+ 1
- 1
screens/About/AboutScreen.js View File

@@ -5,7 +5,7 @@ import {FlatList, Linking, Platform, View} from 'react-native';
5 5
 import i18n from "i18n-js";
6 6
 import appJson from '../../app';
7 7
 import AsyncStorageManager from "../../managers/AsyncStorageManager";
8
-import CustomModal from "../../components/CustomModal";
8
+import CustomModal from "../../components/Custom/CustomModal";
9 9
 import {Avatar, Button, Card, List, Text, Title, withTheme} from 'react-native-paper';
10 10
 
11 11
 const links = {

+ 1
- 1
screens/About/DebugScreen.js View File

@@ -3,7 +3,7 @@
3 3
 import * as React from 'react';
4 4
 import {ScrollView, View} from "react-native";
5 5
 import AsyncStorageManager from "../../managers/AsyncStorageManager";
6
-import CustomModal from "../../components/CustomModal";
6
+import CustomModal from "../../components/Custom/CustomModal";
7 7
 import {Button, Card, List, Subheading, TextInput, Title, withTheme} from 'react-native-paper';
8 8
 
9 9
 type Props = {

+ 1
- 1
screens/Amicale/LoginScreen.js View File

@@ -6,7 +6,7 @@ import {Avatar, Button, Card, HelperText, Text, TextInput, withTheme} from 'reac
6 6
 import ConnectionManager, {ERROR_TYPE} from "../../managers/ConnectionManager";
7 7
 import {openBrowser} from "../../utils/WebBrowser";
8 8
 import i18n from 'i18n-js';
9
-import AlertDialog from "../../components/AlertDialog";
9
+import AlertDialog from "../../components/Custom/AlertDialog";
10 10
 
11 11
 type Props = {
12 12
     navigation: Object,

+ 3
- 3
screens/Amicale/ProfileScreen.js View File

@@ -3,11 +3,11 @@
3 3
 import * as React from 'react';
4 4
 import {FlatList, StyleSheet, View} from "react-native";
5 5
 import {Avatar, Button, Card, Divider, List, withTheme} from 'react-native-paper';
6
-import AuthenticatedScreen from "../../components/AuthenticatedScreen";
6
+import AuthenticatedScreen from "../../components/Amicale/AuthenticatedScreen";
7 7
 import {openBrowser} from "../../utils/WebBrowser";
8
-import HeaderButton from "../../components/HeaderButton";
8
+import HeaderButton from "../../components/Custom/HeaderButton";
9 9
 import i18n from 'i18n-js';
10
-import LogoutDialog from "../../components/LogoutDialog";
10
+import LogoutDialog from "../../components/Amicale/LogoutDialog";
11 11
 
12 12
 type Props = {
13 13
     navigation: Object,

+ 5
- 5
screens/HomeScreen.js View File

@@ -3,12 +3,12 @@
3 3
 import * as React from 'react';
4 4
 import {View} from 'react-native';
5 5
 import i18n from "i18n-js";
6
-import DashboardItem from "../components/EventDashboardItem";
7
-import WebSectionList from "../components/WebSectionList";
6
+import DashboardItem from "../components/Home/EventDashboardItem";
7
+import WebSectionList from "../components/Lists/WebSectionList";
8 8
 import {Text, withTheme} from 'react-native-paper';
9
-import FeedItem from "../components/FeedItem";
10
-import SquareDashboardItem from "../components/SquareDashboardItem";
11
-import PreviewEventDashboardItem from "../components/PreviewEventDashboardItem";
9
+import FeedItem from "../components/Home/FeedItem";
10
+import SquareDashboardItem from "../components/Home/SquareDashboardItem";
11
+import PreviewEventDashboardItem from "../components/Home/PreviewEventDashboardItem";
12 12
 import {stringToDate} from "../utils/Planning";
13 13
 import {openBrowser} from "../utils/WebBrowser";
14 14
 // import DATA from "../dashboard_data.json";

+ 1
- 1
screens/Planning/PlanningScreen.js View File

@@ -13,7 +13,7 @@ import {
13 13
     getFormattedEventTime,
14 14
 } from '../../utils/Planning';
15 15
 import {Avatar, Divider, List} from 'react-native-paper';
16
-import CustomAgenda from "../../components/CustomAgenda";
16
+import CustomAgenda from "../../components/Custom/CustomAgenda";
17 17
 
18 18
 LocaleConfig.locales['fr'] = {
19 19
     monthNames: ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre'],

+ 2
- 2
screens/Proximo/ProximoListScreen.js View File

@@ -3,9 +3,9 @@
3 3
 import * as React from 'react';
4 4
 import {Image, Platform, ScrollView, View} from "react-native";
5 5
 import i18n from "i18n-js";
6
-import CustomModal from "../../components/CustomModal";
6
+import CustomModal from "../../components/Custom/CustomModal";
7 7
 import {Avatar, IconButton, List, RadioButton, Searchbar, Subheading, Text, Title, withTheme} from "react-native-paper";
8
-import PureFlatList from "../../components/PureFlatList";
8
+import PureFlatList from "../../components/Lists/PureFlatList";
9 9
 
10 10
 function sortPrice(a, b) {
11 11
     return a.price - b.price;

+ 2
- 2
screens/Proximo/ProximoMainScreen.js View File

@@ -3,9 +3,9 @@
3 3
 import * as React from 'react';
4 4
 import {View} from 'react-native'
5 5
 import i18n from "i18n-js";
6
-import WebSectionList from "../../components/WebSectionList";
6
+import WebSectionList from "../../components/Lists/WebSectionList";
7 7
 import {List, withTheme} from 'react-native-paper';
8
-import HeaderButton from "../../components/HeaderButton";
8
+import HeaderButton from "../../components/Custom/HeaderButton";
9 9
 
10 10
 const DATA_URL = "https://etud.insa-toulouse.fr/~proximo/data/stock-v2.json";
11 11
 

+ 4
- 4
screens/Proxiwash/ProxiwashScreen.js View File

@@ -3,15 +3,15 @@
3 3
 import * as React from 'react';
4 4
 import {Alert, Platform, View} from 'react-native';
5 5
 import i18n from "i18n-js";
6
-import WebSectionList from "../../components/WebSectionList";
6
+import WebSectionList from "../../components/Lists/WebSectionList";
7 7
 import * as Notifications from "../../utils/Notifications";
8 8
 import AsyncStorageManager from "../../managers/AsyncStorageManager";
9 9
 import * as Expo from "expo";
10 10
 import {Avatar, Banner, Button, Card, Text, withTheme} from 'react-native-paper';
11
-import HeaderButton from "../../components/HeaderButton";
12
-import ProxiwashListItem from "../../components/ProxiwashListItem";
11
+import HeaderButton from "../../components/Custom/HeaderButton";
12
+import ProxiwashListItem from "../../components/Lists/ProxiwashListItem";
13 13
 import ProxiwashConstants from "../../constants/ProxiwashConstants";
14
-import CustomModal from "../../components/CustomModal";
14
+import CustomModal from "../../components/Custom/CustomModal";
15 15
 import AprilFoolsManager from "../../managers/AprilFoolsManager";
16 16
 
17 17
 const DATA_URL = "https://etud.insa-toulouse.fr/~amicale_app/washinsa/washinsa.json";

+ 1
- 1
screens/SelfMenuScreen.js View File

@@ -3,7 +3,7 @@
3 3
 import * as React from 'react';
4 4
 import {View} from 'react-native';
5 5
 import DateManager from "../managers/DateManager";
6
-import WebSectionList from "../components/WebSectionList";
6
+import WebSectionList from "../components/Lists/WebSectionList";
7 7
 import {Card, Text, withTheme} from 'react-native-paper';
8 8
 import AprilFoolsManager from "../managers/AprilFoolsManager";
9 9
 

+ 1
- 1
screens/Tetris/TetrisScreen.js View File

@@ -6,7 +6,7 @@ import {IconButton, Text, withTheme} from 'react-native-paper';
6 6
 import {MaterialCommunityIcons} from "@expo/vector-icons";
7 7
 import GameLogic from "./GameLogic";
8 8
 import Grid from "./components/Grid";
9
-import HeaderButton from "../../components/HeaderButton";
9
+import HeaderButton from "../../components/Custom/HeaderButton";
10 10
 import Preview from "./components/Preview";
11 11
 import i18n from "i18n-js";
12 12
 

+ 1
- 1
screens/Websites/AvailableRoomScreen.js View File

@@ -1,7 +1,7 @@
1 1
 // @flow
2 2
 
3 3
 import * as React from 'react';
4
-import WebViewScreen from "../../components/WebViewScreen";
4
+import WebViewScreen from "../../components/Screens/WebViewScreen";
5 5
 import i18n from "i18n-js";
6 6
 
7 7
 type Props = {

+ 1
- 1
screens/Websites/BibScreen.js View File

@@ -1,7 +1,7 @@
1 1
 // @flow
2 2
 
3 3
 import * as React from 'react';
4
-import WebViewScreen from "../../components/WebViewScreen";
4
+import WebViewScreen from "../../components/Screens/WebViewScreen";
5 5
 import i18n from "i18n-js";
6 6
 
7 7
 type Props = {

+ 1
- 1
screens/Websites/PlanexScreen.js View File

@@ -2,7 +2,7 @@
2 2
 
3 3
 import * as React from 'react';
4 4
 import ThemeManager from "../../managers/ThemeManager";
5
-import WebViewScreen from "../../components/WebViewScreen";
5
+import WebViewScreen from "../../components/Screens/WebViewScreen";
6 6
 import {Avatar, Banner} from "react-native-paper";
7 7
 import i18n from "i18n-js";
8 8
 import {View} from "react-native";

Loading…
Cancel
Save