Skip to content

Commit

Permalink
Merge pull request #49 from just4fun/v1.7.1-latest
Browse files Browse the repository at this point in the history
v1.7.1 (new)
  • Loading branch information
just4fun authored Dec 7, 2018
2 parents 6fb452e + 2664223 commit a29ddcf
Show file tree
Hide file tree
Showing 32 changed files with 286 additions and 175 deletions.
34 changes: 24 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,30 @@
[<img width="200" alt="new_logo" src="https://user-images.githubusercontent.com/7512625/34460783-aaf95076-ee53-11e7-8699-3e94b6a0c270.png">](https://user-images.githubusercontent.com/7512625/34460783-aaf95076-ee53-11e7-8699-3e94b6a0c270.png)

[![React Native](https://img.shields.io/badge/react--native-v0.51.0-05A5D1.svg)](https://facebook.github.io/react-native)
[![GitHub issues](https://img.shields.io/github/issues/just4fun/stuhome.svg)](https://github.com/just4fun/stuhome/issues)
[![MIT](https://img.shields.io/dub/l/vibe-d.svg)](http://opensource.org/licenses/MIT)

An officially recommended 3rd party iOS client for http://bbs.uestc.edu.cn/ written in [react-native](https://facebook.github.io/react-native/), [redux](http://redux.js.org/) and [redux-observable](https://redux-observable.js.org/).
<p align="center">
<img width="200" alt="new_logo" src="https://user-images.githubusercontent.com/7512625/34460783-aaf95076-ee53-11e7-8699-3e94b6a0c270.png">
<p align="center">
<img alt="alu" src="https://user-images.githubusercontent.com/7512625/49665467-eb50ab80-fa8f-11e8-871c-5928dc2c3cb8.gif" />
<img alt="alu" src="https://user-images.githubusercontent.com/7512625/49665467-eb50ab80-fa8f-11e8-871c-5928dc2c3cb8.gif" />
<img alt="alu" src="https://user-images.githubusercontent.com/7512625/49665467-eb50ab80-fa8f-11e8-871c-5928dc2c3cb8.gif" />
</p>
<p align="center">
<a href="https://facebook.github.io/react-native">
<img alt="React Native" src="https://img.shields.io/badge/react--native-v0.51.0-05A5D1.svg" />
</a>
<a href="https://github.com/just4fun/stuhome/issues">
<img alt="GitHub issues" src="https://img.shields.io/github/issues/just4fun/stuhome.svg" />
</a>
<a href="http://opensource.org/licenses/MIT">
<img alt="MIT" src="https://img.shields.io/dub/l/vibe-d.svg" />
</a>
</p>
</p>

## What

An iOS client for http://bbs.uestc.edu.cn/ written in [react-native](https://facebook.github.io/react-native/), [redux](http://redux.js.org/) and [redux-observable](https://redux-observable.js.org/), which has been [recommended officially](http://bbs.uestc.edu.cn/forum.php?mod=viewthread&tid=1554255) as one of the best 3rd party iOS clients.

APIs are provided by [appbyme/mobcent-discuz](https://github.com/appbyme/mobcent-discuz) and partly documented by [UESTC-BBS/API-Docs](https://github.com/UESTC-BBS/API-Docs/wiki/Mobcent-API).

For all officially recommended clients, please visit http://bbs.uestc.edu.cn/forum.php?mod=viewthread&tid=1554255.

## Status (v1.7.0)
## Status (v1.7.1)

[<img width="250" alt="download_on_the_app_store" src="https://user-images.githubusercontent.com/7512625/27969868-353f554c-637f-11e7-869d-3963933461ca.png">](https://itunes.apple.com/cn/app/qing-shui-he-pan-stuhome/id1190564355)

Expand Down
2 changes: 1 addition & 1 deletion ios/stuhome/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.7.0</string>
<string>1.7.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stuhome",
"version": "1.7.0",
"version": "1.7.1",
"description": "An officially recommended 3rd party iOS client for http://bbs.uestc.edu.cn/ written in react-native, redux and redux-observable.",
"author": "just4fun <houritsunohikari@gmail.com>",
"scripts": {
Expand All @@ -20,7 +20,7 @@
"apsl-react-native-button": "3.1.0",
"lodash": "4.17.4",
"md5": "2.1.0",
"moment": "2.19.3",
"moment": "^2.19.0",
"react": "16.0.0",
"react-native": "0.51.0",
"react-native-checkbox": "2.0.0",
Expand All @@ -36,7 +36,7 @@
"react-native-smart-timer-enhance": "1.0.3",
"react-native-sticky-keyboard-accessory": "0.1.1",
"react-native-vector-icons": "4.4.3",
"react-navigation": "1.0.3",
"react-navigation": "2.18.3",
"react-redux": "5.0.6",
"redux": "3.3.1",
"redux-actions": "1.2.1",
Expand Down
7 changes: 6 additions & 1 deletion src/common/vendor/components/GiftedChatMessageText.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@ export default class MessageText extends React.Component {
]}
childrenProps={{...this.props.textProps}}
>
{parseContentWithEmoji(this.props.currentMessage.text)}
{
// In private message, no need to custom the size for emoji,
// since the font size setting is only used for topic content.
// So `0` for 2nd parameter here.
}
{parseContentWithEmoji(this.props.currentMessage.text, 0)}
</ParsedText>
</View>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/Avatar/Avatar.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default Avatar = (props) => {
// 3. Same user (in individual page)
if (!currentUserId || !userId || +userId === +currentUserId) { return; }

navigation.navigate('Individual', {
navigation.push('Individual', {
userId,
userName,
currentUserId
Expand Down
4 changes: 2 additions & 2 deletions src/components/Comment/Comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default class Comment extends Component {
(buttonIndex) => {
switch (buttonIndex) {
case 0:
navigation.navigate('ReplyModal', {
navigation.push('ReplyModal', {
// `comment` here is item from `forum/postlist`, which has
// no `topicId` and `boardId`, but necessary for topic reply
// API.
Expand All @@ -80,7 +80,7 @@ export default class Comment extends Component {
break;
case 2:
if (canSendPrivateMessage) {
navigation.navigate('PrivateMessage', { userId });
navigation.push('PrivateMessage', { userId });
} else if (editable) {
const editAction = managePanel.find(item => item.title === '编辑');
SafariView.show(editAction.action);
Expand Down
8 changes: 4 additions & 4 deletions src/components/Content/Content.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export default class Content extends Component {
render() {
const newContent = this.getContentByGroup();
const { navigation, settings } = this.props;
const { fontSize, lineHeight } = FONT_SIZES[settings.fontSize];
const { fontSize, lineHeight, emojiSize } = FONT_SIZES[settings.fontSize];
const fontStyle = {
fontSize,
lineHeight
Expand All @@ -138,14 +138,14 @@ export default class Content extends Component {
{groupContent.map((item, index) => {
return (
item.type === 0 && (
<Text key={index}>{parseContentWithEmoji(item.infor)}</Text>
<Text key={index}>{parseContentWithEmoji(item.infor, emojiSize)}</Text>
) || (
this.isAtSomebody(item.url) && (
// @somebody
<Text
key={index}
style={styles.url}
onPress={() => navigation.navigate('Individual', {
onPress={() => navigation.push('Individual', {
userId: this.getUserId(item.url),
userName: this.getUserName(item.infor)
})}>
Expand All @@ -159,7 +159,7 @@ export default class Content extends Component {
<Text
key={index}
style={styles.url}
onPress={() => navigation.navigate('Topic', {
onPress={() => navigation.push('Topic', {
topic_id: this.getTopicId(item.url)
})}>
{item.infor}
Expand Down
4 changes: 2 additions & 2 deletions src/components/MenuButton/MenuButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ export default class MenuButton extends Component {
} = this.props;

if (isLogin) {
navigation.navigate('DrawerToggle');
navigation.openDrawer();
} else {
navigation.navigate('LoginModal');
navigation.push('LoginModal');
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/components/MenuProfile/MenuProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export default MenuProfile = (props) => {
{token &&
<TouchableOpacity
style={styles.avatar}
// https://reactnavigation.org/docs/en/navigation-prop.html
onPress={() => navigation.navigate('Information', { userId: uid })}>
<Image
key={avatar}
Expand All @@ -36,7 +37,7 @@ export default MenuProfile = (props) => {
||
<TouchableOpacity
style={styles.avatar}
onPress={() => navigation.navigate('LoginModal')}>
onPress={() => navigation.push('LoginModal')}>
<Image
key='noavatar'
style={styles.avatar}
Expand Down
4 changes: 2 additions & 2 deletions src/components/NotifyItem/NotifyItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default NotifyItem = (props) => {
<TouchableHighlight
style={styles.container}
underlayColor={colors.underlay}
onPress={() => navigation.navigate('Topic', {
onPress={() => navigation.push('Topic', {
topic_id,
board_id,
board_name
Expand All @@ -68,7 +68,7 @@ export default NotifyItem = (props) => {
<Button
style={styles.button}
textStyle={styles.buttonText}
onPress={() => navigation.navigate('ReplyModal', {
onPress={() => navigation.push('ReplyModal', {
comment: {
// WTF! Why there are different names for common field?!
reply_name: reply_nick_name,
Expand Down
2 changes: 1 addition & 1 deletion src/components/PmSessionItem/PmSessionItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default class PmSessionItem extends Component {
// Mark message as read.
this.props.markPmAsRead({ plid });
}
this.props.navigation.navigate('PrivateMessage', { userId });
this.props.navigation.push('PrivateMessage', { userId });
}

render() {
Expand Down
4 changes: 2 additions & 2 deletions src/components/SettingItem/SettingItem.style.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ export default StyleSheet.create({
backgroundColor: colors.white,
},
info: {
color: colors.mainField,
color: colors.significantField,
},
indicator: {
flex: 1,
textAlign: 'right',
color: colors.underlay,
color: colors.mainField,
}
});
2 changes: 1 addition & 1 deletion src/components/SubForumItem/SubForumItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default SubForumItem = (props) => {
if (isForumListModal) {
props.handleSelectForum(subForum);
} else {
navigation.navigate('Forum', subForum);
navigation.push('Forum', subForum);
}
}}>
<View style={styles.subForum}>
Expand Down
4 changes: 2 additions & 2 deletions src/components/TopicItem/TopicItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ export default class TopicItem extends Component {
} = this.props;
// Login User
if (currentUserId) {
navigation.navigate('Topic', topic);
navigation.push('Topic', topic);
} else {
navigation.navigate('LoginModal');
navigation.push('LoginModal');
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/config/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = {

MAX_UPLOAD_IMAGES_COUNT: 9,

VERSION: 'v1.7.0',
VERSION: 'v1.7.1',

AUTHOR_ID: 32044,

Expand Down
9 changes: 6 additions & 3 deletions src/constants/fontSize.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@ export default {
big: {
text: '大',
fontSize: 17,
lineHeight: 24
lineHeight: 24,
emojiSize: 28
},
medium: {
text: '中',
fontSize: 16,
lineHeight: 22
lineHeight: 22,
emojiSize: 26
},
small: {
text: '小',
fontSize: 15,
lineHeight: 20
lineHeight: 20,
emojiSize: 24
}
};
2 changes: 1 addition & 1 deletion src/containers/About/About.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default class About extends Component {
<SettingItem
style={styles.lastItem}
text='BUG 上报或意见反馈'
onPress={() => navigation.navigate('PrivateMessage', {
onPress={() => navigation.push('PrivateMessage', {
userId: configs.AUTHOR_ID
})} />
</View>
Expand Down
2 changes: 1 addition & 1 deletion src/containers/ForumDetail/ForumDetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ForumDetail extends Component {
headerRight: (
isLogin &&
<PublishButton
onPress={() => navigation.navigate('PublishModal', {
onPress={() => navigation.push('PublishModal', {
boardId,
callback: () => handleModalCallback()
})} />
Expand Down
2 changes: 1 addition & 1 deletion src/containers/ForumListModal/ForumListModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class ForumListModal extends Component {

handleSelectForum(forum) {
const { navigation } = this.props;
navigation.navigate('PublishModal', {
navigation.push('PublishModal', {
boardId: forum.board_id
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Home/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Home extends Component {
headerRight: (
isLogin &&
<PublishButton
onPress={() => navigation.navigate('ForumListModal')} />
onPress={() => navigation.push('ForumListModal')} />
)
};
}
Expand Down
4 changes: 2 additions & 2 deletions src/containers/Individual/Individual.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Individual extends Component {
style={headerRightButtonStyles.button}
name='envelope'
size={18}
onPress={() => navigation.navigate('PrivateMessage', { userId })} />
onPress={() => navigation.push('PrivateMessage', { userId })} />
)
};
}
Expand Down Expand Up @@ -141,7 +141,7 @@ class Individual extends Component {
<View style={styles.header}>
<TouchableOpacity
onPress={() => {
navigation.navigate('Information', { userId: this.userId });
navigation.push('Information', { userId: this.userId });
}}>
<Image
style={styles.avatar}
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Information/Information.style.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ export default StyleSheet.create({
},
avatarIndicator: {
marginLeft: 10,
color: colors.underlay,
color: colors.mainField,
}
});
4 changes: 2 additions & 2 deletions src/containers/LoginModal/LoginModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from 'react-native';
import Button from 'apsl-react-native-button';
import { connect } from 'react-redux';
import { NavigationActions } from 'react-navigation';
import { NavigationActions, StackActions } from 'react-navigation';
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
import PopButton from '~/components/PopButton/PopButton';
import Header from '~/components/Header/Header';
Expand All @@ -28,7 +28,7 @@ import {
import mainStyles from '~/common/styles/Main.style';
import styles from './LoginModal.style';

const resetAction = NavigationActions.reset({
const resetAction = StackActions.reset({
index: 0,
actions: [
NavigationActions.navigate({ routeName: 'Main' })
Expand Down
4 changes: 2 additions & 2 deletions src/containers/Menu/Menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
AsyncStorage,
ActionSheetIOS,
} from 'react-native';
import { SafeAreaView, NavigationActions } from 'react-navigation';
import { SafeAreaView, NavigationActions, StackActions } from 'react-navigation';
import MenuProfile from '~/components/MenuProfile/MenuProfile';
import MenuItem from '~/components/MenuItem/MenuItem';
import MenuBottomItem from '~/components/MenuBottomItem/MenuBottomItem';
Expand All @@ -22,7 +22,7 @@ import { getAlertCount } from '~/modules/message/alert/alert.selectors';

import styles from './Menu.style';

const resetAction = NavigationActions.reset({
const resetAction = StackActions.reset({
index: 0,
actions: [
NavigationActions.navigate({ routeName: 'Home' })
Expand Down
Loading

0 comments on commit a29ddcf

Please sign in to comment.