diff --git a/src/features/Projects/pages/ProjectPage/ProjectDetailsCard/ProjectDetailsCard.tsx b/src/features/Projects/pages/ProjectPage/ProjectDetailsCard/ProjectDetailsCard.tsx
index cc5e5a0..5e14a66 100644
--- a/src/features/Projects/pages/ProjectPage/ProjectDetailsCard/ProjectDetailsCard.tsx
+++ b/src/features/Projects/pages/ProjectPage/ProjectDetailsCard/ProjectDetailsCard.tsx
@@ -1,5 +1,5 @@
import { useEffect, useState } from 'react'
-import { MdClose, MdLocalFireDepartment } from 'react-icons/md';
+import { MdClose, MdEdit, MdLocalFireDepartment } from 'react-icons/md';
import { ModalCard } from 'src/Components/Modals/ModalsContainer/ModalsContainer';
import { useAppDispatch, useAppSelector, useMediaQuery } from 'src/utils/hooks';
import { openModal, scheduleModal } from 'src/redux/features/modals.slice';
@@ -8,7 +8,7 @@ import Button from 'src/Components/Button/Button';
import ProjectCardSkeleton from './ProjectDetailsCard.Skeleton'
// import VoteButton from 'src/features/Projects/pages/ProjectPage/VoteButton/VoteButton';
import { NotificationsService, Wallet_Service } from 'src/services'
-import { useProjectDetailsQuery } from 'src/graphql';
+import { ProjectPermissionEnum, useProjectDetailsQuery } from 'src/graphql';
import Lightbox from 'src/Components/Lightbox/Lightbox'
import linkifyHtml from 'linkify-html';
import ErrorMessage from 'src/Components/Errors/ErrorMessage/ErrorMessage';
@@ -108,6 +108,8 @@ export default function ProjectDetailsCard({ direction, projectId, ...props }: P
},
];
+ const canEdit = project.permissions.includes(ProjectPermissionEnum.UpdateInfo);
+
const onVote = (votes?: number) => {
dispatch(setVoteAmount(votes ?? 10));
dispatch(openModal({
@@ -140,9 +142,14 @@ export default function ProjectDetailsCard({ direction, projectId, ...props }: P
{/* Cover Image */}

-
+
+
+
+
+
+
{/* Title & Basic Info */}
@@ -171,6 +178,7 @@ export default function ProjectDetailsCard({ direction, projectId, ...props }: P
+
{/* About */}
About
diff --git a/src/graphql/index.tsx b/src/graphql/index.tsx
index b6756d2..370c99a 100644
--- a/src/graphql/index.tsx
+++ b/src/graphql/index.tsx
@@ -1040,19 +1040,21 @@ export type GetAllCapabilitiesQueryVariables = Exact<{ [key: string]: never; }>;
export type GetAllCapabilitiesQuery = { __typename?: 'Query', getAllCapabilities: Array<{ __typename?: 'Capability', id: number, title: string, icon: string }> };
+export type ProjectDetailsFragment = { __typename?: 'Project', id: number, title: string, tagline: string, description: string, hashtag: string, cover_image: string, thumbnail_image: string, launch_status: ProjectLaunchStatusEnum, twitter: string | null, discord: string | null, github: string | null, slack: string | null, telegram: string | null, screenshots: Array
, website: string, lightning_address: string | null, votes_count: number, permissions: Array, category: { __typename?: 'Category', id: number, icon: string | null, title: string }, members: Array<{ __typename?: 'ProjectMember', role: Team_Member_Role, user: { __typename?: 'User', id: number, name: string, jobTitle: string | null, avatar: string } }>, awards: Array<{ __typename?: 'Award', title: string, image: string, url: string, id: number }>, tags: Array<{ __typename?: 'Tag', id: number, title: string }>, recruit_roles: Array<{ __typename?: 'MakerRole', id: number, title: string, icon: string, level: RoleLevelEnum }>, capabilities: Array<{ __typename?: 'Capability', id: number, title: string, icon: string }> };
+
export type CreateProjectMutationVariables = Exact<{
input: InputMaybe;
}>;
-export type CreateProjectMutation = { __typename?: 'Mutation', createProject: { __typename?: 'CreateProjectResponse', project: { __typename?: 'Project', id: number, title: string, description: string, cover_image: string, thumbnail_image: string, screenshots: Array, website: string, lightning_address: string | null, lnurl_callback_url: string | null, votes_count: number, category: { __typename?: 'Category', id: number, icon: string | null, title: string }, members: Array<{ __typename?: 'ProjectMember', role: Team_Member_Role, user: { __typename?: 'User', id: number, name: string, avatar: string } }>, awards: Array<{ __typename?: 'Award', title: string, image: string, url: string, id: number }>, tags: Array<{ __typename?: 'Tag', id: number, title: string }>, recruit_roles: Array<{ __typename?: 'MakerRole', id: number, title: string, icon: string, level: RoleLevelEnum }>, capabilities: Array<{ __typename?: 'Capability', id: number, title: string, icon: string }> } } | null };
+export type CreateProjectMutation = { __typename?: 'Mutation', createProject: { __typename?: 'CreateProjectResponse', project: { __typename?: 'Project', id: number, title: string, tagline: string, description: string, hashtag: string, cover_image: string, thumbnail_image: string, launch_status: ProjectLaunchStatusEnum, twitter: string | null, discord: string | null, github: string | null, slack: string | null, telegram: string | null, screenshots: Array, website: string, lightning_address: string | null, votes_count: number, permissions: Array, category: { __typename?: 'Category', id: number, icon: string | null, title: string }, members: Array<{ __typename?: 'ProjectMember', role: Team_Member_Role, user: { __typename?: 'User', id: number, name: string, jobTitle: string | null, avatar: string } }>, awards: Array<{ __typename?: 'Award', title: string, image: string, url: string, id: number }>, tags: Array<{ __typename?: 'Tag', id: number, title: string }>, recruit_roles: Array<{ __typename?: 'MakerRole', id: number, title: string, icon: string, level: RoleLevelEnum }>, capabilities: Array<{ __typename?: 'Capability', id: number, title: string, icon: string }> } } | null };
export type UpdateProjectMutationVariables = Exact<{
input: InputMaybe;
}>;
-export type UpdateProjectMutation = { __typename?: 'Mutation', updateProject: { __typename?: 'CreateProjectResponse', project: { __typename?: 'Project', id: number, title: string, description: string, cover_image: string, thumbnail_image: string, screenshots: Array, website: string, lightning_address: string | null, lnurl_callback_url: string | null, votes_count: number, category: { __typename?: 'Category', id: number, icon: string | null, title: string }, members: Array<{ __typename?: 'ProjectMember', role: Team_Member_Role, user: { __typename?: 'User', id: number, name: string, avatar: string } }>, awards: Array<{ __typename?: 'Award', title: string, image: string, url: string, id: number }>, tags: Array<{ __typename?: 'Tag', id: number, title: string }>, recruit_roles: Array<{ __typename?: 'MakerRole', id: number, title: string, icon: string, level: RoleLevelEnum }>, capabilities: Array<{ __typename?: 'Capability', id: number, title: string, icon: string }> } } | null };
+export type UpdateProjectMutation = { __typename?: 'Mutation', updateProject: { __typename?: 'CreateProjectResponse', project: { __typename?: 'Project', id: number, title: string, tagline: string, description: string, hashtag: string, cover_image: string, thumbnail_image: string, launch_status: ProjectLaunchStatusEnum, twitter: string | null, discord: string | null, github: string | null, slack: string | null, telegram: string | null, screenshots: Array, website: string, lightning_address: string | null, votes_count: number, permissions: Array, category: { __typename?: 'Category', id: number, icon: string | null, title: string }, members: Array<{ __typename?: 'ProjectMember', role: Team_Member_Role, user: { __typename?: 'User', id: number, name: string, jobTitle: string | null, avatar: string } }>, awards: Array<{ __typename?: 'Award', title: string, image: string, url: string, id: number }>, tags: Array<{ __typename?: 'Tag', id: number, title: string }>, recruit_roles: Array<{ __typename?: 'MakerRole', id: number, title: string, icon: string, level: RoleLevelEnum }>, capabilities: Array<{ __typename?: 'Capability', id: number, title: string, icon: string }> } } | null };
export type IsValidProjectHashtagQueryVariables = Exact<{
hashtag: Scalars['String'];
@@ -1181,6 +1183,63 @@ export const UserRolesSkillsFragmentDoc = gql`
}
}
`;
+export const ProjectDetailsFragmentDoc = gql`
+ fragment ProjectDetails on Project {
+ id
+ title
+ tagline
+ description
+ hashtag
+ cover_image
+ thumbnail_image
+ launch_status
+ twitter
+ discord
+ github
+ slack
+ telegram
+ screenshots
+ website
+ lightning_address
+ votes_count
+ category {
+ id
+ icon
+ title
+ }
+ permissions
+ members {
+ role
+ user {
+ id
+ name
+ jobTitle
+ avatar
+ }
+ }
+ awards {
+ title
+ image
+ url
+ id
+ }
+ tags {
+ id
+ title
+ }
+ recruit_roles {
+ id
+ title
+ icon
+ level
+ }
+ capabilities {
+ id
+ title
+ icon
+ }
+}
+ `;
export const OfficialTagsDocument = gql`
query OfficialTags {
officialTags {
@@ -2477,54 +2536,11 @@ export const CreateProjectDocument = gql`
mutation CreateProject($input: CreateProjectInput) {
createProject(input: $input) {
project {
- id
- title
- description
- cover_image
- thumbnail_image
- screenshots
- website
- lightning_address
- lnurl_callback_url
- votes_count
- category {
- id
- icon
- title
- }
- members {
- role
- user {
- id
- name
- avatar
- }
- }
- awards {
- title
- image
- url
- id
- }
- tags {
- id
- title
- }
- recruit_roles {
- id
- title
- icon
- level
- }
- capabilities {
- id
- title
- icon
- }
+ ...ProjectDetails
}
}
}
- `;
+ ${ProjectDetailsFragmentDoc}`;
export type CreateProjectMutationFn = Apollo.MutationFunction;
/**
@@ -2555,54 +2571,11 @@ export const UpdateProjectDocument = gql`
mutation UpdateProject($input: UpdateProjectInput) {
updateProject(input: $input) {
project {
- id
- title
- description
- cover_image
- thumbnail_image
- screenshots
- website
- lightning_address
- lnurl_callback_url
- votes_count
- category {
- id
- icon
- title
- }
- members {
- role
- user {
- id
- name
- avatar
- }
- }
- awards {
- title
- image
- url
- id
- }
- tags {
- id
- title
- }
- recruit_roles {
- id
- title
- icon
- level
- }
- capabilities {
- id
- title
- icon
- }
+ ...ProjectDetails
}
}
}
- `;
+ ${ProjectDetailsFragmentDoc}`;
export type UpdateProjectMutationFn = Apollo.MutationFunction;
/**
diff --git a/src/utils/helperFunctions.tsx b/src/utils/helperFunctions.tsx
index 69bf086..09cd597 100644
--- a/src/utils/helperFunctions.tsx
+++ b/src/utils/helperFunctions.tsx
@@ -182,3 +182,8 @@ export const getSpanDate = (_date1: string, _date2: string) => {
return `${dayjs(_date1).format('H:mm')} - ${dayjs(_date2).format('H:mm, Do MMM')}`
}
+
+
+export function removeArrayItemAtIndex(arr: T[], indexToRemove: number) {
+ return [...arr.slice(0, indexToRemove), ...arr.slice(indexToRemove + 1)]
+}
\ No newline at end of file