🎨 project base

This commit is contained in:
eric committed 2022-11-09 22:56:02 +01:00
1 parent 6857e301fa
commit ae437a097b
14 files changed
+113 -32

No files matched your search

+1 -1
View File
@@ -3,7 +3,7 @@ import Link from "next/link";
import { useRouter } from "next/router";
import { signOut, useSession } from "next-auth/react";
const Header: React.FC = () => {
const Header = () => {
const router = useRouter();
const isActive: (pathname: string) => boolean = (pathname) =>
router.pathname === pathname;
+3 -3
View File
@@ -2,13 +2,13 @@ import React, { ReactNode } from "react";
import Header from "./Header";
type Props = {
children: ReactNode;
children?: React.ReactNode;
};
const Layout: React.FC<Props> = (props) => (
const Layout = ({children} : Props) => (
<div>
<Header />
<div className="layout">{props.children}</div>
<div className="layout">{children}</div>
<style jsx global>{`
html {
box-sizing: border-box;
+1 -1
View File
@@ -13,7 +13,7 @@ export type PostProps = {
published: boolean;
};
const Post: React.FC<{ post: PostProps }> = ({ post }) => {
const Post = ( {post} : {post : PostProps}) => {
const authorName = post.author ? post.author.name : "Unknown author";
return (
<div onClick={() => Router.push("/p/[id]", `/p/${post.id}`)}>