Commit 3482c59
authored
Modernize Next.js code (#89)
* Cleanup: Remove old code replaced by repository pattern
Removed:
- context/SearchProvider.tsx (replaced by ToolsProvider)
- components/tools/queries/ (React Query hooks no longer needed)
- components/tools/listPage/ListPageComponent/ (replaced by StaticListPageComponent)
- components/homepage/queries/ (homepage uses repository pattern)
- components/blog/queries/ (blog uses direct file access)
- components/tools/listPage/ToolsSidebar/FilterCard/utils.ts (inlined in components)
API Routes Removed:
- pages/api/tools.ts
- pages/api/paginated-tools.ts
- pages/api/tags/[type].ts
- pages/api/tool/[toolId].ts
- pages/api/mostViewed.ts
- pages/api/popularLanguages.ts
Utils-api Removed:
- cache.ts (no longer using file cache)
- filters.ts (filtering in ToolsFilter class)
- tools.ts (replaced by ToolsRepository)
- toolsWithVotes.ts (replaced by ToolsRepository.withVotes)
- tags.ts (replaced by TagsRepository)
- mostViewedTools.ts (replaced by StatsRepository)
- popularLanguageStats.ts (replaced by StatsRepository)
- toolStats.ts (replaced by StatsRepository)
- stars.ts (not used)
- github.ts (not used)
- urls.ts (not used)
Updated:
- blog.ts: Removed cache dependency, use direct file access
- screenshot.ts: Removed cache dependency, use in-memory cache
- query.ts: Removed SearchProvider types, proper TypeScript
- pages/languages/index.tsx: Use StatsRepository
- pages/tag/[slug].tsx: Remove SearchProvider wrapper
- pages/tool/[slug].tsx: Remove SearchProvider wrapper
* Refactor AffiliateCard links to use Link component directly
* Update Next.js patterns
Remove passHref from Link components and add filter types
- Remove unnecessary passHref prop from all Link components
- Add FilterKey, FiltersState, and OnFilterChange types for tag filters
- Refactor filter state and callbacks in tag page and sidebar to use new
types1 parent 88b7a8f commit 3482c59
15 files changed
Lines changed: 54 additions & 51 deletions
File tree
- components
- core
- elements/AutocompleteSearch
- sponsors/SponsorCard
- tags
- TagsSidebar
- FilterCard
- tools/listPage/ToolCard
- widgets
- LanguageTopToolsWidget
- TagWidget
- ToolsListWidget/ToolsListEntry
- TopToolsListWidget
- pages/tag
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | 62 | | |
64 | 63 | | |
65 | 64 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | | - | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | | - | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
Lines changed: 1 addition & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
| 51 | + | |
55 | 52 | | |
56 | 53 | | |
57 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | | - | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
| 52 | + | |
56 | 53 | | |
57 | 54 | | |
58 | 55 | | |
59 | 56 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
| 57 | + | |
64 | 58 | | |
65 | 59 | | |
66 | 60 | | |
| |||
0 commit comments