mirror of
https://github.com/yude-jp/yude.jp
synced 2025-04-04 14:17:27 +09:00
Update how to load icons
This commit is contained in:
parent
b1dabb8fb9
commit
ffc6acb9cb
@ -1,16 +1,12 @@
|
|||||||
// Router
|
// React Router
|
||||||
import { useRouter } from 'next/router'
|
import { useRouter } from 'next/router'
|
||||||
import React, { useEffect, useState } from 'react'
|
import React, { useEffect, useState } from 'react'
|
||||||
|
|
||||||
// Next.js
|
// Next.js
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
|
|
||||||
// Load FontAwesome
|
// Font Awesome
|
||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
|
||||||
import { fab } from '@fortawesome/free-brands-svg-icons'
|
|
||||||
import { fas } from '@fortawesome/free-solid-svg-icons'
|
|
||||||
library.add(fab, fas)
|
|
||||||
|
|
||||||
const FontAwesomeMenu = (props) => {
|
const FontAwesomeMenu = (props) => {
|
||||||
const { icon, dest } = props
|
const { icon, dest } = props
|
||||||
|
@ -13,6 +13,10 @@ import useTranslation from 'next-translate/useTranslation'
|
|||||||
// React Router
|
// React Router
|
||||||
import { useRouter } from 'next/router'
|
import { useRouter } from 'next/router'
|
||||||
import MinecraftMenu from "./components/Menu/MinecraftMenu"
|
import MinecraftMenu from "./components/Menu/MinecraftMenu"
|
||||||
|
// Font Awesome
|
||||||
|
import { faDiscord, faGit, faMastodon, faGithub } from '@fortawesome/free-brands-svg-icons'
|
||||||
|
import { faBlog, faBook, faUser, faServer, faHouseUser, faHeart, faHome } from '@fortawesome/free-solid-svg-icons'
|
||||||
|
|
||||||
|
|
||||||
export default function Index(props) {
|
export default function Index(props) {
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
@ -34,16 +38,16 @@ export default function Index(props) {
|
|||||||
|
|
||||||
{/* Index menu */}
|
{/* Index menu */}
|
||||||
<div className="grid grid-cols-4 gap-10">
|
<div className="grid grid-cols-4 gap-10">
|
||||||
<FontAwesomeMenu dest="/profile" icon={['fas', 'user']} />
|
<FontAwesomeMenu dest="/profile" icon={faUser} />
|
||||||
<FontAwesomeMenu dest="/server" icon={['fas', 'server']} />
|
<FontAwesomeMenu dest="/server" icon={faServer} />
|
||||||
<FontAwesomeMenu dest="/house" icon={['fas', 'house-user']} />
|
<FontAwesomeMenu dest="/house" icon={faHouseUser} />
|
||||||
<FontAwesomeMenu dest="https://scrapbox.io/yude" icon={['fas', 'book']} />
|
<FontAwesomeMenu dest="https://scrapbox.io/yude" icon={faBook} />
|
||||||
<FontAwesomeMenu dest="https://discord.gg/X6srY7X" icon={['fab', 'discord']} />
|
<FontAwesomeMenu dest="https://discord.gg/X6srY7X" icon={faDiscord} />
|
||||||
<FontAwesomeMenu dest="https://github.com/yudejp" icon={['fab', 'github']} />
|
<FontAwesomeMenu dest="https://github.com/yudejp" icon={faGithub} />
|
||||||
<FontAwesomeMenu dest="https://git.yude.jp" icon={['fab', 'git']} />
|
<FontAwesomeMenu dest="https://git.yude.jp" icon={faGit} />
|
||||||
<FontAwesomeMenu dest="https://mstdn.yude.jp" icon={['fab', 'mastodon']} />
|
<FontAwesomeMenu dest="https://mstdn.yude.jp" icon={faMastodon} />
|
||||||
<MinecraftMenu />
|
<MinecraftMenu />
|
||||||
<FontAwesomeMenu dest="/mutual" icon={['fas', 'heart']} />
|
<FontAwesomeMenu dest="/mutual" icon={faHeart} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Banner */}
|
{/* Banner */}
|
||||||
|
Loading…
Reference in New Issue
Block a user