diff --git a/prisma/migrations/20220918123547_add_project_makers_table/migration.sql b/prisma/migrations/20220918123547_add_project_makers_table/migration.sql new file mode 100644 index 0000000..42fc30a --- /dev/null +++ b/prisma/migrations/20220918123547_add_project_makers_table/migration.sql @@ -0,0 +1,14 @@ +-- CreateTable +CREATE TABLE "ProjectMember" ( + "projectId" INTEGER NOT NULL, + "userId" INTEGER NOT NULL, + "level" TEXT NOT NULL, + + CONSTRAINT "ProjectMember_pkey" PRIMARY KEY ("projectId","userId") +); + +-- AddForeignKey +ALTER TABLE "ProjectMember" ADD CONSTRAINT "ProjectMember_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "ProjectMember" ADD CONSTRAINT "ProjectMember_projectId_fkey" FOREIGN KEY ("projectId") REFERENCES "Project"("id") ON DELETE RESTRICT ON UPDATE CASCADE; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 1808c83..a0be888 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -70,6 +70,7 @@ model User { userKeys UserKey[] skills Skill[] roles UsersOnWorkRoles[] + projects ProjectMember[] tournaments TournamentParticipant[] } @@ -157,6 +158,7 @@ model Project { tags Tag[] capabilities Capability[] + members ProjectMember[] recruit_roles ProjectRecruitRoles[] tournaments TournamentProject[] } @@ -172,6 +174,17 @@ model ProjectRecruitRoles { @@id([projectId, roleId]) } +model ProjectMember { + project Project @relation(fields: [projectId], references: [id]) + projectId Int + user User @relation(fields: [userId], references: [id]) + userId Int + + level String // Admin | Maker | (new_roles_later) + + @@id([projectId, userId]) +} + model Award { id Int @id @default(autoincrement()) title String diff --git a/src/App.tsx b/src/App.tsx index d2b29e2..7de6cf1 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -93,7 +93,7 @@ function App() { }> - } /> + } /> }> } /> @@ -101,8 +101,9 @@ function App() { } /> } /> - } /> + } /> } /> + } /> } /> @@ -116,7 +117,7 @@ function App() { } /> } /> - } /> + } /> diff --git a/src/Components/Navbar/NavDesktop.tsx b/src/Components/Navbar/NavDesktop.tsx index 3088142..d752197 100644 --- a/src/Components/Navbar/NavDesktop.tsx +++ b/src/Components/Navbar/NavDesktop.tsx @@ -14,7 +14,7 @@ import { import '@szhsin/react-menu/dist/index.css'; import { FiChevronDown } from "react-icons/fi"; import Avatar from "src/features/Profiles/Components/Avatar/Avatar"; -import { createRoute } from "src/utils/routing"; +import { createRoute, PAGES_ROUTES } from "src/utils/routing"; import Button from "../Button/Button"; @@ -64,10 +64,10 @@ export default function NavDesktop() { menuStyle={{ border: '1px solid' }} > { e.syntheticEvent.preventDefault(); - navigate("/blog"); + navigate(PAGES_ROUTES.blog.feed); }} className='!p-16 font-medium flex gap-16 hover:bg-gray-100 !rounded-12 ' > diff --git a/src/Components/Navbar/NavMobile.tsx b/src/Components/Navbar/NavMobile.tsx index 15a214a..58564bd 100644 --- a/src/Components/Navbar/NavMobile.tsx +++ b/src/Components/Navbar/NavMobile.tsx @@ -14,7 +14,7 @@ import styles from './styles.module.css' import '@szhsin/react-menu/dist/index.css'; import { Menu, MenuButton, MenuItem } from "@szhsin/react-menu"; import Avatar from "src/features/Profiles/Components/Avatar/Avatar"; -import { createRoute } from "src/utils/routing"; +import { createRoute, PAGES_ROUTES } from "src/utils/routing"; const navBtnVariant = { menuHide: { rotate: 90, opacity: 0 }, @@ -186,7 +186,7 @@ export default function NavMobile() { >
toggleDrawerOpen(false)} className='font-medium flex gap-16 !rounded-12 ' > diff --git a/src/features/Hackathons/pages/HackathonsPage/HackathonsPage.tsx b/src/features/Hackathons/pages/HackathonsPage/HackathonsPage.tsx index a69618f..2198817 100644 --- a/src/features/Hackathons/pages/HackathonsPage/HackathonsPage.tsx +++ b/src/features/Hackathons/pages/HackathonsPage/HackathonsPage.tsx @@ -37,7 +37,7 @@ export default function HackathonsPage() {
diff --git a/src/features/Posts/Components/PostCard/StoryCard/StoryCard.tsx b/src/features/Posts/Components/PostCard/StoryCard/StoryCard.tsx index 286a316..d31164c 100644 --- a/src/features/Posts/Components/PostCard/StoryCard/StoryCard.tsx +++ b/src/features/Posts/Components/PostCard/StoryCard/StoryCard.tsx @@ -39,7 +39,7 @@ export default function StoryCard({ story }: Props) { {story.cover_image && }
- +

{story.title}

{story.excerpt}...

diff --git a/src/features/Posts/pages/CreatePostPage/CreatePostPage.tsx b/src/features/Posts/pages/CreatePostPage/CreatePostPage.tsx index 64eb671..6dc6379 100644 --- a/src/features/Posts/pages/CreatePostPage/CreatePostPage.tsx +++ b/src/features/Posts/pages/CreatePostPage/CreatePostPage.tsx @@ -2,16 +2,17 @@ import { useState } from "react"; import { Helmet } from "react-helmet"; import { FiArrowLeft } from "react-icons/fi"; import { useNavigate, useParams } from "react-router-dom"; -import BountyForm from "./Components/BountyForm/BountyForm"; -import QuestionForm from "./Components/QuestionForm/QuestionForm"; +// import BountyForm from "./Components/BountyForm/BountyForm"; +// import QuestionForm from "./Components/QuestionForm/QuestionForm"; import CreateStoryPage from "./CreateStoryPage/CreateStoryPage"; +interface Props { + initType: 'story' | 'bounty' | 'question' +} -export default function CreatePostPage() { +export default function CreatePostPage(props: Props) { - const { type } = useParams() - - const [postType] = useState<'story' | 'bounty' | 'question'>((type as any) ?? 'story'); + const [postType] = useState<'story' | 'bounty' | 'question'>(props.initType); const navigate = useNavigate(); @@ -44,7 +45,7 @@ export default function CreatePostPage() { */} } - {postType === 'bounty' && <> + {/* {postType === 'bounty' && <>

Write a Bounty

@@ -55,7 +56,7 @@ export default function CreatePostPage() { Write a Question - } + } */}
diff --git a/src/features/Posts/pages/FeedPage/FeedPage.tsx b/src/features/Posts/pages/FeedPage/FeedPage.tsx index bb3eb84..45c15ba 100644 --- a/src/features/Posts/pages/FeedPage/FeedPage.tsx +++ b/src/features/Posts/pages/FeedPage/FeedPage.tsx @@ -14,6 +14,7 @@ import { FaDiscord } from 'react-icons/fa' import { FiArrowRight } from 'react-icons/fi' import { capitalize } from 'src/utils/helperFunctions' import { bannerData } from 'src/features/Projects/pages/ExplorePage/Header/Header' +import { PAGES_ROUTES } from 'src/utils/routing' export default function FeedPage() { @@ -46,6 +47,21 @@ export default function FeedPage() {
+
+ +
+
+ {bannerData.title} +
+ + +
{tagFilter &&

@@ -76,7 +92,7 @@ export default function FeedPage() {