Skip to content

Commit

Permalink
Merge pull request #117 from bambu-group-03/fixes
Browse files Browse the repository at this point in the history
Fixes
  • Loading branch information
LuisParedes1 authored Dec 8, 2023
2 parents 18a0fd7 + 7f34547 commit 4c739ad
Show file tree
Hide file tree
Showing 12 changed files with 58 additions and 45 deletions.
1 change: 0 additions & 1 deletion src/screens/chat/chat-list-body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ const ChatListBody = ({
</Text>
{/* Uncomment if you want to display the last message */}
<Text className="text-base text-gray-600">
Las msg sent
{/* {chat.last_message} */}
</Text>
</View>
Expand Down
26 changes: 7 additions & 19 deletions src/screens/feed/compose.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
import {
faCalendarAlt,
faImage,
faPollH,
faSmile,
} from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-native-fontawesome';
import { zodResolver } from '@hookform/resolvers/zod';
import { Picker } from '@react-native-picker/picker';
import { useNavigation } from '@react-navigation/native';
Expand Down Expand Up @@ -118,18 +111,13 @@ export const Compose = ({ user }: { user: UserType | undefined }) => {
</View>
<View className="flex flex-row items-center justify-between border-t border-gray-500 p-2 text-blue-400">
<View className="flex flex-row pl-12">
<TouchableOpacity className="flex items-center justify-center rounded-full bg-blue-100 p-3">
<FontAwesomeIcon icon={faImage} />
</TouchableOpacity>
<TouchableOpacity className="flex items-center justify-center rounded-full bg-blue-100 p-3">
<FontAwesomeIcon icon={faPollH} />
</TouchableOpacity>
<TouchableOpacity className="flex items-center justify-center rounded-full bg-blue-100 p-3">
<FontAwesomeIcon icon={faSmile} />
</TouchableOpacity>
<TouchableOpacity className="flex items-center justify-center rounded-full bg-blue-100 p-3">
<FontAwesomeIcon icon={faCalendarAlt} />
</TouchableOpacity>
<TouchableOpacity className="flex items-center justify-center rounded-full bg-blue-100 p-3" />
<TouchableOpacity className="flex items-center justify-center rounded-full bg-blue-100 p-3" />
<TouchableOpacity className="flex items-center justify-center rounded-full bg-blue-100 p-3" />
<TouchableOpacity
className="flex items-center justify-center rounded-full bg-blue-100 p-3"
onPress={() => alert('AUCH')}

Check warning on line 119 in src/screens/feed/compose.tsx

View workflow job for this annotation

GitHub Actions / Lint TS (eslint, prettier)

Unexpected alert
/>
</View>
<View>
<Button
Expand Down
6 changes: 3 additions & 3 deletions src/screens/profile/components/card-profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { client } from '@/api/common';
import { getUserState } from '@/core';
import CardContent from '@/screens/feed/components/card/card-content';
import CardFooter from '@/screens/feed/components/card/card-footer';
import { Pressable, View } from '@/ui';
import { TouchableOpacity, View } from '@/ui';

import CardHeaderProfile from './card-header-profile';

Expand Down Expand Up @@ -82,7 +82,7 @@ export const CardProfile = ({
? 'bg-gray-100 border-transparent rounded-lg shadow-sm border border-gray-100 ml-4 mr-2'
: '';
return (
<Pressable
<TouchableOpacity
className={`flex shrink-0 p-4 pb-0 ${cardHeaderClass}`}
onPress={onPress}
>
Expand All @@ -104,7 +104,7 @@ export const CardProfile = ({
onFavBookmark={handleFavBookmark}
/>
</View>
</Pressable>
</TouchableOpacity>
);
};

Expand Down
2 changes: 1 addition & 1 deletion src/screens/profile/components/edit-profile-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const EditProfileButton = ({
<View className="flex justify-center px-2">
<Button
label="Edit"
className="mt-4 rounded-full bg-blue-400 px-4 py-2 text-center font-bold text-white shadow hover:bg-blue-500"
className="mt-4 rounded-full bg-blue-500 px-4 py-2 text-center font-bold text-white shadow hover:bg-blue-500"
onPress={() => {
navigation.navigate('EditProfile', { user: currentUser });
}}
Expand Down
2 changes: 1 addition & 1 deletion src/screens/profile/components/stadistics-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const StadisticsButton = ({
<View className="flex justify-center px-2">
<Button
label="Stats"
className="mt-4 rounded-full bg-violet-400 px-4 py-2 text-center font-bold text-white shadow"
className="mt-4 rounded-full bg-blue-500 px-4 py-2 text-center font-bold text-white shadow"
onPress={() => {
navigate('Stadistics');
}}
Expand Down
2 changes: 1 addition & 1 deletion src/screens/profile/components/verify-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const VerifyButton = ({
<View className=" flex justify-center">
<Button
label="Verify"
className="mt-4 rounded-full bg-green-400 px-4 py-2 text-center font-bold text-white shadow"
className="mt-4 rounded-full bg-blue-500 px-4 py-2 text-center font-bold text-white shadow"
onPress={() => {
navigate('Verify');
}}
Expand Down
2 changes: 1 addition & 1 deletion src/screens/profile/fav-snaps-screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const FavoriteSnapScreen = () => {
<View>
<FocusAwareStatusBar />
<FlatList
data={snaps}
data={snaps.reverse()}
renderItem={renderItem}
keyExtractor={(item) => item.id}
onEndReachedThreshold={0.8}
Expand Down
7 changes: 5 additions & 2 deletions src/screens/profile/profile-navigator.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import * as React from 'react';

import type { Snap } from '@/api';
import type { Snap as SnapType } from '@/api';
import type { UserType } from '@/core/auth/utils';
import { SignInComplete } from '@/navigation/signin-complete';
import { Snap } from '@/screens';

import type { Chat } from '../chat/chat-list-screen';
import ChatScreen from '../chat/chat-screen';
Expand All @@ -17,12 +18,13 @@ export type ProfileStackParamList = {
Profile: { user: UserType };
Followers: { users: UserType[] | undefined };
Following: { users: UserType[] | undefined };
FavSnaps: { snaps: Snap[] };
FavSnaps: { snaps: SnapType[] };
EditProfile: { user: UserType | undefined };
Chat: {
chat: Chat | undefined;
user: UserType;
};
Snap: { snap: SnapType };
Stadistics: undefined;
Verify: undefined;
};
Expand All @@ -37,6 +39,7 @@ export const ProfileNavigator = () => {
<Stack.Screen name="Following" component={InteractionsScreen} />
<Stack.Screen name="FavSnaps" component={FavoriteSnapScreen} />
<Stack.Screen name="EditProfile" component={SignInComplete} />
<Stack.Screen name="Snap" component={Snap} />
<Stack.Screen name="Chat" component={ChatScreen} />
<Stack.Screen name="Stadistics" component={StadisticsScreen} />
<Stack.Screen name="Verify" component={VerifyScreen} />
Expand Down
9 changes: 8 additions & 1 deletion src/screens/profile/profile-snaps-view.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useNavigation } from '@react-navigation/native';
import React, { useCallback } from 'react';
import { FlatList, RefreshControl } from 'react-native';

Expand Down Expand Up @@ -36,8 +37,14 @@ const ProfileSnapsView = ({
hasNextPage && fetchNextPage();
};

const { navigate } = useNavigation();

const renderItem = ({ item }: { item: Snap }) => (
<CardProfile snap={item} username={user?.username || ''} />
<CardProfile
snap={item}
username={user?.username || ''}
onPress={() => navigate('Snap', { snap: item })}
/>
);

if (isLoading && !data) {
Expand Down
9 changes: 8 additions & 1 deletion src/screens/search/form-for-search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,18 @@ export const FormForSearch: React.FC<SearchFormProps> = ({
</View>
</View>
</View>
<ControlledInput testID="search-input" control={control} name="search" />
<ControlledInput
testID="search-input"
control={control}
className="w-50 h-10 border-spacing-0 resize-none rounded-md border border-gray-300 px-3 text-xl focus:border-blue-500 focus:outline-none"
placeholder={'Search by ' + type}
name="search"
/>

<Button
testID="search-button"
label="Search"
className=" flex items-center justify-center rounded-full bg-blue-500 px-4 py-2 font-bold text-white shadow"
onPress={handleSubmit(onSearchSubmit)}
variant="primary"
/>
Expand Down
9 changes: 6 additions & 3 deletions src/screens/search/search-navigator.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import * as React from 'react';

import type { Snap } from '@/api';
import type { Snap as SnapType } from '@/api';
import type { UserType } from '@/core/auth/utils';
import { SignInComplete } from '@/navigation/signin-complete';
import { Snap } from '@/screens';

import type { Chat } from '../chat/chat-list-screen';
import ChatScreen from '../chat/chat-screen';
Expand All @@ -20,8 +21,9 @@ export type SearchStackParamList = {
Users: { users: UserType[] | undefined };
Followers: { users: UserType[] | undefined };
Following: { users: UserType[] | undefined };
SnapList: { snaps: Snap[] };
FavSnaps: { snaps: Snap[] };
SnapList: { snaps: SnapType[] };
Snap: { snap: SnapType };
FavSnaps: { snaps: SnapType[] };
EditProfile: { user: UserType | undefined };
Chat: {
chat: Chat | undefined;
Expand All @@ -40,6 +42,7 @@ export const SearchNavigator = () => {
<Stack.Screen name="Followers" component={InteractionsScreen} />
<Stack.Screen name="Following" component={InteractionsScreen} />
<Stack.Screen name="SnapList" component={SnapList} />
<Stack.Screen name="Snap" component={Snap} />
<Stack.Screen name="FavSnaps" component={FavoriteSnapScreen} />
<Stack.Screen name="EditProfile" component={SignInComplete} />
<Stack.Screen name="Chat" component={ChatScreen} />
Expand Down
28 changes: 17 additions & 11 deletions src/screens/search/search-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,23 @@ const SearchView = () => {
<SearchBar />
<View className="flex flex-row flex-wrap p-4">
<Text className="w-full text-lg font-bold">Trending Topics</Text>
{recentTrends.map((topic) => (
<TouchableOpacity
key={topic.id}
onPress={() => handleTopicSelect(topic)}
className="m-1 rounded-full bg-blue-100 px-4 py-2"
>
<Text className="text-blue-500">
{topic.name} ({topic.times_used}){' '}
</Text>
</TouchableOpacity>
))}
{recentTrends.length === 0 ? (
<View className="p-2 text-center">
<Text>No current trending topics</Text>
</View>
) : (
recentTrends.map((topic) => (
<TouchableOpacity
key={topic.id}
onPress={() => handleTopicSelect(topic)}
className="m-1 rounded-full bg-blue-100 px-4 py-2"
>
<Text className="text-blue-500">
{topic.name} ({topic.times_used}){' '}
</Text>
</TouchableOpacity>
))
)}
</View>
</>
);
Expand Down

0 comments on commit 4c739ad

Please sign in to comment.