Skip to content

Commit 9bd7d80

Browse files
committed
handle some render detail.
1 parent 8ae3afe commit 9bd7d80

File tree

10 files changed

+35
-60
lines changed

10 files changed

+35
-60
lines changed

source/common/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import entities from 'entities';
99

1010
const imageSourcePath = Config.assetDomain + "/public/img/metarial/";
1111
const bloggerAvatarPath = "https://pic.cnblogs.com/face/";
12-
const questionAvatarPath = "http://pic.cnblogs.com/avatar/";
1312

1413
export function getBloggerName(authorUri) {
1514
authorUri = _.trimEnd(authorUri, '\/');
@@ -25,7 +24,7 @@ export function getBloggerAvatar(avatarUri){
2524

2625
export function getQuestionAuthorAvatar(avatarName){
2726
if(avatarName && avatarName !== "sample_face.gif"){
28-
return questionAvatarPath + avatarName;
27+
return bloggerAvatarPath + avatarName;
2928
}
3029
return Config.appInfo.avatar;
3130
}

source/component/header/post.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class PostRender extends Component {
8585
</Text>
8686
</View>
8787
<Text style={ [ CommonStyles.text_light ] }>
88-
{ postInfo.PostDate }
88+
{ postInfo.DateAdded }
8989
</Text>
9090
</View>
9191
</Animatable.View>

source/component/hintMessage.js

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@ import {
66
} from 'react-native';
77

88
import Icon from 'react-native-vector-icons/Ionicons';
9-
import { CommonStyles, StyleConfig } from '../style';
9+
import { CommonStyles, ComponentStyles, StyleConfig } from '../style';
1010
import PureRenderMixin from 'react-addons-pure-render-mixin';
1111

12-
const { height, width } = Dimensions.get('window');
13-
1412
class HintMessage extends Component {
1513

1614
constructor(props) {
@@ -20,17 +18,11 @@ class HintMessage extends Component {
2018

2119
render() {
2220

23-
let { message = '这里什么都没有' } = this.props;
21+
let { message = '- 这里什么都没有 -' } = this.props;
2422

2523
return (
26-
<View style={ CommonStyles.messageContainer }>
27-
28-
<Icon
29-
name = {'ios-thunderstorm-outline'}
30-
size = {100}
31-
style = { CommonStyles.messageIcon }/>
32-
33-
<Text style={ [CommonStyles.messageText] }>{ message }</Text>
24+
<View style={ [ComponentStyles.message_container] }>
25+
<Text style={ [CommonStyles.text_gray, CommonStyles.font_sm, CommonStyles.text_center ] }>{ message }</Text>
3426
</View>
3527
)
3628
}

source/component/listview/blinkRow.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ class BlinkRow extends Component {
3535
}
3636

3737
renderBlinkHeader(blinkInfo){
38+
console.info("blink row");
39+
console.info(blinkInfo.AuthorAvatar);
3840
return (
3941
<View style={ [ CommonStyles.flexRow, CommonStyles.flexItemsMiddle, CommonStyles.m_b_2 ] }>
4042
<Image ref={view => this.imgView=view}
@@ -51,7 +53,7 @@ class BlinkRow extends Component {
5153
renderBlinkContent(blinkInfo){
5254
return (
5355
<View style={ [ CommonStyles.m_b_2 ] }>
54-
<Text style={ [CommonStyles.text_gray, CommonStyles.font_sm, CommonStyles.line_height_sm ] }>
56+
<Text style={ [CommonStyles.text_black, CommonStyles.font_sm, CommonStyles.line_height_sm ] }>
5557
{ blinkInfo.Content }
5658
</Text>
5759
</View>

source/component/listview/newsRow.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class NewsRow extends Component {
5050
renderNewsTitle(newsInfo){
5151
return (
5252
<View style={ [ CommonStyles.m_b_1 ] }>
53-
<Text style={ [CommonStyles.text_black, CommonStyles.font_md, CommonStyles.line_height_md ] }>
53+
<Text style={ [CommonStyles.text_black, CommonStyles.font_sm, CommonStyles.line_height_sm ] }>
5454
{ newsInfo.Title }
5555
</Text>
5656
</View>

source/component/listview/postRow.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class PostRow extends Component {
6060
renderPostTitle(postInfo){
6161
return (
6262
<View style={ [ CommonStyles.m_b_1 ] }>
63-
<Text style={ [CommonStyles.text_black, CommonStyles.font_md, CommonStyles.line_height_md ] }>
63+
<Text style={ [CommonStyles.text_black, CommonStyles.font_sm, CommonStyles.line_height_sm ] }>
6464
{ postInfo.Title }
6565
</Text>
6666
</View>

source/component/listview/questionRow.js

Lines changed: 16 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class QuestionRow extends Component {
4242
renderQuestionTitle(questionInfo){
4343
return (
4444
<View style={ [ CommonStyles.m_b_1 ] }>
45-
<Text style={ [CommonStyles.text_black, CommonStyles.font_md, CommonStyles.line_height_md ] }>
45+
<Text style={ [CommonStyles.text_black, CommonStyles.font_sm, CommonStyles.line_height_sm ] }>
4646
{ questionInfo.Title }
4747
</Text>
4848
</View>
@@ -59,25 +59,6 @@ class QuestionRow extends Component {
5959
)
6060
}
6161

62-
renderQuestionTags(questionInfo){
63-
return (
64-
<View style={ [ CommonStyles.flexRow ]}>
65-
{
66-
questionInfo.Tags?
67-
splitStrToArray(questionInfo.Tags).map((tag, index)=>{
68-
return (
69-
<Text key = {index}
70-
style={ [CommonStyles.text_gray, CommonStyles.font_xs, CommonStyles.m_r_2] }>
71-
{ `#${tag}` }
72-
</Text>
73-
)
74-
})
75-
: null
76-
}
77-
</View>
78-
)
79-
}
80-
8162
renderQuestionCount(questionInfo){
8263
return (
8364
<View style={[ CommonStyles.flexRow, CommonStyles.flexItemsMiddle]}>
@@ -92,10 +73,20 @@ class QuestionRow extends Component {
9273
)
9374
}
9475

76+
renderQuestionDate(questionInfo){
77+
return (
78+
<View style={[ CommonStyles.flexColumn ]}>
79+
<Text style={ [ CommonStyles.text_gray, CommonStyles.font_xs ] }>
80+
{ questionInfo.DateAdded }
81+
</Text>
82+
</View>
83+
)
84+
}
85+
9586
renderQuestionMeta(questionInfo){
9687
return (
9788
<View style={ [ CommonStyles.flexRow, CommonStyles.flexItemsBetween ] }>
98-
{ this.renderQuestionTags(questionInfo) }
89+
{ this.renderQuestionDate(questionInfo) }
9990
{ this.renderQuestionCount(questionInfo) }
10091
</View>
10192
)
@@ -122,17 +113,12 @@ class QuestionRow extends Component {
122113
return (
123114
<View style={ [ CommonStyles.flexRow, CommonStyles.flexItemsMiddle ]}>
124115
<Image ref={view => this.imgView=view}
125-
style={ [ styles.avatar, CommonStyles.m_r_2] }
116+
style={ [ ComponentStyles.avatar_mini, CommonStyles.m_r_2] }
126117
source={ {uri:questionInfo.AuthorAvatar} }>
127118
</Image>
128-
<View style={[ CommonStyles.flexColumn ]}>
129-
<Text style={ [ CommonStyles.text_gray, CommonStyles.font_xs ] }>
130-
{ questionInfo.AuthorName }
131-
</Text>
132-
<Text style={ [ CommonStyles.text_gray, CommonStyles.font_xs ] }>
133-
{ questionInfo.DateAdded }
134-
</Text>
135-
</View>
119+
<Text style={ [ CommonStyles.text_gray, CommonStyles.font_xs ] }>
120+
{ questionInfo.AuthorName }
121+
</Text>
136122
</View>
137123
)
138124
}
@@ -167,12 +153,4 @@ class QuestionRow extends Component {
167153
}
168154
}
169155

170-
const styles = StyleSheet.create({
171-
avatar:{
172-
width: 30,
173-
height: 30,
174-
borderRadius: 15
175-
}
176-
});
177-
178156
export default QuestionRow;

source/component/spinner.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Spinner extends Component {
1818
return (
1919
<ActivityIndicator
2020
size = { 'large' }
21-
color={ StyleConfig.mainColor }
21+
color={ StyleConfig.color_primary }
2222
{...this.props} />
2323
)
2424
}

source/style/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,10 @@ export const ComponentStyles = StyleSheet.create({
208208
flexDirection:'column'
209209
},
210210

211+
message_container:{
212+
marginTop: 60
213+
},
214+
211215
// button
212216

213217
btn: {

source/view/post.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class PostPage extends Component {
5050

5151
if (this.state.hasFocus === false || ui.loadPending[id] !== false) {
5252
return (
53-
<View style={ [ CommonStyles.m_y_4 ] }>
53+
<View style={ [ ComponentStyles.message_container ] }>
5454
<Spinner />
5555
</View>
5656
)
@@ -60,18 +60,18 @@ class PostPage extends Component {
6060
return (
6161
<View style={ [CommonStyles.p_a_3 ] }>
6262
{
63-
/*
6463
<HtmlConvertor
6564
imgDisabled = { imgDisabled }
6665
content={ postContent }>
6766
</HtmlConvertor>
68-
*/
6967
}
7068

7169
{
70+
/*
7271
<Markdown style={ HtmlConvertorStyles }>
7372
{ postContent }
7473
</Markdown>
74+
*/
7575
}
7676

7777

0 commit comments

Comments
 (0)