Merge pull request #1955 from ecency/nt/tab-bar-refinements

Nt/tab bar refinements
This commit is contained in:
Feruz M 2021-05-24 13:57:09 +03:00 committed by GitHub
commit b746f1af2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 9 deletions

View File

@ -19,8 +19,8 @@ export default EStyleSheet.create({
flexDirection: 'row',
justifyContent: 'space-around',
alignItems: 'center',
left: 5,
flex: 6,
marginRight: 8,
flex: 1,
},
filterBarWrapper: {
flex: 1,
@ -29,11 +29,8 @@ export default EStyleSheet.create({
justifyContent: 'space-between',
},
rightIconWrapper: {
marginRight: 8,
alignSelf: 'center',
},
customiseIconWrapper: {
paddingRight: 8,
paddingRight: 12,
width: 40,
alignSelf: 'center',
},
rightIcon: {

View File

@ -50,7 +50,7 @@ const FilterBarView = ({
enableCustomiseButton && (
<IconButton
iconStyle={styles.rightIcon}
style={styles.customiseIconWrapper}
style={styles.rightIconWrapper}
iconType={'MaterialIcon'}
size={iconSize || 28}
name={'add'}

View File

@ -50,6 +50,8 @@ const PostDisplayView = ({
const [refreshing, setRefreshing] = useState(false);
const [postBodyLoading, setPostBodyLoading] = useState(false);
const [tags, setTags] = useState([]);
// Component Life Cycles
useEffect(() => {
if (isLoggedIn && get(currentAccount, 'name') && !isNewPost) {
@ -57,6 +59,16 @@ const PostDisplayView = ({
}
}, []);
useEffect(() => {
if (post) {
const _tags = post.json_metadata ? post.json_metadata.tags : [];
if (post.category && _tags[0] !== post.category) {
_tags.splice(0, 0, post.category);
}
setTags(_tags);
}
}, [post]);
// Component Functions
const onRefresh = useCallback(() => {
setRefreshing(true);
@ -216,7 +228,7 @@ const PostDisplayView = ({
<PostBody body={post.body} onLoadEnd={_handleOnPostBodyLoad} />
{!postBodyLoading && (
<View style={styles.footer}>
<Tags tags={post.json_metadata && post.json_metadata.tags} />
<Tags tags={tags} />
<Text style={styles.footerText}>
Posted by
<Text style={styles.footerName}>{` ${author || post.author} `}</Text>