Added amicale section

This commit is contained in:
Arnaud Vergnet 2020-04-22 10:14:37 +02:00
parent 926515213d
commit 8eaa46b900
3 changed files with 97 additions and 54 deletions

View file

@ -26,7 +26,6 @@ export default class CardListItem extends React.Component<Props> {
style={{
width: props.width,
margin: 5,
elevation: 3,
}}
onPress={item.onPress}
>

View file

@ -36,7 +36,6 @@ import ClubListScreen from "../screens/Amicale/Clubs/ClubListScreen";
import ClubAboutScreen from "../screens/Amicale/Clubs/ClubAboutScreen";
import VoteScreen from "../screens/Amicale/VoteScreen";
import AmicaleContactScreen from "../screens/Amicale/AmicaleContactScreen";
import AmicaleHomeScreen from "../screens/Amicale/AmicaleHomeScreen";
import WebsitesHomeScreen from "../screens/Services/ServicesScreen";
import ServicesSectionScreen from "../screens/Services/ServicesSectionScreen";
@ -95,6 +94,12 @@ function ServicesStackComponent() {
{createScreenCollapsibleStack("index", ServicesStack, WebsitesHomeScreen, i18n.t('screens.services'))}
{createScreenCollapsibleStack("services-section", ServicesStack, ServicesSectionScreen, "SECTION")}
{/* INSA */}
{getWebsiteStack("available-rooms", ServicesStack, AvailableRoomScreen, i18n.t('screens.availableRooms'))}
{getWebsiteStack("bib", ServicesStack, BibScreen, i18n.t('screens.bib'))}
{createScreenCollapsibleStack("self-menu", ServicesStack, SelfMenuScreen, i18n.t('screens.menuSelf'))}
{/* STUDENTS */}
{createScreenCollapsibleStack("proximo", ServicesStack, ProximoMainScreen, "Proximo")}
{createScreenCollapsibleStack(
"proximo-list",
@ -112,17 +117,46 @@ function ServicesStackComponent() {
...modalTransition,
}}
/>
{getWebsiteStack("available-rooms", ServicesStack, AvailableRoomScreen, i18n.t('screens.availableRooms'))}
{getWebsiteStack("bib", ServicesStack, BibScreen, i18n.t('screens.bib'))}
{createScreenCollapsibleStack("self-menu", ServicesStack, SelfMenuScreen, i18n.t('screens.menuSelf'))}
{getWebsiteStack("amicale-website", ServicesStack, AmicaleWebsiteScreen, "Amicale")}
{getWebsiteStack("elus-etudiants", ServicesStack, ElusEtudiantsWebsiteScreen, "Élus Étudiants")}
{getWebsiteStack("wiketud", ServicesStack, WiketudWebsiteScreen, "Wiketud")}
{getWebsiteStack("tutorinsa", ServicesStack, TutorInsaWebsiteScreen, "Tutor'INSA")}
{getWebsiteStack("ent", ServicesStack, ENTWebsiteScreen, "ENT INSA")}
{getWebsiteStack("bluemind", ServicesStack, BlueMindWebsiteScreen, "BlueMind")}
{/* AMICALE */}
<ServicesStack.Screen
name="login"
component={LoginScreen}
options={{
title: i18n.t('screens.login'),
}}
/>
{createScreenCollapsibleStack("profile", ServicesStack, ProfileScreen, i18n.t('screens.profile'))}
{createScreenCollapsibleStack("club-list", ServicesStack, ClubListScreen, i18n.t('clubs.clubList'))}
<ServicesStack.Screen
name="club-about"
component={ClubAboutScreen}
options={{
title: i18n.t('screens.clubsAbout'),
...modalTransition,
}}
/>
<ServicesStack.Screen
name="vote"
component={VoteScreen}
options={{
title: i18n.t('screens.vote'),
}}
/>
<ServicesStack.Screen
name="amicale-contact"
component={AmicaleContactScreen}
options={{
title: i18n.t('screens.amicaleAbout'),
}}
/>
</ServicesStack.Navigator>
);
}
@ -248,37 +282,6 @@ function HomeStackComponent(initialRoute: string | null, defaultData: { [key: st
title: i18n.t('screens.login'),
}}
/>
{createScreenCollapsibleStack("profile", HomeStack, ProfileScreen, i18n.t('screens.profile'))}
{createScreenCollapsibleStack("club-list", HomeStack, ClubListScreen, i18n.t('clubs.clubList'))}
<HomeStack.Screen
name="club-about"
component={ClubAboutScreen}
options={{
title: i18n.t('screens.clubsAbout'),
...modalTransition,
}}
/>
<HomeStack.Screen
name="vote"
component={VoteScreen}
options={{
title: i18n.t('screens.vote'),
}}
/>
<HomeStack.Screen
name="amicale-contact"
component={AmicaleContactScreen}
options={{
title: i18n.t('screens.amicaleAbout'),
}}
/>
<HomeStack.Screen
name="amicale-home"
component={AmicaleHomeScreen}
options={{
title: "AMICALE HOME",
}}
/>
</HomeStack.Navigator>
);
}

View file

@ -7,8 +7,8 @@ import CustomTabBar from "../../components/Tabbar/CustomTabBar";
import {withCollapsible} from "../../utils/withCollapsible";
import {Collapsible} from "react-navigation-collapsible";
import {CommonActions} from "@react-navigation/native";
import {Animated} from "react-native";
import {Avatar, Card, List} from "react-native-paper";
import {Animated, View} from "react-native";
import {Avatar, Card, List, TouchableRipple} from "react-native-paper";
type Props = {
navigation: Object,
@ -36,6 +36,7 @@ type listItem = {
class ServicesScreen extends React.Component<Props> {
amicaleDataset: cardList;
studentsDataset: cardList;
insaDataset: cardList;
@ -44,6 +45,38 @@ class ServicesScreen extends React.Component<Props> {
constructor(props) {
super(props);
const nav = props.navigation;
this.amicaleDataset = [
{
title: "AMICALE",
subtitle: "AMICALE",
image: AMICALE_IMAGE,
onPress: () => nav.navigate("amicale-website"),
},
{
title: "CLUBS",
subtitle: "CLUB LIST",
image: AMICALE_IMAGE,
onPress: () => nav.navigate("club-list"),
},
{
title: "PROFIL",
subtitle: "PROFIL",
image: AMICALE_IMAGE,
onPress: () => nav.navigate("profile"),
},
{
title: "CONTACT",
subtitle: "CONTACT",
image: AMICALE_IMAGE,
onPress: () => nav.navigate("amicale-contact"),
},
{
title: "ELECTIONS",
subtitle: "ELECTIONS",
image: AMICALE_IMAGE,
onPress: () => nav.navigate("vote"),
},
];
this.studentsDataset = [
{
title: "proximo",
@ -111,13 +144,19 @@ class ServicesScreen extends React.Component<Props> {
this.finalDataset = [
{
title: "AMICALE",
description: "youhou",
description: "LOGIN",
image: AMICALE_IMAGE,
content: this.amicaleDataset
},
{
title: "STUDENTS",
description: "SERVICES OFFERED BY STUDENTS",
image: AMICALE_IMAGE,
content: this.studentsDataset
},
{
title: "INSA",
description: "youhou",
description: "SERVICES OFFERED BY INSA",
image: AMICALE_IMAGE,
content: this.insaDataset
},
@ -151,23 +190,25 @@ class ServicesScreen extends React.Component<Props> {
renderItem = ({item}: { item: listItem }) => {
return (
<Card
<TouchableRipple
style={{
margin: 5,
}}
onPress={() => this.props.navigation.navigate("services-section", {data: item})}
>
<Card.Title
title={item.title}
subtitle={item.description}
left={(props) => this.getAvatar(props, item.image)}
right={(props) => <List.Icon {...props} icon="chevron-right"/>}
/>
<CardList
dataset={item.content}
isHorizontal={true}
/>
</Card>
<View>
<Card.Title
title={item.title}
subtitle={item.description}
left={(props) => this.getAvatar(props, item.image)}
right={(props) => <List.Icon {...props} icon="chevron-right"/>}
/>
<CardList
dataset={item.content}
isHorizontal={true}
/>
</View>
</TouchableRipple>
);
};