aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/constants/constants.ts15
-rw-r--r--src/services/ExploreService.ts37
-rw-r--r--src/store/actions/taggUsers.ts3
-rw-r--r--src/store/initialStates.ts1
-rw-r--r--src/types/types.ts9
5 files changed, 4 insertions, 61 deletions
diff --git a/src/constants/constants.ts b/src/constants/constants.ts
index 6b513f4e..d24e352e 100644
--- a/src/constants/constants.ts
+++ b/src/constants/constants.ts
@@ -1,6 +1,6 @@
import {ReactText} from 'react';
-import {BackgroundGradientType, ExploreSectionType} from './../types/';
-import {SCREEN_WIDTH, SCREEN_HEIGHT, isIPhoneX, normalize} from '../utils';
+import {isIPhoneX, normalize, SCREEN_HEIGHT, SCREEN_WIDTH} from '../utils';
+import {BackgroundGradientType} from './../types/';
export const CHIN_HEIGHT = 34;
@@ -182,17 +182,6 @@ export const MOMENT_CATEGORY_BG_COLORS: string[] = [
'#4E7175',
];
-// order matters, this decides the order which it displays
-export const EXPLORE_SECTION_TITLES: ExploreSectionType[] = [
- 'New to Tagg',
- 'People You May Know',
- 'Trending on Tagg',
- "Brown '24",
- "Brown '23",
- "Brown '22",
- "Brown '21",
-];
-
export const SP_WIDTH = 375;
export const SP_HEIGHT = 812;
diff --git a/src/services/ExploreService.ts b/src/services/ExploreService.ts
index 07af91ad..44df8056 100644
--- a/src/services/ExploreService.ts
+++ b/src/services/ExploreService.ts
@@ -4,12 +4,7 @@ import {
DISCOVER_ENDPOINT,
SEARCH_BUTTONS_ENDPOPINT,
} from '../constants';
-import {EMPTY_PROFILE_PREVIEW_LIST} from '../store/initialStates';
-import {
- ExploreSectionType,
- ProfilePreviewType,
- SearchCategoryType,
-} from '../types';
+import {ProfilePreviewType, SearchCategoryType} from '../types';
export const getAllTaggUsers = async (token: string) => {
try {
@@ -38,36 +33,6 @@ export const getAllTaggUsers = async (token: string) => {
}
};
-export const getAllExploreSections = async () => {
- try {
- const token = await AsyncStorage.getItem('token');
- const response = await fetch(DISCOVER_ENDPOINT, {
- method: 'GET',
- headers: {
- Authorization: 'Token ' + token,
- },
- });
- if (response.status !== 200) {
- return EMPTY_PROFILE_PREVIEW_LIST;
- }
- const data = await response.json();
- // TODO (if we return to original explore format): get keys from backend API
- const exploreSections: Record<ExploreSectionType, ProfilePreviewType[]> = {
- 'New to Tagg': data.categories.new_to_tagg,
- 'People You May Know': data.categories.people_you_may_know,
- 'Trending on Tagg': data.categories.trending_on_tagg,
- "Brown '21": data.categories.brown_21,
- "Brown '22": data.categories.brown_22,
- "Brown '23": data.categories.brown_23,
- "Brown '24": data.categories.brown_24,
- };
-
- return exploreSections;
- } catch (error) {
- console.log('Unable to fetch explore data');
- }
-};
-
export const getDiscoverUsers = async (categoryName: string) => {
try {
const token = await AsyncStorage.getItem('token');
diff --git a/src/store/actions/taggUsers.ts b/src/store/actions/taggUsers.ts
index 72ce848b..0cd94e92 100644
--- a/src/store/actions/taggUsers.ts
+++ b/src/store/actions/taggUsers.ts
@@ -1,5 +1,5 @@
import {Action, ThunkAction} from '@reduxjs/toolkit';
-import {getAllExploreSections, loadRecentlySearchedUsers} from '../../services';
+import {loadRecentlySearchedUsers} from '../../services';
import {taggUsersFetched} from '../reducers';
import {RootState} from '../rootReducer';
@@ -11,7 +11,6 @@ export const loadRecentlySearched = (): ThunkAction<
> => async (dispatch) => {
try {
const recentSearches = await loadRecentlySearchedUsers();
- getAllExploreSections();
dispatch({
type: taggUsersFetched.type,
payload: {recentSearches},
diff --git a/src/store/initialStates.ts b/src/store/initialStates.ts
index b43e4a1d..28a4d10a 100644
--- a/src/store/initialStates.ts
+++ b/src/store/initialStates.ts
@@ -1,6 +1,5 @@
import {CommentThreadType} from './../types/types';
import {
- ExploreSectionType,
MomentType,
NotificationType,
ProfilePreviewType,
diff --git a/src/types/types.ts b/src/types/types.ts
index dc2817bd..fc77ba4b 100644
--- a/src/types/types.ts
+++ b/src/types/types.ts
@@ -125,15 +125,6 @@ export enum ScreenType {
SuggestedPeople,
}
-export type ExploreSectionType =
- | 'People You May Know'
- | 'New to Tagg'
- | 'Trending on Tagg'
- | "Brown '21"
- | "Brown '22"
- | "Brown '23"
- | "Brown '24";
-
/**
* Redux store to have a Record of ScreenType (Search, Profile, Home etc) mapped to
* A Record of userIXd mapped to UserXType