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:
Will Baumbach
2025-08-07 23:23:46 -05:00
parent bcd78e3f89
commit 6dfe544e1d
5 changed files with 91 additions and 14 deletions

View File

@@ -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>
)
}