mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-09-15 04:05:32 -04:00
some very minor refactoring/fixing
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
import { useState, useEffect } from "react";
|
||||
import copy from "copy-to-clipboard";
|
||||
import trimNewlines from "trim-newlines";
|
||||
|
||||
// react components:
|
||||
import { CopyIcon, CheckIcon } from "@primer/octicons-react";
|
||||
|
||||
import styles from "./CopyButton.module.scss";
|
||||
|
@@ -2,7 +2,7 @@ import useSWR from "swr";
|
||||
import { fetcher } from "../../lib/fetcher";
|
||||
import Loading from "../loading/Loading";
|
||||
|
||||
export default function Counter({ slug }) {
|
||||
export default function Hits({ slug }) {
|
||||
// start fetching repos from API immediately
|
||||
const { data, error } = useSWR(`/api/hits/?slug=${encodeURIComponent(slug)}`, fetcher, {
|
||||
// avoid double (or more) counting views
|
||||
|
@@ -2,7 +2,7 @@ import Link from "next/link";
|
||||
import Image from "next/image";
|
||||
import TweetEmbed from "react-tweet-embed";
|
||||
import Gist from "react-gist";
|
||||
import getNodeText from "../lib/getNodeText";
|
||||
import getNodeText from "../lib/get-node-text";
|
||||
import Video from "./video/FullPageVideo";
|
||||
import CopyButton from "./clipboard/CopyButton";
|
||||
import { MarkGithubIcon } from "@primer/octicons-react";
|
||||
|
@@ -18,5 +18,7 @@ export default function List({ allNotes }) {
|
||||
);
|
||||
});
|
||||
|
||||
return <>{sections.reverse()}</>;
|
||||
const reversed = sections.reverse();
|
||||
|
||||
return <>{reversed}</>;
|
||||
}
|
||||
|
@@ -6,7 +6,7 @@ type Props = {
|
||||
title: unknown;
|
||||
};
|
||||
|
||||
export default function Content({ title }: Props) {
|
||||
export default function PageTitle({ title }: Props) {
|
||||
const router = useRouter();
|
||||
|
||||
return (
|
||||
|
@@ -1,6 +1,4 @@
|
||||
import { intlFormat, formatDistanceToNowStrict, parseISO } from "date-fns";
|
||||
|
||||
// react components:
|
||||
import { StarIcon, RepoForkedIcon } from "@primer/octicons-react";
|
||||
|
||||
import styles from "./RepositoryCard.module.scss";
|
||||
|
Reference in New Issue
Block a user