Skip to content

Commit

Permalink
remove subset and use type
Browse files Browse the repository at this point in the history
  • Loading branch information
NaingAmity committed Jan 30, 2024
1 parent 2bca460 commit f038dee
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 16 deletions.
8 changes: 0 additions & 8 deletions src/enum/tabNameState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,3 @@ export enum TabName {
Communities = 'Communities',
Accounts = 'Accounts',
}

export type TabNameSubset =
| TabName.Accounts
| TabName.Communities
| TabName.Explorer
| TabName.Gallery
| TabName.NewsFeed
| TabName.Timeline;
4 changes: 2 additions & 2 deletions src/screens/CommunityHome/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import { useFocusEffect, useNavigation } from '@react-navigation/native';
import { NativeStackNavigationProp } from '@react-navigation/native-stack';
import FloatingButton from '../../components/FloatingButton';
import useImage from '../../hooks/useImage';
import { TabName, TabNameSubset } from '../../enum/tabNameState';
import { TabName } from '../../enum/tabNameState';

export type FeedRefType = {
handleLoadMore: () => void;
Expand Down Expand Up @@ -200,7 +200,7 @@ export default function CommunityHome({ route }: any) {
);
};

const handleTab = (tabName: TabNameSubset) => {
const handleTab = (tabName: TabName) => {
console.log('index: ', tabName); //this func not implmented yet
};

Expand Down
4 changes: 2 additions & 2 deletions src/screens/CommunitySearch/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import type { ISearchItem } from '../../components/SearchItem';
import SearchItem from '../../components/SearchItem';
import { useTheme } from 'react-native-paper';
import type { MyMD3Theme } from '../../providers/amity-ui-kit-provider';
import { TabName, TabNameSubset } from '../../enum/tabNameState';
import { TabName } from '../../enum/tabNameState';

enum searchTypeEnum {
user = 'user',
Expand Down Expand Up @@ -130,7 +130,7 @@ export default function CommunitySearch() {
const cancelSearch = () => {
navigation.goBack();
};
const handleTabChange = (tabName: TabNameSubset) => {
const handleTabChange = (tabName: TabName) => {
if (tabName === TabName.Communities) {
setSearchType(searchTypeEnum.community);
if (searchTerm.length > 0) {
Expand Down
4 changes: 2 additions & 2 deletions src/screens/Home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ import CreatePostModal from '../../components/CreatePostModal';
import CustomTab from '../../components/CustomTab';
import { useTheme } from 'react-native-paper';
import type { MyMD3Theme } from '../../providers/amity-ui-kit-provider';
import { TabName, TabNameSubset } from '../../enum/tabNameState';
import { TabName } from '../../enum/tabNameState';
LogBox.ignoreAllLogs(true);
export default function Home() {
// const { t, i18n } = useTranslation();
const styles = getStyles();
const { client } = useAuth();
const theme = useTheme() as MyMD3Theme;
const [activeTab, setActiveTab] = useState<TabNameSubset>(TabName.NewsFeed);
const [activeTab, setActiveTab] = useState<TabName>(TabName.NewsFeed);
const [isVisible, setIsVisible] = useState(false);

const [createPostModalVisible, setCreatePostModalVisible] = useState(false);
Expand Down
4 changes: 2 additions & 2 deletions src/screens/UserProfile/UserProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { editIcon } from '../../svg/svg-xml-list';
import type { MyMD3Theme } from '../../providers/amity-ui-kit-provider';
import { useTheme } from 'react-native-paper';
import FloatingButton from '../../components/FloatingButton';
import { TabName, TabNameSubset } from '../../enum/tabNameState';
import { TabName } from '../../enum/tabNameState';

export default function UserProfile({ route }: any) {
const theme = useTheme() as MyMD3Theme;
Expand Down Expand Up @@ -151,7 +151,7 @@ export default function UserProfile({ route }: any) {
);
};

const handleTab = (tabName: TabNameSubset) => {
const handleTab = (tabName: TabName) => {
console.log('index: ', tabName); //this func not implmented yet
};
const handleScroll = (event: NativeSyntheticEvent<NativeScrollEvent>) => {
Expand Down

0 comments on commit f038dee

Please sign in to comment.