Skip to content

Commit 95f3321

Browse files
committed
remove type from name
1 parent 47b371c commit 95f3321

23 files changed

Lines changed: 64 additions & 64 deletions

File tree

src/features/conferencesCard/api/getConferences.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { useQueries, UseQueryOptions } from '@tanstack/react-query'
22
import { QueryConfig } from 'src/lib/react-query'
3-
import { ConferenceType } from 'src/types'
3+
import { Conference } from 'src/types'
44
import { axios } from 'src/lib/axios'
55

6-
const getConferences = async (tag: string): Promise<ConferenceType[]> => {
6+
const getConferences = async (tag: string): Promise<Conference[]> => {
77
return axios.get(`/data/v2/conferences/${tag}.json`)
88
}
99

@@ -16,7 +16,7 @@ type UseGetConferencesOptions = {
1616

1717
export const useGetConferences = ({ config, tags }: UseGetConferencesOptions) => {
1818
return useQueries({
19-
queries: tags.map<UseQueryOptions<ConferenceType[]>>((tag) => {
19+
queries: tags.map<UseQueryOptions<Conference[]>>((tag) => {
2020
return {
2121
...config,
2222
queryKey: ['conferences', tag],

src/features/conferencesCard/components/ConferencesCard.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Card } from 'src/components/Elements/Card'
22
import { ListComponent } from 'src/components/List'
33
import { useGetConferences } from '../api/getConferences'
4-
import { ConferenceType, CardPropsType } from 'src/types'
4+
import { Conference, CardPropsType } from 'src/types'
55
import { useUserPreferences } from 'src/stores/preferences'
66
import { getCardTagsValue } from 'src/utils/DataEnhancement'
77
import ConferenceItem from './ConferenceItem'
@@ -15,14 +15,14 @@ export function ConferencesCard({ meta, withAds }: CardPropsType) {
1515

1616
const getData = () => {
1717
return results
18-
.reduce((acc: ConferenceType[], curr) => {
18+
.reduce((acc: Conference[], curr) => {
1919
if (!curr.data) return acc
2020
return [...acc, ...curr.data]
2121
}, [])
2222
.sort((a, b) => a.start_date - b.start_date)
2323
}
2424

25-
const renderItem = (item: ConferenceType, index: number) => (
25+
const renderItem = (item: Conference, index: number) => (
2626
<ConferenceItem item={item} key={`cf-${index}`} index={index} listingMode={listingMode} />
2727
)
2828

src/features/devtoCard/api/getArticles.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { useQueries, UseQueryOptions } from '@tanstack/react-query'
22
import { QueryConfig } from 'src/lib/react-query'
3-
import { ArticleType } from 'src/types'
3+
import { Article } from 'src/types'
44
import { axios } from 'src/lib/axios'
55

6-
const getArticles = async (tag: string): Promise<ArticleType[]> => {
6+
const getArticles = async (tag: string): Promise<Article[]> => {
77
return axios.get(`/data/v2/devto/${tag}.json`)
88
}
99

@@ -16,7 +16,7 @@ type UseGetArticlesOptions = {
1616

1717
export const useGetArticles = ({ config, tags }: UseGetArticlesOptions) => {
1818
return useQueries({
19-
queries: tags.map<UseQueryOptions<ArticleType[]>>((tag) => {
19+
queries: tags.map<UseQueryOptions<Article[]>>((tag) => {
2020
return {
2121
...config,
2222
queryKey: ['devtoArticles', tag],

src/features/devtoCard/components/DevtoCard.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useState, useEffect } from 'react'
22
import { Card } from 'src/components/Elements/Card'
33
import { ListComponent } from 'src/components/List'
44
import { useGetArticles } from '../api/getArticles'
5-
import { ArticleType, CardPropsType } from 'src/types'
5+
import { Article, CardPropsType } from 'src/types'
66
import { useUserPreferences } from 'src/stores/preferences'
77
import { getCardTagsValue } from 'src/utils/DataEnhancement'
88
import ArticleItem from './ArticleItem'
@@ -40,14 +40,14 @@ export function DevtoCard({ withAds, meta }: CardPropsType) {
4040

4141
const getData = () => {
4242
return results
43-
.reduce((acc: ArticleType[], curr) => {
43+
.reduce((acc: Article[], curr) => {
4444
if (!curr.data) return acc
4545
return [...acc, ...curr.data]
4646
}, [])
4747
.sort((a, b) => b.reactions - a.reactions)
4848
}
4949

50-
const renderItem = (item: ArticleType, index: number) => (
50+
const renderItem = (item: Article, index: number) => (
5151
<ArticleItem
5252
item={item}
5353
key={`at-${index}`}

src/features/freecodecampCard/api/getArticles.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { useQueries, UseQueryOptions } from '@tanstack/react-query'
22
import { QueryConfig } from 'src/lib/react-query'
3-
import { ArticleType } from 'src/types'
3+
import { Article } from 'src/types'
44
import { axios } from 'src/lib/axios'
55

6-
const getArticles = async (tag: string): Promise<ArticleType[]> => {
6+
const getArticles = async (tag: string): Promise<Article[]> => {
77
return axios.get(`/data/v2/freecodecamp/${tag}.json`)
88
}
99

@@ -16,7 +16,7 @@ type UseGetArticlesOptions = {
1616

1717
export const useGetArticles = ({ config, tags }: UseGetArticlesOptions) => {
1818
return useQueries({
19-
queries: tags.map<UseQueryOptions<ArticleType[]>>((tag) => {
19+
queries: tags.map<UseQueryOptions<Article[]>>((tag) => {
2020
return {
2121
...config,
2222
queryKey: ['freecodecampArticles', tag],

src/features/freecodecampCard/components/FreecodecampCard.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useState, useEffect } from 'react'
22
import { Card } from 'src/components/Elements/Card'
33
import { ListComponent } from 'src/components/List'
44
import { useGetArticles } from '../api/getArticles'
5-
import { ArticleType, CardPropsType } from 'src/types'
5+
import { Article, CardPropsType } from 'src/types'
66
import { useUserPreferences } from 'src/stores/preferences'
77
import { getCardTagsValue } from 'src/utils/DataEnhancement'
88
import ArticleItem from './ArticleItem'
@@ -40,14 +40,14 @@ export function FreecodecampCard({ meta, withAds }: CardPropsType) {
4040

4141
const getData = () => {
4242
return results
43-
.reduce((acc: ArticleType[], curr) => {
43+
.reduce((acc: Article[], curr) => {
4444
if (!curr.data) return acc
4545
return [...acc, ...curr.data]
4646
}, [])
4747
.sort((a, b) => b.reactions - a.reactions)
4848
}
4949

50-
const renderItem = (item: ArticleType, index: number) => (
50+
const renderItem = (item: Article, index: number) => (
5151
<ArticleItem
5252
item={item}
5353
key={`fcc-${index}`}

src/features/githubCard/api/getRepos.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { useQueries, UseQueryOptions } from '@tanstack/react-query'
22
import { QueryConfig, ExtractFnReturnType } from 'src/lib/react-query'
3-
import { RepoType } from 'src/types'
3+
import { Repository } from 'src/types'
44
import { axios } from 'src/lib/axios'
55

6-
const getRepos = async (tag: string, dateRange: string): Promise<RepoType[]> => {
6+
const getRepos = async (tag: string, dateRange: string): Promise<Repository[]> => {
77
return axios.get(`/data/v2/github/${tag}/${dateRange}.json?s`)
88
}
99

@@ -17,7 +17,7 @@ type UseGetReposOptions = {
1717

1818
export const useGetRepos = ({ config, tags, dateRange }: UseGetReposOptions) => {
1919
return useQueries({
20-
queries: tags.map<UseQueryOptions<RepoType[]>>((tag) => {
20+
queries: tags.map<UseQueryOptions<Repository[]>>((tag) => {
2121
return {
2222
...config,
2323
queryKey: ['githubArticles', tag, dateRange],

src/features/githubCard/components/GithubCard.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useState, useEffect } from 'react'
22
import { Card } from 'src/components/Elements/Card'
33
import { ListComponent } from 'src/components/List'
44
import { useGetRepos } from '../api/getRepos'
5-
import { RepoType, CardPropsType } from 'src/types'
5+
import { Repository, CardPropsType } from 'src/types'
66
import { useUserPreferences } from 'src/stores/preferences'
77
import { getCardTagsValue } from 'src/utils/DataEnhancement'
88
import RepoItem from './RepoItem'
@@ -67,14 +67,14 @@ export function GithubCard({ meta, withAds }: CardPropsType) {
6767

6868
const getData = () => {
6969
return results
70-
.reduce((acc: RepoType[], curr) => {
70+
.reduce((acc: Repository[], curr) => {
7171
if (!curr.data) return acc
7272
return [...acc, ...curr.data]
7373
}, [])
7474
.sort((a, b) => b.stars - a.stars)
7575
}
7676

77-
const renderItem = (item: RepoType, index: number) => (
77+
const renderItem = (item: Repository, index: number) => (
7878
<RepoItem
7979
item={item}
8080
key={`rp-${index}`}

src/features/hackernewsCard/api/getArticles.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { useQuery } from '@tanstack/react-query'
22
import { ExtractFnReturnType, QueryConfig } from 'src/lib/react-query'
3-
import { ArticleType } from 'src/types'
3+
import { Article } from 'src/types'
44
import { axios } from 'src/lib/axios'
55

6-
const getArticles = async (): Promise<ArticleType[]> => {
6+
const getArticles = async (): Promise<Article[]> => {
77
return axios.get('/data/v2/hackernews.json')
88
}
99

src/features/hackernewsCard/components/HackernewsCard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ import { Card } from 'src/components/Elements/Card'
22
import { ListComponent } from 'src/components/List'
33
import { useUserPreferences } from 'src/stores/preferences'
44
import { useGetArticles } from '../api/getArticles'
5-
import { ArticleType, CardPropsType } from 'src/types'
5+
import { Article, CardPropsType } from 'src/types'
66
import ArticleItem from './ArticleItem'
77

88
export function HackernewsCard({ meta, withAds }: CardPropsType) {
99
const { data: articles = [], isLoading, error } = useGetArticles()
1010
const { listingMode } = useUserPreferences()
1111

12-
const renderItem = (item: ArticleType, index: number) => (
12+
const renderItem = (item: Article, index: number) => (
1313
<ArticleItem item={item} key={`hn-${index}`} index={index} listingMode={listingMode} />
1414
)
1515

0 commit comments

Comments
 (0)