📆 Founded
Select the year you wish to see companies founded in.
-
- {yearsFounded.map(year =>
-
+
+ {yearsFoundedOptions.map(year =>
+
)}
+
{year.text}
+ )}
+
+
+
+
+
+
💙 Project status
+
Select an option from below.
+
+ {projectStatusOptions.map(status =>
+
+ setProjectStatusFilter(e.target.value as typeof status.value)}
+ type="radio" />
+ {status.text}
+ )}
+
+
+
+
+
+
+
💻 License type
+
What type of license does this open source project have?
+
+ {licensesOptions.map(license =>
+ )}
@@ -184,3 +234,34 @@ export default function FiltersModal({ onClose, direction, initFilters, callback
)
}
+
+
+const yearsFoundedOptions = [
+ { value: "any", text: "Any" },
+ { value: "2016", text: "2016" },
+ { value: "2017", text: "2017" },
+ { value: "2018", text: "2018" },
+ { value: "2019", text: "2019" },
+ { value: "2020", text: "2020" },
+ { value: "2021", text: "2021" },
+ { value: "2022", text: "2022" },
+] as const
+
+const projectStatusOptions = [
+ { value: "any", text: "Any" },
+ { value: 'alive', text: "Alive 🌱" },
+ { value: 'dead', text: "RIP 💀" },
+] as const
+
+const licensesOptions = [
+ { value: "any", text: "Any" },
+ { value: 'MIT License', text: "MIT License" },
+ { value: 'ISC License', text: "ISC License" },
+ { value: 'Public domain', text: "Public domain" },
+ { value: 'Apache License 2.0', text: "Apache License 2.0" },
+ { value: 'GNU General Public License v2.0', text: "GNU General Public License v2.0" },
+ { value: 'GNU General Public License v3.0', text: "GNU General Public License v3.0" },
+ { value: 'Creative Commons Zero v1.0 Universal', text: "Creative Commons Zero v1.0 Universal" },
+ { value: 'GNU Affero General Public License v3.0', text: "GNU Affero General Public License v3.0" },
+ { value: 'Other', text: "Other" },
+] as const
\ No newline at end of file
diff --git a/src/features/Projects/pages/ProjectPage/ProjectDetailsCard/ProjectDetails.graphql b/src/features/Projects/pages/ProjectPage/ProjectDetailsCard/ProjectDetails.graphql
index 1da9b45..f24f1e8 100644
--- a/src/features/Projects/pages/ProjectPage/ProjectDetailsCard/ProjectDetails.graphql
+++ b/src/features/Projects/pages/ProjectPage/ProjectDetailsCard/ProjectDetails.graphql
@@ -1,5 +1,5 @@
query ProjectDetails($projectsId: String) {
- projects(id: $projectsId) {
+ getProject: projects(id: $projectsId) {
id
title
dead
diff --git a/src/features/Projects/pages/ProjectPage/ProjectDetailsCard/ProjectDetailsCard.tsx b/src/features/Projects/pages/ProjectPage/ProjectDetailsCard/ProjectDetailsCard.tsx
index 899d3ec..6fbc327 100644
--- a/src/features/Projects/pages/ProjectPage/ProjectDetailsCard/ProjectDetailsCard.tsx
+++ b/src/features/Projects/pages/ProjectPage/ProjectDetailsCard/ProjectDetailsCard.tsx
@@ -42,12 +42,14 @@ export default function ProjectDetailsCard({ direction, projectId, ...props }: P
projectsId: projectId!,
},
onCompleted: data => {
- dispatch(setProject((data.projects?.[0] as any) ?? null))
+ dispatch(setProject((data.getProject?.[0] as any) ?? null))
},
onError: () => {
dispatch(setProject(null));
},
- skip: !Boolean(projectId)
+ skip: !Boolean(projectId),
+ fetchPolicy: "no-cache"
+
});
@@ -72,7 +74,7 @@ export default function ProjectDetailsCard({ direction, projectId, ...props }: P
return
;
- const project = data?.projects?.[0];
+ const project = data?.getProject?.[0];
if (!project) return
404
@@ -126,8 +128,8 @@ export default function ProjectDetailsCard({ direction, projectId, ...props }: P
{/* Title & Basic Info */}
-
-

+
+
{project?.title}
@@ -173,26 +175,23 @@ export default function ProjectDetailsCard({ direction, projectId, ...props }: P
-
-
DATA
-
- {project?.dead && {project.dead}}
- {project?.createdAt && {project.createdAt}}
- {project?.companyName && {project.companyName}}
- {project?.endDate && {project.endDate}}
- {project?.updatedAt && {project.updatedAt}}
- {project?.watchers && {project.watchers}}
- {project?.yearFounded && {project.yearFounded}}
- {project?.subcategory && {project.subcategory}}
- {project?.stars && {project.stars}}
- {project?.repository && {project.repository}}
- {project?.openSource && {project.openSource}}
- {project?.linkedIn && {project.linkedIn}}
- {project?.license && {project.license}}
- {project?.language && {project.language}}
- {project?.forks && {project.forks}}
-
+
+
DATA
+
+ {project?.dead !== null &&
Dead}
+ {project?.createdAt !== null &&
Created at: {new Date(project.createdAt).toLocaleDateString()}}
+ {project?.companyName !== null &&
Company Name: {project.companyName}}
+ {project?.endDate !== null &&
End date: {new Date(project.endDate).toLocaleDateString()}}
+ {project?.repository !== null &&
Repository }
+ {project?.stars !== null &&
Stars: {project.stars}}
+ {project?.openSource !== null &&
Open source: {project.openSource}}
+ {project?.watchers !== null &&
Watchers: {project.watchers}}
+ {project?.forks !== null &&
Number of forks: {project.forks}}
+ {project?.license !== null &&
License: {project.license}}
+ {project?.language !== null &&
Language: {project.language}}
+ {project?.updatedAt !== null &&
Last updated at:{new Date(project.updatedAt).toLocaleDateString()}}
+
Want to suggest any changes to this project?
diff --git a/src/graphql/index.tsx b/src/graphql/index.tsx
index ce44df6..7d014c7 100644
--- a/src/graphql/index.tsx
+++ b/src/graphql/index.tsx
@@ -425,7 +425,7 @@ export type ProjectDetailsQueryVariables = Exact<{
}>;
-export type ProjectDetailsQuery = { __typename?: 'Query', projects: Array<{ __typename?: 'projects', id: string | null, title: string | null, dead: boolean | null, createdAt: string | null, companyName: string | null, category: string | null, description: string | null, discord: string | null, endDate: string | null, twitter: string | null, updatedAt: string | null, watchers: number | null, website: string | null, yearFounded: number | null, telegram: string | null, stars: number | null, repository: string | null, openSource: string | null, logo: Array
| null, linkedIn: string | null, license: string | null, language: string | null, forks: number | null, categoryList: Array<{ __typename?: 'categoryList', name: string | null } | null> | null, tags: Array<{ __typename?: 'tags', id: string | null, name: string | null, icon: string | null } | null> | null } | null> | null };
+export type ProjectDetailsQuery = { __typename?: 'Query', getProject: Array<{ __typename?: 'projects', id: string | null, title: string | null, dead: boolean | null, createdAt: string | null, companyName: string | null, category: string | null, description: string | null, discord: string | null, endDate: string | null, twitter: string | null, updatedAt: string | null, watchers: number | null, website: string | null, yearFounded: number | null, telegram: string | null, stars: number | null, repository: string | null, openSource: string | null, logo: Array | null, linkedIn: string | null, license: string | null, language: string | null, forks: number | null, categoryList: Array<{ __typename?: 'categoryList', name: string | null } | null> | null, tags: Array<{ __typename?: 'tags', id: string | null, name: string | null, icon: string | null } | null> | null } | null> | null };
export const AllCategoriesDocument = gql`
@@ -570,7 +570,7 @@ export type ExplorePageLazyQueryHookResult = ReturnType;
export const ProjectDetailsDocument = gql`
query ProjectDetails($projectsId: String) {
- projects(id: $projectsId) {
+ getProject: projects(id: $projectsId) {
id
title
dead