feat: add custom FontAwesome Pro books icon for Archive tab

This commit is contained in:
Gigi
2025-10-13 12:28:08 +02:00
parent 44fcd74cbe
commit 7d47f0a86e
2 changed files with 27 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
import React, { useState, useEffect } from 'react'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faSpinner, faExclamationCircle, faHighlighter, faBookmark, faBook } from '@fortawesome/free-solid-svg-icons'
import { faSpinner, faExclamationCircle, faHighlighter, faBookmark } from '@fortawesome/free-solid-svg-icons'
import { Hooks } from 'applesauce-react'
import { RelayPool } from 'applesauce-relay'
import { nip19 } from 'nostr-tools'
@@ -13,6 +13,7 @@ import { BlogPostPreview } from '../services/exploreService'
import { Bookmark } from '../types/bookmarks'
import AuthorCard from './AuthorCard'
import BlogPostCard from './BlogPostCard'
import { faBooks } from '../icons/customIcons'
interface MeProps {
relayPool: RelayPool
@@ -190,7 +191,7 @@ const Me: React.FC<MeProps> = ({ relayPool }) => {
data-tab="archive"
onClick={() => setActiveTab('archive')}
>
<FontAwesomeIcon icon={faBook} />
<FontAwesomeIcon icon={faBooks} />
Archive ({readArticles.length})
</button>
</div>

24
src/icons/customIcons.ts Normal file
View File

@@ -0,0 +1,24 @@
import { IconDefinition } from '@fortawesome/fontawesome-svg-core'
/**
* Custom icon definitions for FontAwesome Pro icons
* or any custom SVG icons that aren't in the free tier
*/
/**
* Books icon from FontAwesome Pro Regular
* Source: https://github.com/vanphonggiang/font-awesome-6-pro/blob/main/svgs/regular/books.svg
*/
export const faBooks: IconDefinition = {
prefix: 'far',
iconName: 'books',
icon: [
512, // viewBox width
512, // viewBox height
[], // ligatures
'e002', // unicode
// SVG path data from the books.svg file
'M232 0c-13.3 0-24 10.7-24 24V488c0 13.3 10.7 24 24 24h48c13.3 0 24-10.7 24-24V24c0-13.3-10.7-24-24-24H232zm8 464V48h32V464H240zM96 64c-13.3 0-24 10.7-24 24V488c0 13.3 10.7 24 24 24h48c13.3 0 24-10.7 24-24V88c0-13.3-10.7-24-24-24H96zm8 400V112h32V464H104zM368 64c-13.3 0-24 10.7-24 24V488c0 13.3 10.7 24 24 24h48c13.3 0 24-10.7 24-24V88c0-13.3-10.7-24-24-24H368zm8 400V112h32V464H376z'
]
}