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

View File

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

View File

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