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