mirror of
https://github.com/DefectingCat/DefectingCat.github.io
synced 2025-07-16 09:11:38 +00:00
💄 Format styles
This commit is contained in:
@ -1,13 +1,13 @@
|
|||||||
import { GistsFile } from 'types';
|
|
||||||
import { unified } from 'unified';
|
|
||||||
import remarkParse from 'remark-parse';
|
|
||||||
import remarkRehype from 'remark-rehype';
|
|
||||||
import rehypePrism from '@mapbox/rehype-prism';
|
import rehypePrism from '@mapbox/rehype-prism';
|
||||||
import remarkGfm from 'remark-gfm';
|
import classNames from 'classnames';
|
||||||
import { createElement, Fragment } from 'react';
|
import { createElement, Fragment } from 'react';
|
||||||
import rehypeReact from 'rehype-react';
|
import rehypeReact from 'rehype-react';
|
||||||
|
import remarkGfm from 'remark-gfm';
|
||||||
|
import remarkParse from 'remark-parse';
|
||||||
|
import remarkRehype from 'remark-rehype';
|
||||||
|
import { GistsFile } from 'types';
|
||||||
|
import { unified } from 'unified';
|
||||||
import styles from './styles.module.css';
|
import styles from './styles.module.css';
|
||||||
import classNames from 'classnames';
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
file: GistsFile;
|
file: GistsFile;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Gist, GithubUser, SignalGist } from 'types';
|
|
||||||
import { Base64 } from 'js-base64';
|
import { Base64 } from 'js-base64';
|
||||||
|
import { Gist, GithubUser, SignalGist } from 'types';
|
||||||
|
|
||||||
const baseUrl = 'https://api.github.com';
|
const baseUrl = 'https://api.github.com';
|
||||||
const username = 'DefectingCat';
|
const username = 'DefectingCat';
|
||||||
@ -12,7 +12,7 @@ headers.set(
|
|||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get all gists
|
* Get all gists.
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export const getGists = async (page = 1, perPage = 10) => {
|
export const getGists = async (page = 1, perPage = 10) => {
|
||||||
@ -31,6 +31,11 @@ export const getUser = async () => {
|
|||||||
)) as GithubUser;
|
)) as GithubUser;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get one gist.
|
||||||
|
* @param id
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
export const getSignalGist = async (id: string) => {
|
export const getSignalGist = async (id: string) => {
|
||||||
return (await fetch(`${baseUrl}/gists/${id}`, { headers }).then((res) =>
|
return (await fetch(`${baseUrl}/gists/${id}`, { headers }).then((res) =>
|
||||||
res.json()
|
res.json()
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
import classNames from 'classnames';
|
||||||
import dynamic from 'next/dynamic';
|
import dynamic from 'next/dynamic';
|
||||||
import { NextPageWithLayout } from 'types';
|
import { NextPageWithLayout } from 'types';
|
||||||
import classNames from 'classnames';
|
|
||||||
|
|
||||||
const MainLayout = dynamic(() => import('layouts/MainLayout'));
|
const MainLayout = dynamic(() => import('layouts/MainLayout'));
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import { InferGetStaticPropsType } from 'next';
|
|
||||||
import { ReactElement } from 'react';
|
|
||||||
import { postLists } from 'lib/posts';
|
|
||||||
import cn from 'classnames';
|
import cn from 'classnames';
|
||||||
import dynamic from 'next/dynamic';
|
|
||||||
import PostCardLoading from 'components/RUA/loading/PostCardLoading';
|
import PostCardLoading from 'components/RUA/loading/PostCardLoading';
|
||||||
|
import { postLists } from 'lib/posts';
|
||||||
|
import { InferGetStaticPropsType } from 'next';
|
||||||
|
import dynamic from 'next/dynamic';
|
||||||
|
import { ReactElement } from 'react';
|
||||||
|
|
||||||
const PostCard = dynamic(() => import('components/PostCard'), {
|
const PostCard = dynamic(() => import('components/PostCard'), {
|
||||||
loading: () => <PostCardLoading />,
|
loading: () => <PostCardLoading />,
|
||||||
|
@ -19,7 +19,7 @@ const Gist = ({ gist }: InferGetStaticPropsType<typeof getStaticProps>) => {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<main className="max-w-5xl px-4 mx-auto lg:px-0">
|
<main className="max-w-5xl px-4 mx-auto lg:px-0">
|
||||||
<div className={'pb-4 text-sm'}>
|
<div className="pb-4 text-sm">
|
||||||
<div className="flex items-center py-1 ">
|
<div className="flex items-center py-1 ">
|
||||||
<Image
|
<Image
|
||||||
src={avatar}
|
src={avatar}
|
||||||
@ -30,7 +30,7 @@ const Gist = ({ gist }: InferGetStaticPropsType<typeof getStaticProps>) => {
|
|||||||
className="rounded-full "
|
className="rounded-full "
|
||||||
/>
|
/>
|
||||||
<h1 className="ml-2 overflow-hidden text-xl whitespace-nowrap overflow-ellipsis">
|
<h1 className="ml-2 overflow-hidden text-xl whitespace-nowrap overflow-ellipsis">
|
||||||
<Link href={`/gists`} passHref>
|
<Link href="/gists" passHref>
|
||||||
<Anchor external={false}>{gist.owner.login}</Anchor>
|
<Anchor external={false}>{gist.owner.login}</Anchor>
|
||||||
</Link>
|
</Link>
|
||||||
/{Object.keys(gist.files)[0]}
|
/{Object.keys(gist.files)[0]}
|
||||||
|
@ -21,7 +21,6 @@ const Gists = ({
|
|||||||
<main className="max-w-5xl px-4 mx-auto lg:px-0">
|
<main className="max-w-5xl px-4 mx-auto lg:px-0">
|
||||||
<div className="md:flex">
|
<div className="md:flex">
|
||||||
<UserInfo user={user} />
|
<UserInfo user={user} />
|
||||||
|
|
||||||
<FileContent gists={gists} />
|
<FileContent gists={gists} />
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
@ -21,7 +21,6 @@ const Gists = ({
|
|||||||
<main className="max-w-5xl px-4 mx-auto lg:px-0">
|
<main className="max-w-5xl px-4 mx-auto lg:px-0">
|
||||||
<div className="md:flex">
|
<div className="md:flex">
|
||||||
<UserInfo user={user} />
|
<UserInfo user={user} />
|
||||||
|
|
||||||
<FileContent gists={gists} />
|
<FileContent gists={gists} />
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import cn from 'classnames';
|
import cn from 'classnames';
|
||||||
|
import dynamic from 'next/dynamic';
|
||||||
import Head from 'next/head';
|
import Head from 'next/head';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import type { NextPageWithLayout } from 'types';
|
|
||||||
import style from 'styles/index/index.module.css';
|
import style from 'styles/index/index.module.css';
|
||||||
import dynamic from 'next/dynamic';
|
import type { NextPageWithLayout } from 'types';
|
||||||
|
|
||||||
const MainLayout = dynamic(() => import('layouts/MainLayout'));
|
const MainLayout = dynamic(() => import('layouts/MainLayout'));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user