-
Notifications
You must be signed in to change notification settings - Fork 0
Server-Side Rendering #76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
ac8cf91
feat: добавление компонента ClubInfo и рефакторинг ClubHeader для улу…
kostya-zero f8855be
feat: обновление логики получения ID из токена и рефакторинг вызова A…
kostya-zero 372b69b
feat(ClubCard): не использовать useRouter и сделать серверным компоне…
kostya-zero 6d4c813
feat(About): оптимизация страницы о приложении
kostya-zero 11fcb43
feat(Appearance): оптимизация
kostya-zero 52a2c74
Merge remote-tracking branch 'origin/main' into feature/ssr
kostya-zero 09c56b0
chore(routes): добавил необходимый путь
kostya-zero 3d954f7
refactor(PostReportDialog): убрал ненужные импорты
kostya-zero 3f87b5e
refactor(Comments): оптимизация стилей
kostya-zero 333d3c6
feat: SSR для профиля
kostya-zero 571cc2a
feat: SSR для событий
kostya-zero a5d0063
chore: реструктуризация проекта
kostya-zero fec2fc4
feat(css): убрал подгрузку шрифтов с Google Fonts
kostya-zero 416f6b0
chore(gitignore): добавил bun.lock в .gitignore
kostya-zero 2556d4a
chore: реструктуризация проекта
kostya-zero 21ac182
feat: новый стиль страницы 404
kostya-zero 6703a22
fix(club): вернул SSR для ClubReportDialogDynamic
kostya-zero 5db3b63
Update Club.tsx
kostya-zero 20404c4
feat: загрузка ClubReportDialog без dynamic
kostya-zero db28cad
Merge remote-tracking branch 'origin/main' into feature/ssr
kostya-zero 055af49
chore(loading): убрал анимацию при загрузке страницы
kostya-zero 946444b
chore(ssr): убрал force-dynamic
kostya-zero File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,5 +43,6 @@ yarn-error.log* | |
| next-env.d.ts | ||
| certificates | ||
| certbot | ||
| bun.lock | ||
|
|
||
| /.idea | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,84 +1,84 @@ | ||
| { | ||
| "name": "setka-frontend", | ||
| "version": "0.1.0", | ||
| "private": true, | ||
| "scripts": { | ||
| "dev": "next dev --turbopack --experimental-https", | ||
| "build": "next build", | ||
| "start": "next start", | ||
| "api:code-gen": "openapi-generator-cli generate --generator-key api && openapi-generator-cli generate --generator-key admin-api", | ||
| "api-dev:code-gen": "openapi-generator-cli generate --generator-key api-dev", | ||
| "lint": "next lint" | ||
| }, | ||
| "dependencies": { | ||
| "@editorjs/editorjs": "^2.30.8", | ||
| "@editorjs/paragraph": "^2.11.7", | ||
| "@editorjs/underline": "^1.2.1", | ||
| "@hookform/resolvers": "^5.2.1", | ||
| "@radix-ui/react-checkbox": "^1.3.3", | ||
| "@radix-ui/react-dialog": "^1.1.15", | ||
| "@radix-ui/react-dropdown-menu": "^2.1.16", | ||
| "@radix-ui/react-popover": "^1.1.15", | ||
| "@radix-ui/react-select": "^2.2.6", | ||
| "@radix-ui/react-slot": "^1.2.3", | ||
| "@tailwindcss/postcss": "^4.1.12", | ||
| "@tanstack/react-query": "^5.85.5", | ||
| "@uidotdev/usehooks": "^2.4.1", | ||
| "axios": "^1.11.0", | ||
| "class-variance-authority": "^0.7.1", | ||
| "clsx": "^2.1.1", | ||
| "date-fns": "^4.1.0", | ||
| "framer-motion": "^12.23.12", | ||
| "jose": "^6.0.13", | ||
| "js-cookie": "^3.0.5", | ||
| "lucide-react": "^0.542.0", | ||
| "next": "15.5.2", | ||
| "next-themes": "^0.4.6", | ||
| "path-to-regexp": "^8.2.0", | ||
| "prettier-plugin-tailwindcss": "^0.6.14", | ||
| "react": "^19.1.1", | ||
| "react-click-away-listener": "^2.4.0", | ||
| "react-day-picker": "9.9.0", | ||
| "react-dom": "^19.1.1", | ||
| "react-hook-form": "^7.62.0", | ||
| "react-hot-toast": "^2.6.0", | ||
| "react-icons": "^5.5.0", | ||
| "react-intersection-observer": "^9.16.0", | ||
| "react-mobile-cropper": "^0.10.0", | ||
| "swiper": "^11.2.10", | ||
| "tailwind-merge": "^3.3.1", | ||
| "tw-animate-css": "^1.3.7", | ||
| "use-debounce": "^10.0.5", | ||
| "vaul": "^1.1.2", | ||
| "zod": "^4.1.3", | ||
| "zustand": "^5.0.8" | ||
| }, | ||
| "devDependencies": { | ||
| "@eslint/eslintrc": "^3.3.1", | ||
| "@next/eslint-plugin-next": "^15.5.2", | ||
| "@openapitools/openapi-generator-cli": "^2.23.1", | ||
| "@tanstack/eslint-plugin-query": "^5.83.1", | ||
| "@trivago/prettier-plugin-sort-imports": "^5.2.2", | ||
| "@types/js-cookie": "^3.0.6", | ||
| "@types/node": "^24.3.0", | ||
| "@types/react": "^19.1.11", | ||
| "@types/react-dom": "^19.1.8", | ||
| "eslint": "^9.34.0", | ||
| "eslint-config-next": "15.5.2", | ||
| "eslint-plugin-react": "^7.37.5", | ||
| "eslint-plugin-react-hooks": "^5.2.0", | ||
| "postcss": "^8.5.6", | ||
| "prettier": "^3.6.2", | ||
| "sass": "^1.91.0", | ||
| "tailwindcss": "^4.1.12", | ||
| "typescript": "5.9.2" | ||
| }, | ||
| "packageManager": "pnpm@10.13.1+sha512.37ebf1a5c7a30d5fabe0c5df44ee8da4c965ca0c5af3dbab28c3a1681b70a256218d05c81c9c0dcf767ef6b8551eb5b960042b9ed4300c59242336377e01cfad", | ||
| "trustedDependencies": [ | ||
| "@nestjs/core", | ||
| "@openapitools/openapi-generator-cli", | ||
| "@parcel/watcher", | ||
| "@tailwindcss/oxide", | ||
| "unrs-resolver" | ||
| ] | ||
| "name": "setka-frontend", | ||
| "version": "0.1.0", | ||
| "private": true, | ||
| "scripts": { | ||
| "dev": "next dev --turbopack --experimental-https", | ||
| "build": "next build", | ||
| "start": "next start", | ||
| "api:code-gen": "openapi-generator-cli generate --generator-key api && openapi-generator-cli generate --generator-key admin-api", | ||
| "api-dev:code-gen": "openapi-generator-cli generate --generator-key api-dev", | ||
| "lint": "next lint" | ||
| }, | ||
| "dependencies": { | ||
| "@editorjs/editorjs": "^2.30.8", | ||
| "@editorjs/paragraph": "^2.11.7", | ||
| "@editorjs/underline": "^1.2.1", | ||
| "@hookform/resolvers": "^5.2.1", | ||
| "@radix-ui/react-checkbox": "^1.3.3", | ||
| "@radix-ui/react-dialog": "^1.1.15", | ||
| "@radix-ui/react-dropdown-menu": "^2.1.16", | ||
| "@radix-ui/react-popover": "^1.1.15", | ||
| "@radix-ui/react-select": "^2.2.6", | ||
| "@radix-ui/react-slot": "^1.2.3", | ||
| "@tailwindcss/postcss": "^4.1.12", | ||
| "@tanstack/react-query": "^5.85.5", | ||
| "@uidotdev/usehooks": "^2.4.1", | ||
| "axios": "^1.11.0", | ||
| "class-variance-authority": "^0.7.1", | ||
| "clsx": "^2.1.1", | ||
| "date-fns": "^4.1.0", | ||
| "framer-motion": "^12.23.12", | ||
| "jose": "^6.0.13", | ||
| "js-cookie": "^3.0.5", | ||
| "lucide-react": "^0.542.0", | ||
| "next": "15.5.2", | ||
| "next-themes": "^0.4.6", | ||
| "path-to-regexp": "^8.2.0", | ||
| "react": "^19.1.1", | ||
| "react-click-away-listener": "^2.4.0", | ||
| "react-day-picker": "9.9.0", | ||
| "react-dom": "^19.1.1", | ||
| "react-hook-form": "^7.62.0", | ||
| "react-hot-toast": "^2.6.0", | ||
| "react-icons": "^5.5.0", | ||
| "react-intersection-observer": "^9.16.0", | ||
| "react-mobile-cropper": "^0.10.0", | ||
| "swiper": "^11.2.10", | ||
| "tailwind-merge": "^3.3.1", | ||
| "tw-animate-css": "^1.3.7", | ||
| "use-debounce": "^10.0.5", | ||
| "vaul": "^1.1.2", | ||
| "zod": "^4.1.3", | ||
| "zustand": "^5.0.8" | ||
| }, | ||
| "devDependencies": { | ||
| "@eslint/eslintrc": "^3.3.1", | ||
| "@next/eslint-plugin-next": "^15.5.2", | ||
| "@openapitools/openapi-generator-cli": "^2.23.1", | ||
| "@tanstack/eslint-plugin-query": "^5.83.1", | ||
| "@trivago/prettier-plugin-sort-imports": "^5.2.2", | ||
| "prettier-plugin-tailwindcss": "^0.6.14", | ||
| "@types/js-cookie": "^3.0.6", | ||
| "@types/node": "^24.3.0", | ||
| "@types/react": "^19.1.11", | ||
| "@types/react-dom": "^19.1.8", | ||
| "eslint": "^9.34.0", | ||
| "eslint-config-next": "15.5.2", | ||
| "eslint-plugin-react": "^7.37.5", | ||
| "eslint-plugin-react-hooks": "^5.2.0", | ||
| "postcss": "^8.5.6", | ||
| "prettier": "^3.6.2", | ||
| "sass": "^1.91.0", | ||
| "tailwindcss": "^4.1.12", | ||
| "typescript": "5.9.2" | ||
| }, | ||
| "packageManager": "pnpm@10.13.1+sha512.37ebf1a5c7a30d5fabe0c5df44ee8da4c965ca0c5af3dbab28c3a1681b70a256218d05c81c9c0dcf767ef6b8551eb5b960042b9ed4300c59242336377e01cfad", | ||
| "trustedDependencies": [ | ||
| "@nestjs/core", | ||
| "@openapitools/openapi-generator-cli", | ||
| "@parcel/watcher", | ||
| "@tailwindcss/oxide", | ||
| "unrs-resolver" | ||
| ] | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| 'use client'; | ||
|
|
||
| import dynamic from 'next/dynamic'; | ||
|
|
||
| import Loader from '@/components/Loader'; | ||
| import { Skeleton } from '@/components/ui/skeleton'; | ||
|
|
||
| import { useInfinityScroll } from '@/hooks/useInfinityScroll'; | ||
|
|
||
| import { feedApi } from '@/api/api'; | ||
|
|
||
| const PostCardDynamic = dynamic(() => import('@/components/PostCard/PostCard').then((mod) => mod.PostCard), { | ||
| loading: () => <Skeleton className="my-2 h-[400px]" />, | ||
| ssr: false, | ||
| }); | ||
|
|
||
| export default function HomeFeed() { | ||
| const { | ||
| ref, | ||
| infiniteQuery: { data, isLoading, isFetchingNextPage, hasNextPage, error }, | ||
| } = useInfinityScroll({ | ||
| queryKey: ['fetch-feed-posts'], | ||
| queryFn: async ({ pageParam = 0 }) => (await feedApi.feedGetFeedPosts(pageParam, 10)).data, | ||
| pageSize: 10, | ||
| }); | ||
|
|
||
| return ( | ||
| <div className="flex flex-col"> | ||
| {data && data.pages.flatMap((page) => page).map((post) => <PostCardDynamic key={post.id} post={post} />)} | ||
| {(isFetchingNextPage || isLoading) && <Loader className="mx-auto mt-10" />} | ||
| {!hasNextPage && !isLoading && ( | ||
| <p className="p-4 pb-5 text-center text-neutral-500">Ваша лента закончилась</p> | ||
| )} | ||
| {error && ( | ||
| <p className="text-center text-neutral-500"> | ||
| Не удалось выполнить загрузку постов. Пожалуйста, повторите позже. | ||
| </p> | ||
| )} | ||
| <div ref={ref}></div> | ||
| </div> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,20 @@ | ||
| 'use client'; | ||
|
|
||
| import dynamic from 'next/dynamic'; | ||
|
|
||
| import { ClubFeed } from '@/components/ClubComponents/ClubFeed'; | ||
| import { ClubHeader } from '@/components/ClubComponents/ClubHeader'; | ||
| import ClubInfo from '@/components/ClubComponents/ClubInfo'; | ||
| import ClubReportDialog from '@/components/ClubComponents/ClubReportDialog'; | ||
| import { Page } from '@/components/Page'; | ||
|
|
||
| import type { ClubDetailDTO } from '@/api/axios-client/models/club-detail-dto'; | ||
|
|
||
| const ClubReportDialogDynamic = dynamic(() => import('@/components/ClubComponents/ClubReportDialog'), { | ||
| ssr: false, | ||
| }); | ||
|
|
||
| export function Club({ club }: { club: ClubDetailDTO }) { | ||
| return ( | ||
| <div> | ||
| <ClubHeader initClubData={club} /> | ||
| <ClubHeader club={club} /> | ||
| <ClubInfo club={club} /> | ||
| <Page className="p-0"> | ||
| <ClubFeed /> | ||
| </Page> | ||
| <ClubReportDialogDynamic /> | ||
| <ClubReportDialog /> | ||
| </div> | ||
| ); | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.