changing post display on profile to a more compact display that eventually you will be able to click into for more details - I think i will do the same on the posts page and have the admins enter information about why the post was approved or denied
This commit is contained in:
@@ -10,6 +10,7 @@ type PostComponentProps = {
|
||||
|
||||
export const PostComponent: React.FC<PostComponentProps> = ({ post, fetchData }) => {
|
||||
const { user } = useUser()
|
||||
const isProfileView = window.location.href.includes('/profile')
|
||||
|
||||
async function approvePost(postID: string) {
|
||||
console.log('Approving post ' + postID)
|
||||
@@ -54,7 +55,7 @@ export const PostComponent: React.FC<PostComponentProps> = ({ post, fetchData })
|
||||
/>
|
||||
</View>
|
||||
<Text style={{ color: '#fff' }}>{post.notes}</Text>
|
||||
{user?.publicMetadata.role !== 'admin' && (
|
||||
{isProfileView ? (
|
||||
<View style={{ flexDirection: 'row', justifyContent: 'space-between', marginTop: 10 }}>
|
||||
{post.status === StatusEnum.Created && (
|
||||
<Text style={[styles.created, styles.statusTag]}>Created</Text>
|
||||
@@ -67,8 +68,8 @@ export const PostComponent: React.FC<PostComponentProps> = ({ post, fetchData })
|
||||
<Text style={[styles.approved, styles.statusTag]}>Approved</Text>
|
||||
)}
|
||||
</View>
|
||||
)}
|
||||
{user?.publicMetadata.role === 'admin' && (
|
||||
) : null}
|
||||
{!isProfileView ? (
|
||||
<View style={{ flexDirection: 'row', justifyContent: 'space-between', marginTop: 10 }}>
|
||||
<TouchableOpacity style={{ flex: 1, marginRight: 5 }} onPress={() => denyPost(post._id)}>
|
||||
<Text
|
||||
@@ -97,7 +98,7 @@ export const PostComponent: React.FC<PostComponentProps> = ({ post, fetchData })
|
||||
</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
)}
|
||||
) : null}
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user