From 7e16f500cb7bc0cfd8bafbf6bb1555704f771231 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Fri, 29 Apr 2022 12:13:34 +0200 Subject: chore: remove old pages, components, helpers and types Since I'm using new components, I will also rewrite the GraphQL queries so it is easier to start from scratch. --- src/components/ProjectSummary/ProjectSummary.tsx | 178 ----------------------- 1 file changed, 178 deletions(-) delete mode 100644 src/components/ProjectSummary/ProjectSummary.tsx (limited to 'src/components/ProjectSummary/ProjectSummary.tsx') diff --git a/src/components/ProjectSummary/ProjectSummary.tsx b/src/components/ProjectSummary/ProjectSummary.tsx deleted file mode 100644 index 79e783e..0000000 --- a/src/components/ProjectSummary/ProjectSummary.tsx +++ /dev/null @@ -1,178 +0,0 @@ -import GithubIcon from '@assets/images/social-media/github.svg'; -import GitlabIcon from '@assets/images/social-media/gitlab.svg'; -import { ProjectMeta } from '@ts/types/app'; -import { settings } from '@utils/config'; -import { getFormattedDate } from '@utils/helpers/format'; -import { slugify } from '@utils/helpers/slugify'; -import useGithubApi from '@utils/hooks/useGithubApi'; -import Image from 'next/image'; -import { useRouter } from 'next/router'; -import { useIntl } from 'react-intl'; -import styles from './ProjectSummary.module.scss'; - -const ProjectSummary = ({ - id, - meta, -}: { - id: string; - title: string; - meta: ProjectMeta; -}) => { - const { hasCover, license, repos, technologies } = meta; - const intl = useIntl(); - const router = useRouter(); - const locale = router.locale ? router.locale : settings.locales.defaultLocale; - const { data } = useGithubApi(repos?.github ? repos.github : ''); - - return ( -
- {hasCover && ( -
- {intl.formatMessage({ -
- )} -
- {data && ( -
-
- {intl.formatMessage({ - defaultMessage: 'Created on:', - description: 'ProjectSummary: creation date label', - id: 'CWi0go', - })} -
-
- -
-
- )} - {data && ( -
-
- {intl.formatMessage({ - defaultMessage: 'Last updated on:', - description: 'ProjectSummary: update date label', - id: 'vJ+QDV', - })} -
-
- -
-
- )} -
-
- {intl.formatMessage({ - defaultMessage: 'License:', - description: 'ProjectSummary: license label', - id: 'hKagVG', - })} -
-
{license}
-
- {technologies && ( -
-
- {intl.formatMessage( - { - defaultMessage: - '{count, plural, =0 {Technologies:} one {Technology:} other {Technologies:}}', - description: 'ProjectSummary: technologies list label', - id: 'enwhNm', - }, - { count: technologies.length } - )} -
- {technologies.map((techno) => ( -
- {techno} -
- ))} -
- )} - {repos && ( -
-
- {intl.formatMessage( - { - defaultMessage: - '{count, plural, =0 {Repositories:} one {Repository:} other {Repositories:}}', - description: 'ProjectSummary: repositories list label', - id: 'OTTv+m', - }, - { count: Object.keys(repos).length } - )} -
- {repos.github && ( -
- - - Github - -
- )} - {repos.gitlab && ( -
- - - Gitlab - -
- )} -
- )} - {data && repos && ( -
-
- {intl.formatMessage({ - defaultMessage: 'Popularity:', - description: 'ProjectSummary: popularity label', - id: 'vgMk0q', - })} -
- {repos.github && ( -
- ⭐  - - {intl.formatMessage( - { - defaultMessage: - '{starsCount, plural, =0 {0 stars on Github} one {# star on Github} other {# stars on Github}}', - description: 'ProjectSummary: technologies list label', - id: 'aA3hOT', - }, - { starsCount: data.stargazers_count } - )} - -
- )} -
- )} -
-
- ); -}; - -export default ProjectSummary; -- cgit v1.2.3