1
0
mirror of https://github.com/kremalicious/portfolio.git synced 2025-02-14 21:10:41 +01:00
Matthias Kretschmann 447cada700
Migrate to Next.js + TypeScript (#1038)
* next.js + typescript

* more testing

* script updates

* fixes

* favicon generation

* testing

* readme updates

* tweaks

* tweaks

* move tests

* image tweaks

* ci tweaks

* commit next-env.d.ts for ci

* migrations

* fixes

* fixes

* ci tweaks

* new animations

* project preview tweaks

* add codeclimate config

* dark mode refactor, test tweaks

* readme updates

* animation tweaks

* animate in loaded images

* test update

* update humans.txt
2022-11-15 23:14:59 +00:00

46 lines
1.2 KiB
TypeScript

import React from 'react'
import Repo from '../../interfaces/repo'
import Icon from '../Icon'
import styles from './index.module.css'
export default function Repository({ repo }: { repo: Repo }) {
const { name, full_name, description, html_url, homepage, stargazers_count } =
repo
const isExternal = !full_name.includes('kremalicious')
// for blog & portfolio and if there's no homepage, use github url
// else use homepage field
const repoLink =
name === 'blog' || name === 'portfolio' || !homepage || isExternal
? html_url
: homepage
return (
<div className={styles.repo}>
<h1 className={styles.repoTitle}>
<a href={repoLink}>{isExternal ? full_name : name}</a>
</h1>
<p>{description}</p>
<p className={styles.meta}>
{name === 'portfolio' || name === 'blog'
? null
: !isExternal &&
homepage && (
<a href={homepage}>
<Icon name="Compass" /> More info
</a>
)}
<a href={html_url}>
<Icon name="GitHub" /> GitHub
</a>
<a href={`${html_url}/stargazers`}>
<Icon name="Star" /> {stargazers_count}
</a>
</p>
</div>
)
}