Change fetch to oct

This commit is contained in:
DefectingCat
2022-06-21 14:05:41 +08:00
parent 787fc77ba4
commit 74bd0a7ba0
8 changed files with 704 additions and 117 deletions

View File

@ -1,16 +1,16 @@
import Anchor from 'components/mdx/Anchor';
import Loading from 'components/RUA/loading/RUALoading';
import dayjs from 'dayjs';
import { GistData } from 'lib/fetcher';
import dynamic from 'next/dynamic';
import Link from 'next/link';
import { Gist } from 'types';
const GistsCode = dynamic(() => import('components/gists/GistsCode'), {
loading: () => <Loading classNames="h-[300px]" />,
});
type Props = {
gists: Gist[];
gists: GistData[];
};
const FileContent = ({ gists }: Props) => {
@ -23,7 +23,7 @@ const FileContent = ({ gists }: Props) => {
<div key={g.files[f].raw_url} className="pb-4 ">
{/* Username and file name */}
<h1 className="md:text-lg">
{g.owner.login} /
{g.login} /
<Link href={`/g/${g.id}`} passHref>
<Anchor external={false}>{g.files[f].filename}</Anchor>
</Link>

View File

@ -1,11 +1,11 @@
import classNames from 'classnames';
import { GetUser } from 'lib/fetcher';
import Image from 'next/image';
import avatar from 'public/images/img/avatar.svg';
import { FiLink, FiMail, FiTwitter } from 'react-icons/fi';
import { GithubUser } from 'types';
type Props = {
user: GithubUser;
user: GetUser;
};
const UserInfo = ({ user }: Props) => {
@ -53,22 +53,26 @@ const UserInfo = ({ user }: Props) => {
<a href={`mailto:${user.email}`}>{user.email}</a>
</span>
</div>
<div className="flex items-center mb-1">
<FiLink className="mr-2" />
<a href={user.blog} target="_blank" rel="noreferrer">
{user.blog}
</a>
</div>
<div className="flex items-center mb-1">
<FiTwitter className="mr-2" />
<a
rel="noreferrer"
target="_blank"
href={`https://twitter.com/${user.twitter_username}`}
>
@{user.twitter_username}
</a>
</div>
{user.blog && (
<div className="flex items-center mb-1">
<FiLink className="mr-2" />
<a href={user.blog} target="_blank" rel="noreferrer">
{user.blog}
</a>
</div>
)}
{user.twitter_username && (
<div className="flex items-center mb-1">
<FiTwitter className="mr-2" />
<a
rel="noreferrer"
target="_blank"
href={`https://twitter.com/${user.twitter_username}`}
>
@{user.twitter_username}
</a>
</div>
)}
</div>
</div>
</>