Fixed plugin icons not showing up for sidebar

This commit is contained in:
Aurora Lahtela 2022-09-06 12:17:39 +03:00
parent f3cc34d765
commit 12ce145345
2 changed files with 4 additions and 4 deletions

View File

@ -23,10 +23,10 @@ import {useMetadata} from "../../hooks/metadataHook";
import {faCalendarCheck} from "@fortawesome/free-regular-svg-icons";
import {SwitchTransition} from "react-transition-group";
import MainPageRedirect from "../../components/navigation/MainPageRedirect";
import ExtensionIcon from "../../components/extensions/ExtensionIcon";
import {ServerExtensionContextProvider, useServerExtensionContext} from "../../hooks/serverExtensionDataContext";
import {useDataRequest} from "../../hooks/dataFetchHook";
import {fetchNetworkMetadata} from "../../service/metadataService";
import {iconTypeToFontAwesomeClass} from "../../util/icons";
const NetworkSidebar = () => {
const {t, i18n} = useTranslation();
@ -89,7 +89,7 @@ const NetworkSidebar = () => {
.map(info => {
return {
name: info.pluginName,
icon: <ExtensionIcon icon={info.icon}/>,
icon: [iconTypeToFontAwesomeClass(info.icon.family), info.icon.iconName],
href: `plugins/${encodeURIComponent(info.pluginName)}`
}
}).forEach(item => items.push(item))

View File

@ -27,8 +27,8 @@ import {SwitchTransition} from "react-transition-group";
import MainPageRedirect from "../../components/navigation/MainPageRedirect";
import {useDataRequest} from "../../hooks/dataFetchHook";
import {fetchServerIdentity} from "../../service/serverService";
import ExtensionIcon from "../../components/extensions/ExtensionIcon";
import {ServerExtensionContextProvider, useServerExtensionContext} from "../../hooks/serverExtensionDataContext";
import {iconTypeToFontAwesomeClass} from "../../util/icons";
const ServerSidebar = () => {
const {t, i18n} = useTranslation();
@ -87,7 +87,7 @@ const ServerSidebar = () => {
.map(info => {
return {
name: info.pluginName,
icon: <ExtensionIcon icon={info.icon}/>,
icon: [iconTypeToFontAwesomeClass(info.icon.family), info.icon.iconName],
href: `plugins/${encodeURIComponent(info.pluginName)}`
}
}).forEach(item => items.push(item))