mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-28 15:10:04 +00:00
Medium 主题:调整Fontawesome
This commit is contained in:
@@ -29,8 +29,8 @@ const LayoutBase = props => {
|
|||||||
|
|
||||||
<div className='w-full'>
|
<div className='w-full'>
|
||||||
{/* 移动端顶部菜单 */}
|
{/* 移动端顶部菜单 */}
|
||||||
<TopNavBar />
|
<TopNavBar {...props}/>
|
||||||
<div className='px-5 max-w-5xl justify-center mx-auto'>
|
<div className='px-5 max-w-5xl justify-center mx-auto min-h-screen'>
|
||||||
{slotTop}
|
{slotTop}
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
import LayoutBase from './LayoutBase'
|
import LayoutBase from './LayoutBase'
|
||||||
import BlogPostListScroll from './components/BlogPostListScroll'
|
import BlogPostListScroll from './components/BlogPostListScroll'
|
||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
|
||||||
import { faTh } from '@fortawesome/free-solid-svg-icons'
|
|
||||||
|
|
||||||
export const LayoutCategory = (props) => {
|
export const LayoutCategory = (props) => {
|
||||||
const { category } = props
|
const { category } = props
|
||||||
const slotTop = <div className='flex items-center font-sans p-8'><div className='text-xl'><FontAwesomeIcon icon={faTh} className='mr-2'/>分类:</div>{category}</div>
|
const slotTop = <div className='flex items-center font-sans p-8'><div className='text-xl'><i className='mr-2 fas fa-th'/>分类:</div>{category}</div>
|
||||||
|
|
||||||
return <LayoutBase {...props} slotTop={slotTop}>
|
return <LayoutBase {...props} slotTop={slotTop}>
|
||||||
<BlogPostListScroll {...props} />
|
<BlogPostListScroll {...props} />
|
||||||
|
|||||||
@@ -23,8 +23,6 @@ import mediumZoom from 'medium-zoom'
|
|||||||
import React, { useEffect, useRef } from 'react'
|
import React, { useEffect, useRef } from 'react'
|
||||||
import ArticleAround from './components/ArticleAround'
|
import ArticleAround from './components/ArticleAround'
|
||||||
import Catalog from './components/Catalog'
|
import Catalog from './components/Catalog'
|
||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
|
||||||
import { faEye } from '@fortawesome/free-solid-svg-icons'
|
|
||||||
import CategoryItem from './components/CategoryItem'
|
import CategoryItem from './components/CategoryItem'
|
||||||
import TagItemMini from './components/TagItemMini'
|
import TagItemMini from './components/TagItemMini'
|
||||||
import CONFIG_MEDIUM from './config_medium'
|
import CONFIG_MEDIUM from './config_medium'
|
||||||
@@ -104,7 +102,7 @@ export const LayoutSlug = props => {
|
|||||||
</Link>
|
</Link>
|
||||||
<div className="text-gray-500">{date}</div>
|
<div className="text-gray-500">{date}</div>
|
||||||
<div className="hidden busuanzi_container_page_pv text-gray-500 font-light mr-2">
|
<div className="hidden busuanzi_container_page_pv text-gray-500 font-light mr-2">
|
||||||
<FontAwesomeIcon icon={faEye} className="ml-3 mr-0.5" />
|
<i className="ml-3 mr-0.5 fas fa-eye" />
|
||||||
|
|
||||||
<span className="mr-2 busuanzi_value_page_pv" />
|
<span className="mr-2 busuanzi_value_page_pv" />
|
||||||
</div>
|
</div>
|
||||||
@@ -139,7 +137,7 @@ export const LayoutSlug = props => {
|
|||||||
</section>
|
</section>
|
||||||
<section>
|
<section>
|
||||||
<div className='flex justify-between'>
|
<div className='flex justify-between'>
|
||||||
{ CONFIG_MEDIUM.POST_DETAIL_CATEGORY && <CategoryItem category={post.category}/>}
|
{ CONFIG_MEDIUM.POST_DETAIL_CATEGORY && post.category && <CategoryItem category={post.category}/>}
|
||||||
<div>
|
<div>
|
||||||
{ CONFIG_MEDIUM.POST_DETAIL_TAG && post?.tagItems?.map(tag => <TagItemMini key={tag.name} tag={tag} />)}
|
{ CONFIG_MEDIUM.POST_DETAIL_TAG && post?.tagItems?.map(tag => <TagItemMini key={tag.name} tag={tag} />)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
import LayoutBase from './LayoutBase'
|
import LayoutBase from './LayoutBase'
|
||||||
import BlogPostListScroll from './components/BlogPostListScroll'
|
import BlogPostListScroll from './components/BlogPostListScroll'
|
||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
|
||||||
import { faTag } from '@fortawesome/free-solid-svg-icons'
|
|
||||||
|
|
||||||
export const LayoutTag = (props) => {
|
export const LayoutTag = (props) => {
|
||||||
const { tag } = props
|
const { tag } = props
|
||||||
const slotTop = <div className='flex items-center font-sans p-8'><div className='text-xl'><FontAwesomeIcon icon={faTag} className='mr-2'/>标签:</div>{tag}</div>
|
const slotTop = <div className='flex items-center font-sans p-8'><div className='text-xl'><i className='mr-2 fas fa-tag'/>标签:</div>{tag}</div>
|
||||||
|
|
||||||
return <LayoutBase {...props} slotTop={slotTop}>
|
return <LayoutBase {...props} slotTop={slotTop}>
|
||||||
<BlogPostListScroll {...props} />
|
<BlogPostListScroll {...props} />
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
|
||||||
import { faAngleDoubleLeft, faAngleDoubleRight } from '@fortawesome/free-solid-svg-icons'
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 上一篇,下一篇文章
|
* 上一篇,下一篇文章
|
||||||
@@ -14,12 +12,12 @@ export default function ArticleAround ({ prev, next }) {
|
|||||||
return <section className='text-gray-800 h-12 flex items-center justify-between space-x-5 my-4'>
|
return <section className='text-gray-800 h-12 flex items-center justify-between space-x-5 my-4'>
|
||||||
<Link href={`/article/${prev.slug}`} passHref>
|
<Link href={`/article/${prev.slug}`} passHref>
|
||||||
<a className='text-sm cursor-pointer justify-start items-center flex hover:underline duration-300'>
|
<a className='text-sm cursor-pointer justify-start items-center flex hover:underline duration-300'>
|
||||||
<FontAwesomeIcon icon={faAngleDoubleLeft} className='mr-1' />{prev.title}
|
<i className='mr-1 fas fa-angle-double-left' />{prev.title}
|
||||||
</a>
|
</a>
|
||||||
</Link>
|
</Link>
|
||||||
<Link href={`/article/${next.slug}`} passHref>
|
<Link href={`/article/${next.slug}`} passHref>
|
||||||
<a className='text-sm cursor-pointer justify-end items-center flex hover:underline duration-300'>{next.title}
|
<a className='text-sm cursor-pointer justify-end items-center flex hover:underline duration-300'>{next.title}
|
||||||
<FontAwesomeIcon icon={faAngleDoubleRight} className='ml-1 my-1' />
|
<i className='ml-1 my-1 fas fa-angle-double-right' />
|
||||||
</a>
|
</a>
|
||||||
</Link>
|
</Link>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import BLOG from '@/blog.config'
|
import BLOG from '@/blog.config'
|
||||||
import { useGlobal } from '@/lib/global'
|
import { useGlobal } from '@/lib/global'
|
||||||
import { faAngleRight } from '@fortawesome/free-solid-svg-icons'
|
|
||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Code, Collection, Equation, NotionRenderer } from 'react-notion-x'
|
import { Code, Collection, Equation, NotionRenderer } from 'react-notion-x'
|
||||||
@@ -17,7 +15,7 @@ const BlogPostCard = ({ post, showSummary }) => {
|
|||||||
|
|
||||||
<div className='lg:p-8 p-4 flex flex-col w-full'>
|
<div className='lg:p-8 p-4 flex flex-col w-full'>
|
||||||
<Link href={`${BLOG.PATH}/article/${post.slug}`} passHref>
|
<Link href={`${BLOG.PATH}/article/${post.slug}`} passHref>
|
||||||
<a className={'cursor-pointer font-bold font-sans hover:underline text-3xl flex justify-start leading-tight text-gray-700 dark:text-gray-100 hover:text-blue-500 dark:hover:text-blue-400'}>
|
<a className={'cursor-pointer font-bold font-sans hover:underline text-3xl flex justify-start leading-tight text-gray-700 dark:text-gray-100 hover:text-green-500 dark:hover:text-green-400'}>
|
||||||
{post.title}
|
{post.title}
|
||||||
</a>
|
</a>
|
||||||
</Link>
|
</Link>
|
||||||
@@ -52,7 +50,7 @@ const BlogPostCard = ({ post, showSummary }) => {
|
|||||||
<Link href={`${BLOG.PATH}/article/${post.slug}`} passHref>
|
<Link href={`${BLOG.PATH}/article/${post.slug}`} passHref>
|
||||||
<a className='hover:bg-opacity-100 hover:scale-105 duration-200 pointer-events-auto transform text-red-500 cursor-pointer'>
|
<a className='hover:bg-opacity-100 hover:scale-105 duration-200 pointer-events-auto transform text-red-500 cursor-pointer'>
|
||||||
{locale.COMMON.ARTICLE_DETAIL}
|
{locale.COMMON.ARTICLE_DETAIL}
|
||||||
<FontAwesomeIcon className='ml-1' icon={faAngleRight} /></a>
|
<i className='ml-1 fas fa-angle-right'/></a>
|
||||||
|
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import { faHome, faSearch } from '@fortawesome/free-solid-svg-icons'
|
|
||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import JumpToTopButton from '@/themes/Medium/components/JumpToTopButton'
|
import JumpToTopButton from '@/themes/Medium/components/JumpToTopButton'
|
||||||
@@ -10,12 +8,12 @@ export default function BottomMenuBar ({ className }) {
|
|||||||
<div className='flex justify-between h-full shadow-card'>
|
<div className='flex justify-between h-full shadow-card'>
|
||||||
<Link href='/' passHref>
|
<Link href='/' passHref>
|
||||||
<div className='flex w-full items-center justify-center cursor-pointer'>
|
<div className='flex w-full items-center justify-center cursor-pointer'>
|
||||||
<FontAwesomeIcon icon={faHome} />
|
<i className='fas fa-home' />
|
||||||
</div>
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
<Link href='/search' passHref>
|
<Link href='/search' passHref>
|
||||||
<div className='flex w-full items-center justify-center cursor-pointer'>
|
<div className='flex w-full items-center justify-center cursor-pointer'>
|
||||||
<FontAwesomeIcon icon={faSearch} />
|
<i className='fas fa-search'/>
|
||||||
</div>
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
<div className='flex w-full items-center justify-center cursor-pointer'>
|
<div className='flex w-full items-center justify-center cursor-pointer'>
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import { faTh } from '@fortawesome/free-solid-svg-icons'
|
|
||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import CategoryItem from './CategoryItem'
|
import CategoryItem from './CategoryItem'
|
||||||
|
|
||||||
@@ -8,7 +6,7 @@ const CategoryGroup = ({ currentCategory, categories }) => {
|
|||||||
return <></>
|
return <></>
|
||||||
}
|
}
|
||||||
return <div id='category-list' className='pt-4'>
|
return <div id='category-list' className='pt-4'>
|
||||||
<div className='mb-2'><FontAwesomeIcon icon={faTh} className='mr-2' />分类</div>
|
<div className='mb-2'><i className='mr-2 fas fa-th' />分类</div>
|
||||||
<div className='flex flex-wrap'>
|
<div className='flex flex-wrap'>
|
||||||
{Object.keys(categories).map(category => {
|
{Object.keys(categories).map(category => {
|
||||||
const selected = currentCategory === category
|
const selected = currentCategory === category
|
||||||
|
|||||||
@@ -1,15 +1,12 @@
|
|||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
|
||||||
import { faFolderOpen, faFolder } from '@fortawesome/free-solid-svg-icons'
|
|
||||||
|
|
||||||
export default function CategoryItem ({ selected, category, categoryCount }) {
|
export default function CategoryItem ({ selected, category, categoryCount }) {
|
||||||
return <Link href={`/category/${category}`} passHref>
|
return <Link href={`/category/${category}`} passHref>
|
||||||
<a className={(selected
|
<a className={(selected
|
||||||
? 'hover:text-white dark:hover:text-white bg-gray-600 text-white '
|
? 'hover:text-white dark:hover:text-white bg-green-600 text-white '
|
||||||
: 'dark:text-gray-400 text-gray-500 hover:text-white dark:hover:text-white hover:bg-gray-600') +
|
: 'dark:text-green-400 text-gray-500 hover:text-white dark:hover:text-white hover:bg-green-600') +
|
||||||
' flex text-sm items-center duration-300 cursor-pointer py-1 font-light px-2 whitespace-nowrap'}>
|
' flex text-sm items-center duration-300 cursor-pointer py-1 font-light px-2 whitespace-nowrap'}>
|
||||||
<div><FontAwesomeIcon icon={selected ? faFolderOpen : faFolder}
|
<div><i className={`mr-2 fas ${selected ? 'fa-folder-open' : 'fa-folder'}`} />{category} {categoryCount && (categoryCount)}
|
||||||
className={'mr-2'} />{category} {categoryCount && (categoryCount)}
|
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</Link>
|
</Link>
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import { faCopyright, faEye, faShieldAlt, faUsers, faHeart } from '@fortawesome/free-solid-svg-icons'
|
|
||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import BLOG from '@/blog.config'
|
import BLOG from '@/blog.config'
|
||||||
|
|
||||||
@@ -11,16 +9,16 @@ const Footer = ({ title }) => {
|
|||||||
<footer
|
<footer
|
||||||
className='dark:bg-gray-900 flex-shrink-0 justify-center text-center m-auto w-full leading-6 text-gray-400 text-sm p-6'
|
className='dark:bg-gray-900 flex-shrink-0 justify-center text-center m-auto w-full leading-6 text-gray-400 text-sm p-6'
|
||||||
>
|
>
|
||||||
<FontAwesomeIcon icon={faCopyright} /> {`${startYear}${currentYear}`} <span><FontAwesomeIcon icon={faHeart} className='mx-1 animate-pulse'/> <a href={BLOG.LINK} className='underline font-bold text-gray-500 dark:text-gray-300 '>{BLOG.AUTHOR}</a>.
|
<i className='fas fa-copyright' /> {`${startYear}${currentYear}`} <span><i className='mx-1 animate-pulse fas fa-heart'/> <a href={BLOG.LINK} className='underline font-bold text-gray-500 dark:text-gray-300 '>{BLOG.AUTHOR}</a>.
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
<span>Powered by <a href='https://notion.so' className='underline font-bold text-gray-500 dark:text-gray-300'>Notion</a> & <a href='https://github.com/tangly1024/NotionNext' className='underline font-bold text-gray-500 dark:text-gray-300'>NotionNext</a>.</span></span>
|
<span>Powered by <a href='https://notion.so' className='underline font-bold text-gray-500 dark:text-gray-300'>Notion</a> & <a href='https://github.com/tangly1024/NotionNext' className='underline font-bold text-gray-500 dark:text-gray-300'>NotionNext</a>.</span></span>
|
||||||
|
|
||||||
{BLOG.BEI_AN && <><br /><FontAwesomeIcon icon={faShieldAlt} /> <a href='https://beian.miit.gov.cn/' className='mr-2'>{BLOG.BEI_AN}</a><br/></>}
|
{BLOG.BEI_AN && <><br /><i className='fas fa-shield-alt'/> <a href='https://beian.miit.gov.cn/' className='mr-2'>{BLOG.BEI_AN}</a><br/></>}
|
||||||
<span className='hidden busuanzi_container_site_pv'>
|
<span className='hidden busuanzi_container_site_pv'>
|
||||||
<FontAwesomeIcon icon={faEye}/><span className='px-1 busuanzi_value_site_pv'> </span> </span>
|
<i className='fas fa-eye'/><span className='px-1 busuanzi_value_site_pv'> </span> </span>
|
||||||
<span className='pl-2 hidden busuanzi_container_site_uv'>
|
<span className='pl-2 hidden busuanzi_container_site_uv'>
|
||||||
<FontAwesomeIcon icon={faUsers}/> <span className='px-1 busuanzi_value_site_uv'> </span> </span>
|
<i className='fas fa-users'/> <span className='px-1 busuanzi_value_site_uv'> </span> </span>
|
||||||
<br/>
|
<br/>
|
||||||
<h1>{title}</h1>
|
<h1>{title}</h1>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
import { useGlobal } from '@/lib/global'
|
import { useGlobal } from '@/lib/global'
|
||||||
import { faArrowUp } from '@fortawesome/free-solid-svg-icons'
|
|
||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import CONFIG_MEDIUM from '../config_medium'
|
import CONFIG_MEDIUM from '../config_medium'
|
||||||
|
|
||||||
@@ -19,7 +17,7 @@ const JumpToTopButton = ({ showPercent = false, percent, className }) => {
|
|||||||
const { locale } = useGlobal()
|
const { locale } = useGlobal()
|
||||||
return (<div className={'flex space-x-1 items-center cursor-pointer w-full justify-center ' + className } onClick={() => window.scrollTo({ top: 0, behavior: 'smooth' })} >
|
return (<div className={'flex space-x-1 items-center cursor-pointer w-full justify-center ' + className } onClick={() => window.scrollTo({ top: 0, behavior: 'smooth' })} >
|
||||||
<div title={locale.POST.TOP} >
|
<div title={locale.POST.TOP} >
|
||||||
<FontAwesomeIcon icon={faArrowUp} />
|
<i className='fas fa-arrow-up'/>
|
||||||
</div>
|
</div>
|
||||||
{showPercent && (<div className='text-xs dark:text-gray-200 block lg:hidden'>{percent}%</div>)}
|
{showPercent && (<div className='text-xs dark:text-gray-200 block lg:hidden'>{percent}%</div>)}
|
||||||
</div>)
|
</div>)
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
|
||||||
import { faHome } from '@fortawesome/free-solid-svg-icons'
|
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
export default function LeftMenuBar () {
|
export default function LeftMenuBar () {
|
||||||
@@ -8,7 +6,7 @@ export default function LeftMenuBar () {
|
|||||||
<section>
|
<section>
|
||||||
<Link href='/'>
|
<Link href='/'>
|
||||||
<div className='text-center cursor-pointer hover:text-black'>
|
<div className='text-center cursor-pointer hover:text-black'>
|
||||||
<FontAwesomeIcon icon={faHome} size='lg' color='gray' />
|
<i className='fas fa-home text-gray-500'/>
|
||||||
</div>
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ const PaginationSimple = ({ page, totalPage }) => {
|
|||||||
} } passHref >
|
} } passHref >
|
||||||
<a
|
<a
|
||||||
rel='prev'
|
rel='prev'
|
||||||
className={`${currentPage === 1 ? 'invisible' : 'block'} text-center w-full duration-200 px-4 py-2 hover:border-black border-b-2 hover:font-bold`}
|
className={`${currentPage === 1 ? 'invisible' : 'block'} text-center w-full duration-200 px-4 py-2 hover:border-green-500 border-b-2 hover:font-bold`}
|
||||||
>
|
>
|
||||||
← {locale.PAGINATION.PREV}
|
← {locale.PAGINATION.PREV}
|
||||||
</a>
|
</a>
|
||||||
@@ -31,7 +31,7 @@ const PaginationSimple = ({ page, totalPage }) => {
|
|||||||
<Link href={ { pathname: `/page/${currentPage + 1}`, query: router.query.s ? { s: router.query.s } : {} } } passHref>
|
<Link href={ { pathname: `/page/${currentPage + 1}`, query: router.query.s ? { s: router.query.s } : {} } } passHref>
|
||||||
<a
|
<a
|
||||||
rel='next'
|
rel='next'
|
||||||
className={`${+showNext ? 'block' : 'invisible'} text-center w-full duration-200 px-4 py-2 hover:border-black border-b-2 hover:font-bold`}
|
className={`${+showNext ? 'block' : 'invisible'} text-center w-full duration-200 px-4 py-2 hover:border-green-500 border-b-2 hover:font-bold`}
|
||||||
>
|
>
|
||||||
{locale.PAGINATION.NEXT} →
|
{locale.PAGINATION.NEXT} →
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import { useRouter } from 'next/router'
|
import { useRouter } from 'next/router'
|
||||||
import { useImperativeHandle, useRef, useState } from 'react'
|
import { useImperativeHandle, useRef, useState } from 'react'
|
||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
|
||||||
import { faSearch, faSpinner, faTimes } from '@fortawesome/free-solid-svg-icons'
|
|
||||||
|
|
||||||
const SearchInput = ({ currentTag, currentSearch, cRef, className }) => {
|
const SearchInput = ({ currentTag, currentSearch, cRef, className }) => {
|
||||||
const [searchKey, setSearchKey] = useState(currentSearch || getSearchKey() || '')
|
const [searchKey, setSearchKey] = useState(currentSearch || getSearchKey() || '')
|
||||||
@@ -55,12 +53,12 @@ const SearchInput = ({ currentTag, currentSearch, cRef, className }) => {
|
|||||||
|
|
||||||
<div className='-ml-8 cursor-pointer dark:bg-gray-600 dark:hover:bg-gray-800 float-right items-center justify-center py-2'
|
<div className='-ml-8 cursor-pointer dark:bg-gray-600 dark:hover:bg-gray-800 float-right items-center justify-center py-2'
|
||||||
onClick={() => { handleSearch(searchKey) }}>
|
onClick={() => { handleSearch(searchKey) }}>
|
||||||
<FontAwesomeIcon spin={onLoading} icon={onLoading ? faSpinner : faSearch} className='hover:text-black transform duration-200 text-gray-500 cursor-pointer' />
|
<i className={`hover:text-black transform duration-200 text-gray-500 cursor-pointer fas ${onLoading ? 'fa-spinner animate-spin' : 'fa-search'} `} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{(searchKey && searchKey.length &&
|
{(searchKey && searchKey.length &&
|
||||||
<div className='-ml-12 cursor-pointer dark:bg-gray-600 dark:hover:bg-gray-800 float-right items-center justify-center py-2'>
|
<div className='-ml-12 cursor-pointer dark:bg-gray-600 dark:hover:bg-gray-800 float-right items-center justify-center py-2'>
|
||||||
<FontAwesomeIcon icon={faTimes} className='hover:text-black transform duration-200 text-gray-400 cursor-pointer' onClick={cleanSearch} />
|
<i className='fas fa-times hover:text-black transform duration-200 text-gray-400 cursor-pointer' onClick={cleanSearch} />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
import BLOG from '@/blog.config'
|
import BLOG from '@/blog.config'
|
||||||
import { faGithub, faTelegram, faTwitter, faWeibo } from '@fortawesome/free-brands-svg-icons'
|
|
||||||
import { faEnvelope, faRss } from '@fortawesome/free-solid-svg-icons'
|
|
||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -12,22 +9,22 @@ import React from 'react'
|
|||||||
const SocialButton = () => {
|
const SocialButton = () => {
|
||||||
return <div className='space-x-3 text-xl text-gray-600 dark:text-gray-400 flex-wrap flex justify-center '>
|
return <div className='space-x-3 text-xl text-gray-600 dark:text-gray-400 flex-wrap flex justify-center '>
|
||||||
{BLOG.CONTACT_GITHUB && <a target='_blank' rel='noreferrer' title={'github'} href={BLOG.CONTACT_GITHUB} >
|
{BLOG.CONTACT_GITHUB && <a target='_blank' rel='noreferrer' title={'github'} href={BLOG.CONTACT_GITHUB} >
|
||||||
<FontAwesomeIcon icon={faGithub} className='transform hover:scale-125 duration-150'/>
|
<i className='fab fa-github transform hover:scale-125 duration-150 hover:text-green-600'/>
|
||||||
</a>}
|
</a>}
|
||||||
{BLOG.CONTACT_TWITTER && <a target='_blank' rel='noreferrer' title={'twitter'} href={BLOG.CONTACT_TWITTER} >
|
{BLOG.CONTACT_TWITTER && <a target='_blank' rel='noreferrer' title={'twitter'} href={BLOG.CONTACT_TWITTER} >
|
||||||
<FontAwesomeIcon icon={faTwitter} className='transform hover:scale-125 duration-150'/>
|
<i className='fab fa-twitter transform hover:scale-125 duration-150 hover:text-green-600'/>
|
||||||
</a>}
|
</a>}
|
||||||
{BLOG.CONTACT_TELEGRAM && <a target='_blank' rel='noreferrer' href={BLOG.CONTACT_TELEGRAM} title={'telegram'} >
|
{BLOG.CONTACT_TELEGRAM && <a target='_blank' rel='noreferrer' href={BLOG.CONTACT_TELEGRAM} title={'telegram'} >
|
||||||
<FontAwesomeIcon icon={faTelegram} className='transform hover:scale-125 duration-150'/>
|
<i className='fab fa-telegram transform hover:scale-125 duration-150 hover:text-green-600'/>
|
||||||
</a>}
|
</a>}
|
||||||
{BLOG.CONTACT_WEIBO && <a target='_blank' rel='noreferrer' title={'weibo'} href={BLOG.CONTACT_WEIBO} >
|
{BLOG.CONTACT_WEIBO && <a target='_blank' rel='noreferrer' title={'weibo'} href={BLOG.CONTACT_WEIBO} >
|
||||||
<FontAwesomeIcon icon={faWeibo} className='transform hover:scale-125 duration-150'/>
|
<i className='fab fa-weibo transform hover:scale-125 duration-150 hover:text-green-600'/>
|
||||||
</a>}
|
</a>}
|
||||||
{BLOG.CONTACT_EMAIL && <a target='_blank' rel='noreferrer' title={'email'} href={`mailto:${BLOG.CONTACT_EMAIL}`} >
|
{BLOG.CONTACT_EMAIL && <a target='_blank' rel='noreferrer' title={'email'} href={`mailto:${BLOG.CONTACT_EMAIL}`} >
|
||||||
<FontAwesomeIcon icon={faEnvelope} className='transform hover:scale-125 duration-150'/>
|
<i className='fas fa-envelope transform hover:scale-125 duration-150 hover:text-green-600'/>
|
||||||
</a>}
|
</a>}
|
||||||
<a target='_blank' rel='noreferrer' title={'RSS'} href={'/feed'} >
|
<a target='_blank' rel='noreferrer' title={'RSS'} href={'/feed'} >
|
||||||
<FontAwesomeIcon icon={faRss} className='transform hover:scale-125 duration-150'/>
|
<i className='fas fa-rss transform hover:scale-125 duration-150 hover:text-green-600'/>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import { faTag } from '@fortawesome/free-solid-svg-icons'
|
|
||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
|
||||||
import TagItemMini from './TagItemMini'
|
import TagItemMini from './TagItemMini'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -13,7 +11,7 @@ const TagGroups = ({ tags, currentTag }) => {
|
|||||||
if (!tags) return <></>
|
if (!tags) return <></>
|
||||||
return (
|
return (
|
||||||
<div id='tags-group' className='dark:border-gray-600 py-4'>
|
<div id='tags-group' className='dark:border-gray-600 py-4'>
|
||||||
<div className='mb-2'><FontAwesomeIcon icon={faTag} className='mr-2' />标签</div>
|
<div className='mb-2'><i className='mr-2 fas fa-tag' />标签</div>
|
||||||
<div className='space-y-2'>
|
<div className='space-y-2'>
|
||||||
{
|
{
|
||||||
tags.map(tag => {
|
tags.map(tag => {
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import { faTag } from '@fortawesome/free-solid-svg-icons'
|
|
||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
|
|
||||||
const TagItemMini = ({ tag, selected = false }) => {
|
const TagItemMini = ({ tag, selected = false }) => {
|
||||||
@@ -9,7 +7,7 @@ const TagItemMini = ({ tag, selected = false }) => {
|
|||||||
${selected
|
${selected
|
||||||
? 'text-white dark:text-gray-300 bg-black dark:bg-black dark:hover:bg-gray-900'
|
? 'text-white dark:text-gray-300 bg-black dark:bg-black dark:hover:bg-gray-900'
|
||||||
: `text-gray-600 hover:shadow-xl dark:border-gray-400 notion-${tag.color}_background dark:bg-gray-800`}` }>
|
: `text-gray-600 hover:shadow-xl dark:border-gray-400 notion-${tag.color}_background dark:bg-gray-800`}` }>
|
||||||
<div className='font-light dark:text-gray-400'>{selected && <FontAwesomeIcon icon={faTag} className='mr-1'/>} {tag.name + (tag.count ? `(${tag.count})` : '')} </div>
|
<div className='font-light dark:text-gray-400'>{selected && <i className='mr-1 fas fa-tag'/>} {tag.name + (tag.count ? `(${tag.count})` : '')} </div>
|
||||||
</a>
|
</a>
|
||||||
</Link>
|
</Link>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,40 @@
|
|||||||
import LogoBar from '@/themes/Medium/components/LogoBar'
|
import LogoBar from '@/themes/Medium/components/LogoBar'
|
||||||
|
import Link from 'next/link'
|
||||||
|
import { useRouter } from 'next/router'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 顶部导航栏 + 菜单
|
||||||
|
* @param {} param0
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export default function TopNavBar (props) {
|
||||||
|
const { className, customNav } = props
|
||||||
|
const router = useRouter()
|
||||||
|
|
||||||
export default function TopNavBar ({ className }) {
|
|
||||||
return <div id='top-nav' className={'sticky top-0 lg:relative w-full z-50 ' + className}>
|
return <div id='top-nav' className={'sticky top-0 lg:relative w-full z-50 ' + className}>
|
||||||
<div className='flex w-full h-12 shadow bg-white px-5 items-center'>
|
<div className='flex w-full h-12 shadow bg-white px-5 items-between'>
|
||||||
<LogoBar />
|
<LogoBar />
|
||||||
|
|
||||||
|
{/* 顶部菜单 */}
|
||||||
|
<div className='flex'>
|
||||||
|
{customNav && customNav.map(link => {
|
||||||
|
if (link.show) {
|
||||||
|
const selected = (router.pathname === link.to) || (router.asPath === link.to)
|
||||||
|
return <Link key={`${link.id}-${link.to}`} title={link.to} href={link.to} >
|
||||||
|
<a className={'px-5 duration-300 text-base justify-between hover:text-green-600 hover:underline cursor-pointer flex flex-nowrap items-center ' +
|
||||||
|
(selected ? 'bg-green-600 text-white' : ' ')} >
|
||||||
|
<div className='items-center justify-center flex '>
|
||||||
|
<i className={link.icon} />
|
||||||
|
<div className='ml-4 whitespace-nowrap'>{link.name}</div>
|
||||||
|
</div>
|
||||||
|
{link.slot}
|
||||||
|
</a>
|
||||||
|
</Link>
|
||||||
|
} else {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,6 @@
|
|||||||
|
|
||||||
// export * from './Empty' // 空主题
|
// export * from './Empty' // 空主题
|
||||||
// export * from './NEXT'
|
// export * from './NEXT'
|
||||||
export * from './Fukasawa'
|
// export * from './Fukasawa'
|
||||||
// export * from './Hexo'
|
// export * from './Hexo'
|
||||||
// export * from './Medium'
|
export * from './Medium'
|
||||||
|
|||||||
Reference in New Issue
Block a user