Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yo
Browse files Browse the repository at this point in the history
goat-kj committed Sep 7, 2023
1 parent 8939038 commit e301987
Showing 12 changed files with 16,740 additions and 19,935 deletions.
5,380 changes: 3,315 additions & 2,065 deletions apps/campus/pnpm-lock.yaml

Large diffs are not rendered by default.

2,011 changes: 1,094 additions & 917 deletions apps/career/pnpm-lock.yaml

Large diffs are not rendered by default.

4,212 changes: 1,501 additions & 2,711 deletions apps/feeds/pnpm-lock.yaml

Large diffs are not rendered by default.

5,301 changes: 2,912 additions & 2,389 deletions apps/forum/pnpm-lock.yaml

Large diffs are not rendered by default.

Empty file.
12 changes: 9 additions & 3 deletions apps/forum/src/components/Home.tsx
Original file line number Diff line number Diff line change
@@ -64,19 +64,25 @@ const Home = () => {
}, []);

useEffect(() => {
console.log("filter Threads has updated:", filteredThreads);
// console.log("filter Threads has updated:", filteredThreads);
}, [filteredThreads]);

useEffect(() => {
var filteredThreads = filterThreadsByTags(allThreads, currentTags);
filteredThreads = filterThreadsByGroups(filteredThreads, currentGroups);
if (filteredThreads.length > threadCountPerPage * page)
filteredThreads = filteredThreads.slice(0, threadCountPerPage * page);
if (filteredThreads.length > threadCountPerPage * page)
filteredThreads = filteredThreads.slice(0, threadCountPerPage * page);
setFilteredThreads(filteredThreads);
displayMoreThread();
}, [currentTags, currentGroups]);


// 1 when you first enter) fetch posts (useEffect) -> display posts
// 2 filtering by "groups" -> state that manages groups ("") -> group is selected then setGroup(selected group)
// 3) [posts, setPosts] = useState([]) -> entering the page: setState([post1, post2..... post9])
// 4) displayMore is triggered [...post9] + [additional 10 posts] = [20 posts]


const displayMoreThread = () => {
console.log("displayMoreThread called"); // Debugging
setTimeout(() => {
1 change: 1 addition & 0 deletions apps/forum/src/utils/filter.ts
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ export const filterThreadsByTags = (threads: Thread[], tags: string[]) =>
: threads;

export const filterThreadsByGroups = (threads: Thread[], groups: string[]) =>

groups.length > 0
? threads.filter((thread) => groups.includes(thread.group_id))
: threads;
6,026 changes: 3,275 additions & 2,751 deletions apps/root/pnpm-lock.yaml

Large diffs are not rendered by default.

6,791 changes: 1,837 additions & 4,954 deletions apps/syllabus/pnpm-lock.yaml

Large diffs are not rendered by default.

966 changes: 487 additions & 479 deletions packages/eslint-config-custom/pnpm-lock.yaml

Large diffs are not rendered by default.

5,923 changes: 2,284 additions & 3,639 deletions packages/ui/pnpm-lock.yaml

Large diffs are not rendered by default.

52 changes: 25 additions & 27 deletions pnpm-lock.yaml

0 comments on commit e301987

Please sign in to comment.