Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 31 additions & 3 deletions apps/frontend/app/(tabs)/(profile)/feedback.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,32 @@
import { icons } from '@/assets';
import { AccountInfo, ChipFilter, DividerX, ReviewCard } from '@/components';
import { useProfile, useReviews } from '@/hooks';
import cn from 'clsx';
import { useEffect, useState } from 'react';
import { FlatList, Platform, useColorScheme, View } from 'react-native';
import { FlatList, Image, Platform, Text, useColorScheme, View } from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';

const FeedbackEmptyState = () => {
const isDark = useColorScheme() === 'dark';

return (
<View className='items-center gap-y-4 py-12'>
<Image
source={isDark ? icons.dark.messageFav : icons.light.messageFav}
className='size-32'
resizeMode='contain'
/>

<View className='items-center gap-y-2'>
<Text className='font-clashDisplay text-lg text-body dark:text-body-dark'>No Feedback Yet</Text>
<Text className='font-satoshi text-sm text-label dark:text-label-dark'>
Feedback from other users will appear here
</Text>
</View>
</View>
);
};

const Feedback = () => {
const isDark = useColorScheme() === 'dark';

Expand All @@ -19,6 +41,9 @@ const Feedback = () => {
android: 'pb-24',
});

const isEmpty = reviewsList.length === 0;
const isAllEmpty = filterReviewsByType('all').length === 0;

useEffect(() => {
setReviewsList(filterReviewsByType(reviewType.id));
}, [reviewType]);
Expand All @@ -36,11 +61,14 @@ const Feedback = () => {
data={reviewsList}
initialNumToRender={0}
showsVerticalScrollIndicator={false}
keyExtractor={(item, index) => item.id.toString()}
keyExtractor={(item) => item.id.toString()}
contentContainerClassName={adsListStyle}
renderItem={({ item, index }) => <ReviewCard review={item} index={index} />}
ItemSeparatorComponent={() => <DividerX style={cn('mt-3 mb-4', isDark ? 'opacity-40' : 'opacity-25')} />}
ListFooterComponent={() => <DividerX style={cn('mt-3', isDark ? 'opacity-40' : 'opacity-25')} />}
ListFooterComponent={
!isEmpty ? () => <DividerX style={cn('mt-3', isDark ? 'opacity-40' : 'opacity-25')} /> : null
}
ListEmptyComponent={isAllEmpty ? <FeedbackEmptyState /> : null}
/>
</View>
</SafeAreaView>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions apps/frontend/assets/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ const icons = {
tickHalo: require('./icons/light/tick-halo.png'),
clockHalo: require('./icons/light/clock-halo.png'),

// Feedback
messageFav: require('./icons/light/message-favorite.png'),

// Active Tab
active: {
home: require('./icons/light/active/home.png'),
Expand Down Expand Up @@ -150,6 +153,9 @@ const icons = {
tickHalo: require('./icons/dark/tick-halo.png'),
clockHalo: require('./icons/dark/clock-halo.png'),

// Feedback
messageFav: require('./icons/dark/message-favorite.png'),

// Active Tab
active: {
home: require('./icons/dark/active/home.png'),
Expand Down