Skip to content

Commit 89fa902

Browse files
committed
improve the cards feature folder structure
1 parent 596509f commit 89fa902

58 files changed

Lines changed: 88 additions & 85 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/config/index.tsx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,19 @@ import HashNodeIcon from 'src/assets/icon_hashnode.png'
99
import LobstersIcon from 'src/assets/icon_lobsters.png'
1010
import { FaFreeCodeCamp } from 'react-icons/fa'
1111
import { CgIndieHackers } from 'react-icons/cg'
12-
import { HackernewsCard } from 'src/features/hackernewsCard'
13-
import { ProductHuntCard } from 'src/features/producthuntCard'
14-
import { IndiehackersCard } from 'src/features/indiehackersCard'
15-
import { RedditCard } from 'src/features/redditCard'
16-
import { LobstersCard } from 'src/features/lobstersCard'
17-
import { DevtoCard } from 'src/features/devtoCard'
18-
import { HashnodeCard } from 'src/features/hashnodeCard'
19-
import { MediumCard } from 'src/features/mediumCard'
20-
import { FreecodecampCard } from 'src/features/freecodecampCard'
21-
import { GithubCard } from 'src/features/githubCard'
22-
import { ConferencesCard } from 'src/features/conferencesCard'
12+
import {
13+
HackernewsCard,
14+
ProductHuntCard,
15+
IndiehackersCard,
16+
FreecodecampCard,
17+
ConferencesCard,
18+
GithubCard,
19+
MediumCard,
20+
HashnodeCard,
21+
LobstersCard,
22+
DevtoCard,
23+
RedditCard,
24+
} from 'src/features/cards'
2325
import { CardPropsType } from 'src/types'
2426

2527
// Keys
File renamed without changes.

src/features/devtoCard/api/getArticles.ts renamed to src/features/cards/api/getDevtoArticles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ type UseGetArticlesOptions = {
1414
tags: string[]
1515
}
1616

17-
export const useGetArticles = ({ config, tags }: UseGetArticlesOptions) => {
17+
export const useGetDevtoArticles = ({ config, tags }: UseGetArticlesOptions) => {
1818
return useQueries({
1919
queries: tags.map<UseQueryOptions<Article[]>>((tag) => {
2020
return {

src/features/freecodecampCard/api/getArticles.ts renamed to src/features/cards/api/getFreeCodeCampArticles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ type UseGetArticlesOptions = {
1414
tags: string[]
1515
}
1616

17-
export const useGetArticles = ({ config, tags }: UseGetArticlesOptions) => {
17+
export const useGetFreeCodeCampArticles = ({ config, tags }: UseGetArticlesOptions) => {
1818
return useQueries({
1919
queries: tags.map<UseQueryOptions<Article[]>>((tag) => {
2020
return {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type UseGetReposOptions = {
1515
dateRange: "daily" | "monthly" | "weekly"
1616
}
1717

18-
export const useGetRepos = ({ config, tags, dateRange }: UseGetReposOptions) => {
18+
export const useGetGithubRepos = ({ config, tags, dateRange }: UseGetReposOptions) => {
1919
return useQueries({
2020
queries: tags.map<UseQueryOptions<Repository[]>>((tag) => {
2121
return {

src/features/hackernewsCard/api/getArticles.ts renamed to src/features/cards/api/getHackerNewsArticles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ type UseGetArticlesOptions = {
1313
config?: QueryConfig<QueryFnType>
1414
}
1515

16-
export const useGetArticles = ({ config }: UseGetArticlesOptions = {}) => {
16+
export const useGetHackertNewsArticles = ({ config }: UseGetArticlesOptions = {}) => {
1717
return useQuery<ExtractFnReturnType<QueryFnType>>({
1818
...config,
1919
queryKey: ['hackernews'],

src/features/hashnodeCard/api/getArticles.ts renamed to src/features/cards/api/getHashnodeArticles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ type UseGetArticlesOptions = {
1414
tags: string[]
1515
}
1616

17-
export const useGetArticles = ({ config, tags }: UseGetArticlesOptions) => {
17+
export const useGetHashnodeArticles = ({ config, tags }: UseGetArticlesOptions) => {
1818
return useQueries({
1919
queries: tags.map<UseQueryOptions<Article[]>>((tag) => {
2020
return {

src/features/indiehackersCard/api/getArticles.ts renamed to src/features/cards/api/getIndieHackersArticles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ type UseGetArticlesOptions = {
1313
config?: QueryConfig<QueryFnType>
1414
}
1515

16-
export const useGetArticles = ({ config }: UseGetArticlesOptions = {}) => {
16+
export const useGetIndieHackersArticles = ({ config }: UseGetArticlesOptions = {}) => {
1717
return useQuery<ExtractFnReturnType<QueryFnType>>({
1818
...config,
1919
queryKey: ['indiehackers'],

src/features/lobstersCard/api/getArticles.ts renamed to src/features/cards/api/getLobstersArticles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ type UseGetArticlesOptions = {
1313
config?: QueryConfig<QueryFnType>
1414
}
1515

16-
export const useGetArticles = ({ config }: UseGetArticlesOptions = {}) => {
16+
export const useGetLobstersArticles = ({ config }: UseGetArticlesOptions = {}) => {
1717
return useQuery<ExtractFnReturnType<QueryFnType>>({
1818
...config,
1919
queryKey: ['lobsters'],

src/features/mediumCard/api/getArticles.ts renamed to src/features/cards/api/getMediumArticles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ type UseGetArticlesOptions = {
1414
tags: string[]
1515
}
1616

17-
export const useGetArticles = ({ config, tags }: UseGetArticlesOptions) => {
17+
export const useGetMediumArticles = ({ config, tags }: UseGetArticlesOptions) => {
1818
return useQueries({
1919
queries: tags.map<UseQueryOptions<Article[]>>((tag) => {
2020
return {

0 commit comments

Comments
 (0)