Compare commits
No commits in common. "32c77fab055c51e3382d947581dc9b042abb5db7" and "aaf7084297142b34eda14b240f2806f822d90866" have entirely different histories.
32c77fab05
...
aaf7084297
7 changed files with 41 additions and 41 deletions
|
|
@ -26,7 +26,7 @@ class ClubListHeader extends React.Component<Props> {
|
||||||
selected={isItemInCategoryFilter(this.props.selectedCategories, [category.id])}
|
selected={isItemInCategoryFilter(this.props.selectedCategories, [category.id])}
|
||||||
mode={'outlined'}
|
mode={'outlined'}
|
||||||
onPress={onPress}
|
onPress={onPress}
|
||||||
style={{marginRight: 5, marginLeft: 5, marginBottom: 5}}
|
style={{marginRight: 5, marginBottom: 5}}
|
||||||
key={key}
|
key={key}
|
||||||
>
|
>
|
||||||
{category.name}
|
{category.name}
|
||||||
|
|
|
||||||
|
|
@ -55,11 +55,7 @@ class ClubListItem extends React.Component<Props> {
|
||||||
onPress={this.props.onPress}
|
onPress={this.props.onPress}
|
||||||
left={(props) => <Avatar.Image
|
left={(props) => <Avatar.Image
|
||||||
{...props}
|
{...props}
|
||||||
style={{
|
style={{backgroundColor: 'transparent'}}
|
||||||
backgroundColor: 'transparent',
|
|
||||||
marginLeft: 10,
|
|
||||||
marginRight: 10,
|
|
||||||
}}
|
|
||||||
size={64}
|
size={64}
|
||||||
source={{uri: this.props.item.logo}}/>}
|
source={{uri: this.props.item.logo}}/>}
|
||||||
right={(props) => <Avatar.Icon
|
right={(props) => <Avatar.Icon
|
||||||
|
|
|
||||||
|
|
@ -21,25 +21,15 @@ class CustomHTML extends React.Component<Props> {
|
||||||
return <Text {...passProps}>{children}</Text>;
|
return <Text {...passProps}>{children}</Text>;
|
||||||
};
|
};
|
||||||
|
|
||||||
getListBullet = (htmlAttribs, children, convertedCSSStyles, passProps) => {
|
|
||||||
return (
|
|
||||||
<Text>- </Text>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
// Surround description with p to allow text styling if the description is not html
|
// Surround description with p to allow text styling if the description is not html
|
||||||
return <HTML
|
return <HTML
|
||||||
html={"<p>" + this.props.html + "</p>"}
|
html={"<p>" + this.props.html + "</p>"}
|
||||||
renderers={{
|
renderers={{
|
||||||
p: this.getBasicText,
|
p: this.getBasicText,
|
||||||
li: this.getBasicText,
|
|
||||||
}}
|
}}
|
||||||
listsPrefixesRenderers={{
|
|
||||||
ul: this.getListBullet
|
|
||||||
}}
|
|
||||||
ignoredTags={['img']}
|
|
||||||
ignoredStyles={['color', 'background-color']}
|
ignoredStyles={['color', 'background-color']}
|
||||||
|
|
||||||
onLinkPress={this.openWebLink}/>;
|
onLinkPress={this.openWebLink}/>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,6 @@ const links = {
|
||||||
"Coucou !\n\n",
|
"Coucou !\n\n",
|
||||||
yohanLinkedin: 'https://www.linkedin.com/in/yohan-simard',
|
yohanLinkedin: 'https://www.linkedin.com/in/yohan-simard',
|
||||||
react: 'https://facebook.github.io/react-native/',
|
react: 'https://facebook.github.io/react-native/',
|
||||||
meme: "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
|
|
||||||
};
|
};
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
|
|
@ -85,7 +84,7 @@ class AboutScreen extends React.Component<Props> {
|
||||||
*/
|
*/
|
||||||
authorData: Array<Object> = [
|
authorData: Array<Object> = [
|
||||||
{
|
{
|
||||||
onPressCallback: () => openWebLink(links.meme),
|
onPressCallback: () => console.log('cc'),
|
||||||
icon: 'account-circle',
|
icon: 'account-circle',
|
||||||
text: 'Arnaud VERGNET',
|
text: 'Arnaud VERGNET',
|
||||||
showChevron: false
|
showChevron: false
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ import {Avatar, Card, Divider, List, TouchableRipple, withTheme} from "react-nat
|
||||||
import type {CustomTheme} from "../../managers/ThemeManager";
|
import type {CustomTheme} from "../../managers/ThemeManager";
|
||||||
import i18n from 'i18n-js';
|
import i18n from 'i18n-js';
|
||||||
import MaterialHeaderButtons, {Item} from "../../components/Overrides/CustomHeaderButton";
|
import MaterialHeaderButtons, {Item} from "../../components/Overrides/CustomHeaderButton";
|
||||||
import ConnectionManager from "../../managers/ConnectionManager";
|
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
navigation: Object,
|
navigation: Object,
|
||||||
|
|
@ -62,13 +61,13 @@ class ServicesScreen extends React.Component<Props, State> {
|
||||||
title: i18n.t('screens.clubsAbout'),
|
title: i18n.t('screens.clubsAbout'),
|
||||||
subtitle: i18n.t('servicesScreen.descriptions.clubs'),
|
subtitle: i18n.t('servicesScreen.descriptions.clubs'),
|
||||||
image: CLUBS_IMAGE,
|
image: CLUBS_IMAGE,
|
||||||
onPress: () => this.onAmicaleServicePress("club-list"),
|
onPress: () => nav.navigate("club-list"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: i18n.t('screens.profile'),
|
title: i18n.t('screens.profile'),
|
||||||
subtitle: i18n.t('servicesScreen.descriptions.profile'),
|
subtitle: i18n.t('servicesScreen.descriptions.profile'),
|
||||||
image: PROFILE_IMAGE,
|
image: PROFILE_IMAGE,
|
||||||
onPress: () => this.onAmicaleServicePress("profile"),
|
onPress: () => nav.navigate("profile"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: i18n.t('screens.amicaleWebsite'),
|
title: i18n.t('screens.amicaleWebsite'),
|
||||||
|
|
@ -80,7 +79,7 @@ class ServicesScreen extends React.Component<Props, State> {
|
||||||
title: i18n.t('screens.vote'),
|
title: i18n.t('screens.vote'),
|
||||||
subtitle: i18n.t('servicesScreen.descriptions.vote'),
|
subtitle: i18n.t('servicesScreen.descriptions.vote'),
|
||||||
image: VOTE_IMAGE,
|
image: VOTE_IMAGE,
|
||||||
onPress: () => this.onAmicaleServicePress("vote"),
|
onPress: () => nav.navigate("vote"),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
this.studentsDataset = [
|
this.studentsDataset = [
|
||||||
|
|
@ -197,13 +196,6 @@ class ServicesScreen extends React.Component<Props, State> {
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
|
||||||
onAmicaleServicePress(route: string) {
|
|
||||||
if (ConnectionManager.getInstance().isLoggedIn())
|
|
||||||
this.props.navigation.navigate(route);
|
|
||||||
else
|
|
||||||
this.props.navigation.navigate("login", {nextScreen: route});
|
|
||||||
}
|
|
||||||
|
|
||||||
renderItem = ({item}: { item: listItem }) => {
|
renderItem = ({item}: { item: listItem }) => {
|
||||||
return (
|
return (
|
||||||
<TouchableRipple
|
<TouchableRipple
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,10 @@ import CustomTabBar from "../../components/Tabbar/CustomTabBar";
|
||||||
import {withCollapsible} from "../../utils/withCollapsible";
|
import {withCollapsible} from "../../utils/withCollapsible";
|
||||||
import {Collapsible} from "react-navigation-collapsible";
|
import {Collapsible} from "react-navigation-collapsible";
|
||||||
import {CommonActions} from "@react-navigation/native";
|
import {CommonActions} from "@react-navigation/native";
|
||||||
|
import ConnectionManager from "../../managers/ConnectionManager";
|
||||||
import type {listItem} from "./ServicesScreen";
|
import type {listItem} from "./ServicesScreen";
|
||||||
|
import ErrorView from "../../components/Screens/ErrorView";
|
||||||
|
import {ERROR_TYPE} from "../../utils/WebData";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
navigation: Object,
|
navigation: Object,
|
||||||
|
|
@ -14,13 +17,29 @@ type Props = {
|
||||||
collapsibleStack: Collapsible,
|
collapsibleStack: Collapsible,
|
||||||
}
|
}
|
||||||
|
|
||||||
class ServicesSectionScreen extends React.Component<Props> {
|
type State = {
|
||||||
|
isLoggedIn: boolean,
|
||||||
|
}
|
||||||
|
|
||||||
|
class ServicesSectionScreen extends React.Component<Props, State> {
|
||||||
|
|
||||||
finalDataset: listItem;
|
finalDataset: listItem;
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.handleNavigationParams();
|
this.handleNavigationParams();
|
||||||
|
this.state = {
|
||||||
|
isLoggedIn: ConnectionManager.getInstance().isLoggedIn(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
this.props.navigation.addListener('focus', this.onFocus);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
onFocus = () => {
|
||||||
|
this.setState({isLoggedIn: ConnectionManager.getInstance().isLoggedIn()})
|
||||||
}
|
}
|
||||||
|
|
||||||
handleNavigationParams() {
|
handleNavigationParams() {
|
||||||
|
|
@ -38,16 +57,19 @@ class ServicesSectionScreen extends React.Component<Props> {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {containerPaddingTop, scrollIndicatorInsetTop, onScroll} = this.props.collapsibleStack;
|
const {containerPaddingTop, scrollIndicatorInsetTop, onScroll} = this.props.collapsibleStack;
|
||||||
return <CardList
|
if (!this.state.isLoggedIn && this.finalDataset.shouldLogin)
|
||||||
dataset={this.finalDataset.content}
|
return <ErrorView {...this.props} errorCode={ERROR_TYPE.BAD_TOKEN}/>;
|
||||||
isHorizontal={false}
|
else
|
||||||
onScroll={onScroll}
|
return <CardList
|
||||||
contentContainerStyle={{
|
dataset={this.finalDataset.content}
|
||||||
paddingTop: containerPaddingTop,
|
isHorizontal={false}
|
||||||
paddingBottom: CustomTabBar.TAB_BAR_HEIGHT + 20
|
onScroll={onScroll}
|
||||||
}}
|
contentContainerStyle={{
|
||||||
scrollIndicatorInsets={{top: scrollIndicatorInsetTop}}
|
paddingTop: containerPaddingTop,
|
||||||
/>
|
paddingBottom: CustomTabBar.TAB_BAR_HEIGHT + 20
|
||||||
|
}}
|
||||||
|
scrollIndicatorInsets={{top: scrollIndicatorInsetTop}}
|
||||||
|
/>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ export const AmicaleWebsiteScreen = (props: Object) => {
|
||||||
path = path.replace(URL, '');
|
path = path.replace(URL, '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
console.log(URL + path);
|
||||||
return (
|
return (
|
||||||
<WebViewScreen
|
<WebViewScreen
|
||||||
{...props}
|
{...props}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue