0
0
mirror of https://github.com/yude-jp/yude.jp synced 2024-12-22 20:20:09 +09:00

Update how to load icons

This commit is contained in:
yude 2021-08-09 11:33:00 +09:00
parent b1dabb8fb9
commit ffc6acb9cb
Signed by: yude
GPG Key ID: EB0FE5D925C4A968
2 changed files with 15 additions and 15 deletions

View File

@ -1,16 +1,12 @@
// Router
// React Router
import { useRouter } from 'next/router'
import React, { useEffect, useState } from 'react'
// Next.js
import Link from 'next/link'
// Load FontAwesome
// Font Awesome
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 { icon, dest } = props

View File

@ -13,6 +13,10 @@ import useTranslation from 'next-translate/useTranslation'
// React Router
import { useRouter } from 'next/router'
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) {
const router = useRouter()
@ -34,16 +38,16 @@ export default function Index(props) {
{/* Index menu */}
<div className="grid grid-cols-4 gap-10">
<FontAwesomeMenu dest="/profile" icon={['fas', 'user']} />
<FontAwesomeMenu dest="/server" icon={['fas', 'server']} />
<FontAwesomeMenu dest="/house" icon={['fas', 'house-user']} />
<FontAwesomeMenu dest="https://scrapbox.io/yude" icon={['fas', 'book']} />
<FontAwesomeMenu dest="https://discord.gg/X6srY7X" icon={['fab', 'discord']} />
<FontAwesomeMenu dest="https://github.com/yudejp" icon={['fab', 'github']} />
<FontAwesomeMenu dest="https://git.yude.jp" icon={['fab', 'git']} />
<FontAwesomeMenu dest="https://mstdn.yude.jp" icon={['fab', 'mastodon']} />
<FontAwesomeMenu dest="/profile" icon={faUser} />
<FontAwesomeMenu dest="/server" icon={faServer} />
<FontAwesomeMenu dest="/house" icon={faHouseUser} />
<FontAwesomeMenu dest="https://scrapbox.io/yude" icon={faBook} />
<FontAwesomeMenu dest="https://discord.gg/X6srY7X" icon={faDiscord} />
<FontAwesomeMenu dest="https://github.com/yudejp" icon={faGithub} />
<FontAwesomeMenu dest="https://git.yude.jp" icon={faGit} />
<FontAwesomeMenu dest="https://mstdn.yude.jp" icon={faMastodon} />
<MinecraftMenu />
<FontAwesomeMenu dest="/mutual" icon={['fas', 'heart']} />
<FontAwesomeMenu dest="/mutual" icon={faHeart} />
</div>
{/* Banner */}