Skip to content

Commit

Permalink
Merge pull request #421 from hummingbird-me/develop
Browse files Browse the repository at this point in the history
Develop to Master
  • Loading branch information
trmcnvn committed Dec 10, 2018
2 parents 54c8a54 + 6b671b0 commit 934a2db
Show file tree
Hide file tree
Showing 14 changed files with 104 additions and 30 deletions.
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ android {
targetSdkVersion 27
missingDimensionStrategy "RNN.reactNativeVersion", "reactNative51"
versionCode 1
versionName "6.10"
versionName "6.10.1"
multiDexEnabled true
ndk {
abiFilters "armeabi-v7a", "x86"
Expand Down
2 changes: 1 addition & 1 deletion ios/kitsu_mobile/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>6.10</string>
<string>6.10.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kitsu_mobile",
"version": "6.10",
"version": "6.10.1",
"private": true,
"scripts": {
"debug": "REACT_DEBUGGER=\"rndebugger-open --open --port 8081\" yarn start",
Expand Down Expand Up @@ -46,7 +46,7 @@
"react-native-sentry": "^0.37.1",
"react-native-snap-carousel": "^3.7.2",
"react-native-swipeable": "^0.6.0",
"react-native-vector-icons": "^4.6.0",
"react-native-vector-icons": "^6.1.0",
"react-native-wkwebview-reborn": "^1.21.0",
"react-native-youtube": "^1.1.0",
"react-redux": "^5.0.7",
Expand All @@ -57,6 +57,7 @@
"url-parse": "^1.2.0"
},
"devDependencies": {
"@babel/runtime": "^7.2.0",
"babel-eslint": "^7.2.3",
"babel-jest": "20.0.3",
"babel-plugin-module-alias": "^1.6.0",
Expand Down
4 changes: 2 additions & 2 deletions src/components/ImageLightbox/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export class ImageLightbox extends PureComponent {
>
<Icon
style={[styles.icon, styles.openIcon]}
name={Platform.select({ ios: 'ios-open-outline', android: 'md-open' })}
name={Platform.select({ ios: 'ios-open', android: 'md-open' })}
/>
</TouchableOpacity>
}
Expand All @@ -94,7 +94,7 @@ export class ImageLightbox extends PureComponent {
>
<Icon
style={styles.icon}
name={Platform.select({ ios: 'ios-share-outline', android: 'md-share' })}
name={Platform.select({ ios: 'ios-share-alt', android: 'md-share' })}
/>
</TouchableOpacity>

Expand Down
2 changes: 1 addition & 1 deletion src/config/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const kitsuConfig = {
assetsUrl: `${kitsuUrl}/images`,
baseUrl: apiUrl,
uploadUrl: `${apiUrl}/edge/uploads/_bulk`,
version: '6.10',
version: '6.10.1',
stream: {
API_KEY: 'eb6dvmba4ct3',
API_SECRET:
Expand Down
2 changes: 1 addition & 1 deletion src/screens/Feed/components/Comment/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ export class Comment extends PureComponent {
<StyledText color="grey" size="xxsmall">Reply</StyledText>
</TouchableOpacity>
<View style={styles.commentActionItem}>
<Icon name={isLiked ? 'md-heart' : 'md-heart-outline'} style={[styles.likeIcon, isLiked && styles.likeIcon__active]} />
<Icon name={isLiked ? 'md-heart' : 'md-heart-empty'} style={[styles.likeIcon, isLiked && styles.likeIcon__active]} />
<StyledText color={isLiked ? 'red' : 'grey'} size="xxsmall">{likesCount}</StyledText>
</View>
</View>
Expand Down
1 change: 1 addition & 0 deletions src/screens/Feed/feedStreams.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const feedStreams = [
description: 'Shared with everyone',
selectable: false,
targetInterest: null,

},
// Disabled anime and manga feeds
// {
Expand Down
58 changes: 44 additions & 14 deletions src/screens/Feed/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { StatusBar, View, StyleSheet, Platform } from 'react-native';
import { StatusBar, View, StyleSheet, Platform, Dimensions, Linking } from 'react-native';
import { connect } from 'react-redux';
import { KeyboardAwareFlatList } from 'react-native-keyboard-aware-scroll-view';
import { AdMobBanner } from 'react-native-admob';
Expand All @@ -22,6 +22,9 @@ import { statusBarHeight } from 'kitsu/constants/app';
import { registerDeepLinks, unregisterDeepLinks } from 'kitsu/utils/deeplink';
import { feedStreams } from './feedStreams';
import { isAoProOrKitsuPro } from 'kitsu/utils/user';
import { StyledText } from 'kitsu/components/StyledText';
import { Button } from 'kitsu/components/Button';
import { dismissBanner } from 'kitsu/store/app/actions';;

const styles = StyleSheet.create({
container: {
Expand All @@ -33,6 +36,12 @@ const styles = StyleSheet.create({
flex: 1,
backgroundColor: listBackPurple,
},
banner: {
backgroundColor: listBackPurple,
width: Dimensions.get('window').width,
padding: 10,
paddingBottom: 20,
}
});

class Feed extends React.PureComponent {
Expand Down Expand Up @@ -213,6 +222,17 @@ class Feed extends React.PureComponent {
});
};

openSurvey = () => {
Linking.openURL("https://kitsu.typeform.com/to/tqNQN4");
this.closeSurvey();
};

closeSurvey = () => {
if (this.props.dismissBanner) {
this.props.dismissBanner();
}
};

keyExtractor = (item, index) => {
return `${item.id}-${item.updatedAt}`;
}
Expand All @@ -233,16 +253,16 @@ class Feed extends React.PureComponent {
{/* Render a AdMobBanner every 3 posts */}
{!isAoProOrKitsuPro(this.props.currentUser) &&
((index + 1) % 3 === 0) && (
<React.Fragment>
<View style={{ marginTop: 10 }} />
<AdMobBanner
adUnitID={ADMOB_AD_UNITS[Platform.OS]}
adSize="smartBannerPortrait"
testDevices={[AdMobBanner.simulatorId]}
onAdFailedToLoad={error => console.log(error)}
/>
</React.Fragment>
)}
<React.Fragment>
<View style={{ marginTop: 10 }} />
<AdMobBanner
adUnitID={ADMOB_AD_UNITS[Platform.OS]}
adSize="smartBannerPortrait"
testDevices={[AdMobBanner.simulatorId]}
onAdFailedToLoad={error => console.log(error)}
/>
</React.Fragment>
)}
</React.Fragment>
);
default:
Expand Down Expand Up @@ -296,14 +316,24 @@ class Feed extends React.PureComponent {
removeClippedSubviews={Platform.OS === 'android'}
/>
</View>

{!this.props.bannerDismissed && (
<View style={styles.banner}>
<StyledText bold size="large" textStyle={{ textAlign: 'center' }}>Give us your feedback</StyledText>
<StyledText size="small" color="lightGrey" textStyle={{ textAlign: 'center' }}>Most users complete this survey in a few minutes.</StyledText>
<Button title="Okay, let's start" style={{ marginVertical: 15 }} onPress={this.openSurvey} />
<StyledText size="small" color="red" textStyle={{ textAlign: 'center' }} onPress={this.closeSurvey}>CLOSE</StyledText>
</View>
)}
</View>
);
}
}

const mapStateToProps = ({ user }) => {
const mapStateToProps = ({ app, user }) => {
const { currentUser } = user;
return { currentUser };
const { bannerDismissed } = app;
return { currentUser, bannerDismissed };
};

export default connect(mapStateToProps)(Feed);
export default connect(mapStateToProps, { dismissBanner })(Feed);
4 changes: 2 additions & 2 deletions src/screens/Profiles/MediaPages/pages/Episodes/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ class Episodes extends PureComponent {
>
<StyledText color="black" size="small" bold textStyle={styles.itemNumber}>{paddedString}</StyledText>
<StyledText color="black" size="small" textStyle={styles.itemTitle} numberOfLines={1}>{title}</StyledText>
{ !isEmpty(item.videos) &&
<Icon name="ios-desktop-outline" style={styles.watchIcon} size={18} />
{!isEmpty(item.videos) &&
<Icon name="ios-desktop" style={styles.watchIcon} size={18} />
}
</TouchableOpacity>
<TouchableOpacity
Expand Down
18 changes: 18 additions & 0 deletions src/screens/Sidebar/SidebarScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ class SidebarScreen extends PureComponent {
case 'mailto':
Linking.openURL('mailto:help@kitsu.io');
break;
case 'survey':
Linking.openURL('https://kitsu.typeform.com/to/tqNQN4');
break;
default:
break;
}
Expand All @@ -87,6 +90,15 @@ class SidebarScreen extends PureComponent {
};
}

get kitsuSections() {
return {
title: 'Kitsu',
data: [
{ title: 'Community Survey', image: contact, target: 'survey' },
],
};
}

navigateTo = (screen, props = {}) => {
Navigation.mergeOptions(Screens.SIDEBAR, {
sideMenu: {
Expand Down Expand Up @@ -166,6 +178,12 @@ class SidebarScreen extends PureComponent {
this.renderSectionItem(item)
))}

{/* Kitsu Settings */}
{this.renderSectionHeader(this.kitsuSections)}
{this.kitsuSections.data.map(item => (
this.renderSectionItem(item)
))}

{/* Logout */}
<Button
style={styles.logoutButton}
Expand Down
4 changes: 4 additions & 0 deletions src/store/app/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,7 @@ export const setInitialPage = value => (dispatch) => {
export const toggleActivityIndicatorHOC = visible => (dispatch) => {
dispatch({ type: types.ACTIVITY_INDICATOR_HOC, payload: visible });
};

export const dismissBanner = () => (dispatch) => {
dispatch({ type: types.DISMISS_BANNER });
}
6 changes: 6 additions & 0 deletions src/store/app/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const initialState = {
pushNotificationEnabled: false,
initialPage: 'Feed',
activityIndicatorHOCVisible: false,
bannerDismissed: false,
};

export const appReducer = (state = initialState, action) => {
Expand Down Expand Up @@ -39,6 +40,11 @@ export const appReducer = (state = initialState, action) => {
...state,
activityIndicatorHOCVisible: !!action.payload,
};
case types.DISMISS_BANNER:
return {
...state,
bannerDismissed: true
};
case REHYDRATE: {
const payload = action && action.payload;
const app = (payload && payload.app) || {};
Expand Down
2 changes: 2 additions & 0 deletions src/store/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,5 @@ export const SETTING_DATA_SAVER = 'SETTING_DATA_SAVER';
export const SETTING_INITIAL_PAGE = 'SETTING_INITIAL_PAGE';

export const ACTIVITY_INDICATOR_HOC = 'ACTIVITY_INDICATOR_HOC';

export const DISMISS_BANNER = 'DISMISS_BANNER';
24 changes: 18 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
# yarn lockfile v1


"@babel/runtime@^7.2.0":
version "7.2.0"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.2.0.tgz#b03e42eeddf5898e00646e4c840fa07ba8dcad7f"
integrity sha512-oouEibCbHMVdZSDlJBO6bZmID/zA/G/Qx3H1d3rSNPTD+L8UNKvCat7aKWSJ74zYbm5zWGh0GQN0hKj8zYFTCg==
dependencies:
regenerator-runtime "^0.12.0"

"@monterosa/react-native-parallax-scroll@^1.5.4":
version "1.5.4"
resolved "https://registry.yarnpkg.com/@monterosa/react-native-parallax-scroll/-/react-native-parallax-scroll-1.5.4.tgz#d0b40489e86751b1aa1a3bfa7f24687c7235c5d3"
Expand Down Expand Up @@ -5569,7 +5576,7 @@ prop-types@15.5.8:
dependencies:
fbjs "^0.8.9"

prop-types@15.x.x:
prop-types@15.x.x, prop-types@^15.6.2:
version "15.6.2"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.2.tgz#05d5ca77b4453e985d60fc7ff8c859094a497102"
integrity sha512-3pboPvLiWD7dkI3qf3KbUe6hKFKa52w+AE0VCqECtf+QHAKgOL37tTaNCnuX1nAAQ4ZhyP+kYVKf8rLmJ/feDQ==
Expand Down Expand Up @@ -5974,13 +5981,13 @@ react-native-swipeable@^0.6.0:
dependencies:
prop-types "^15.5.10"

react-native-vector-icons@^4.6.0:
version "4.6.0"
resolved "https://registry.yarnpkg.com/react-native-vector-icons/-/react-native-vector-icons-4.6.0.tgz#e4014311ffa6de397d914ffc31b7097a874cc8d5"
integrity sha512-rpfhfPiXCK2PX1nrNhdxSMrEGB/Gw/SvKoPM0G2wAkSoqynnes19K0VYI+Up7DqR1rFIpE4hP2erpT1tNx2tfg==
react-native-vector-icons@^6.1.0:
version "6.1.0"
resolved "https://registry.yarnpkg.com/react-native-vector-icons/-/react-native-vector-icons-6.1.0.tgz#770a3f8ced692d75deb3afbb9829195ceed1eedd"
integrity sha512-1GF5I4VWgwnzBtVfAKNgEiR5ziHi5QaKL381wwApMzuiFgIJMNt5XIChuKwKoaiB86s+P5iMcYWxYCyENL96lA==
dependencies:
lodash "^4.0.0"
prop-types "^15.5.10"
prop-types "^15.6.2"
yargs "^8.0.2"

react-native-wkwebview-reborn@^1.21.0:
Expand Down Expand Up @@ -6268,6 +6275,11 @@ regenerator-runtime@^0.11.0:
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9"
integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==

regenerator-runtime@^0.12.0:
version "0.12.1"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz#fa1a71544764c036f8c49b13a08b2594c9f8a0de"
integrity sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg==

regenerator-transform@^0.10.0:
version "0.10.1"
resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.10.1.tgz#1e4996837231da8b7f3cf4114d71b5691a0680dd"
Expand Down

0 comments on commit 934a2db

Please sign in to comment.