Add contributors to icon overlay and add dot (#223)

* add contributers

* Add icon fetcher

* add contributing json

* Fix fetch call

* Add contributers to site

* Add caching for github api

* Fix build

* Move context provider

* Revert packages changes

* Fix mobile layout

* remove react-spring

* remove incorrect type prop
This commit is contained in:
Eric Fennis
2021-02-12 20:38:47 +01:00
committed by GitHub
parent c4dfe6b8cb
commit a7e8b3bcb7
12 changed files with 305 additions and 110 deletions

View File

@@ -1,4 +1,3 @@
import { useEffect } from 'react'
import { useRouter } from 'next/router'
import IconDetailOverlay from '../../components/IconDetailOverlay'
import { getAllData, getData } from '../../lib/icons';
@@ -29,7 +28,7 @@ const IconPage = ({ icon, data }) => {
<IconDetailOverlay
key={icon.name}
icon={icon}
onClose={onClose}
close={onClose}
/>
<Header {...{data}}/>
<IconOverview {...{data}}/>
@@ -39,15 +38,17 @@ const IconPage = ({ icon, data }) => {
export default IconPage
export function getStaticProps({ params: { iconName } }) {
const data = getAllData();
const icon = getData(iconName);
export async function getStaticProps({ params: { iconName } }) {
const data = await getAllData();
const icon = await getData(iconName);
return { props: { icon, data } }
}
export function getStaticPaths() {
export async function getStaticPaths() {
const data = await getAllData();
return {
paths: getAllData().map(({name: iconName }) => ({
paths: data.map(({ name: iconName }) => ({
params: { iconName },
})),
fallback: false,