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:
@@ -2,6 +2,7 @@ import { ChakraProvider } from '@chakra-ui/core';
|
||||
import customTheme from '../lib/theme';
|
||||
import '../assets/styling.css';
|
||||
import Head from 'next/head';
|
||||
import { CustomizeIconContext } from "../components/CustomizeIconContext";
|
||||
|
||||
const App = ({ Component, pageProps }) => {
|
||||
return (
|
||||
@@ -10,7 +11,9 @@ const App = ({ Component, pageProps }) => {
|
||||
<title>Lucide</title>
|
||||
</Head>
|
||||
<ChakraProvider theme={customTheme}>
|
||||
<Component {...pageProps} />
|
||||
<CustomizeIconContext>
|
||||
<Component {...pageProps} />
|
||||
</CustomizeIconContext>
|
||||
</ChakraProvider>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -5,7 +5,6 @@ import IconOverview from "../components/IconOverview";
|
||||
import IconDetailOverlay from "../components/IconDetailOverlay";
|
||||
import { useRouter } from "next/router";
|
||||
import Header from "../components/Header";
|
||||
import {CustomizeIconContext} from "../components/CustomizeIconContext";
|
||||
|
||||
const IndexPage = ({ data }) => {
|
||||
const router = useRouter();
|
||||
@@ -13,21 +12,19 @@ const IndexPage = ({ data }) => {
|
||||
|
||||
return (
|
||||
<Layout>
|
||||
<CustomizeIconContext>
|
||||
<IconDetailOverlay
|
||||
isOpen={!!router.query.iconName}
|
||||
icon={getIcon(router.query.iconName)}
|
||||
onClose={() => router.push('/')}
|
||||
/>
|
||||
<Header {...{data}}/>
|
||||
<IconOverview {...{data}}/>
|
||||
</CustomizeIconContext>
|
||||
<IconDetailOverlay
|
||||
open={!!router.query.iconName}
|
||||
icon={getIcon(router.query.iconName)}
|
||||
close={() => router.push('/')}
|
||||
/>
|
||||
<Header {...{data}}/>
|
||||
<IconOverview {...{data}}/>
|
||||
</Layout>
|
||||
);
|
||||
};
|
||||
|
||||
export async function getStaticProps() {
|
||||
let data = getAllData();
|
||||
let data = await getAllData();
|
||||
|
||||
return {
|
||||
props: {
|
||||
|
||||
Reference in New Issue
Block a user