refactor(v4): plugin icon as react component
parent
3d6bd45a6d
commit
db9745ef81
|
@ -0,0 +1,13 @@
|
|||
/**
|
||||
*
|
||||
* PluginIcon
|
||||
*
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { Icon } from '@strapi/design-system/Icon';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
|
||||
const PluginIcon = () => <Icon as={() => <FontAwesomeIcon icon="sync" />} width="16px" />;
|
||||
|
||||
export default PluginIcon;
|
|
@ -1,17 +1,17 @@
|
|||
import { prefixPluginTranslations } from '@strapi/helper-plugin';
|
||||
import pluginPkg from '../../package.json';
|
||||
import pluginId from './helpers/pluginId';
|
||||
import pluginIcon from './components/PluginIcon';
|
||||
// import pluginPermissions from './permissions';
|
||||
// import getTrad from './helpers/getTrad';
|
||||
|
||||
const pluginDescription = pluginPkg.strapi.description || pluginPkg.description;
|
||||
const { icon, name } = pluginPkg.strapi;
|
||||
const { name } = pluginPkg.strapi;
|
||||
|
||||
export default {
|
||||
register(app) {
|
||||
app.registerPlugin({
|
||||
description: pluginDescription,
|
||||
icon,
|
||||
id: pluginId,
|
||||
isReady: true,
|
||||
isRequired: pluginPkg.strapi.required || false,
|
||||
|
@ -20,7 +20,7 @@ export default {
|
|||
|
||||
app.addMenuLink({
|
||||
to: `/plugins/${pluginId}`,
|
||||
icon,
|
||||
icon: pluginIcon,
|
||||
intlLabel: {
|
||||
id: `${pluginId}.plugin.name`,
|
||||
defaultMessage: 'Config Sync',
|
||||
|
|
|
@ -39,9 +39,10 @@
|
|||
"strapi-server.js"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@fortawesome/react-fontawesome": "^0.1.16",
|
||||
"@strapi/design-system": "0.0.1-alpha.51",
|
||||
"@strapi/helper-plugin": "4.0.0-beta.6",
|
||||
"@strapi/icons": "0.0.1-alpha.51",
|
||||
"@strapi/design-system": "0.0.1-alpha.51",
|
||||
"@strapi/utils": "4.0.0-beta.6",
|
||||
"babel-eslint": "9.0.0",
|
||||
"codecov": "^3.8.3",
|
||||
|
|
|
@ -625,7 +625,7 @@
|
|||
dependencies:
|
||||
"@fortawesome/fontawesome-common-types" "^0.2.36"
|
||||
|
||||
"@fortawesome/react-fontawesome@^0.1.14", "@fortawesome/react-fontawesome@^0.1.4":
|
||||
"@fortawesome/react-fontawesome@^0.1.14", "@fortawesome/react-fontawesome@^0.1.16", "@fortawesome/react-fontawesome@^0.1.4":
|
||||
version "0.1.16"
|
||||
resolved "https://registry.yarnpkg.com/@fortawesome/react-fontawesome/-/react-fontawesome-0.1.16.tgz#ce7665490214e20f929368d6b65f68884a99276a"
|
||||
integrity sha512-aLmzDwC9rEOAJv2UJdMns89VZR5Ry4IHu5dQQh24Z/lWKEm44lfQr1UNalZlkUaQN8d155tNh+CS7ntntj1VMA==
|
||||
|
|
Loading…
Reference in New Issue