Skip to content

Commit d1e102c

Browse files
committed
fixed CF Icon
1 parent c784f72 commit d1e102c

File tree

3 files changed

+25
-62
lines changed

3 files changed

+25
-62
lines changed

admin/src/components/AITextIcon/index.js

Lines changed: 0 additions & 25 deletions
This file was deleted.

admin/src/components/PluginIcon/index.js

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,28 @@
55
*/
66

77
import React from 'react';
8-
import Puzzle from '@strapi/icons/Puzzle';
8+
import styled from 'styled-components';
9+
import { Icon } from '@strapi/design-system/Icon';
10+
import { Flex } from '@strapi/design-system/Flex';
11+
import Pencil from '@strapi/icons/Pencil';
912

10-
const PluginIcon = () => <Puzzle />;
1113

12-
export default PluginIcon;
14+
const IconBox = styled(Flex)`
15+
/* Hard code color values */
16+
/* to stay consistent between themes */
17+
background-color: #f0f0ff; /* primary100 */
18+
border: 1px solid #d9d8ff; /* primary200 */
19+
svg > path {
20+
fill: #4945ff; /* primary600 */
21+
}
22+
`;
23+
24+
const PluginIcon = () => {
25+
return (
26+
<IconBox justifyContent="center" alignItems="center" width={7} height={6} hasRadius aria-hidden>
27+
<Icon as={Pencil} />
28+
</IconBox>
29+
);
30+
};
31+
32+
export default PluginIcon;

admin/src/index.js

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,14 @@
11
import { prefixPluginTranslations } from '@strapi/helper-plugin';
22
import pluginPkg from '../../package.json';
33
import pluginId from './pluginId';
4-
import Initializer from './components/Initializer';
54
import PluginIcon from './components/PluginIcon';
6-
import AITextIcon from './components/PluginIcon';
75

86

97
const name = pluginPkg.strapi.name;
108

119
export default {
1210
register(app) {
13-
// app.addMenuLink({
14-
// to: `/plugins/${pluginId}`,
15-
// icon: PluginIcon,
16-
// intlLabel: {
17-
// id: `${pluginId}.plugin.name`,
18-
// defaultMessage: name,
19-
// },
20-
// Component: async () => {
21-
// const component = await import(/* webpackChunkName: "[request]" */ './pages/App');
22-
23-
// return component;
24-
// },
25-
// permissions: [
26-
// // Uncomment to set the permissions of the plugin here
27-
// // {
28-
// // action: '', // the action name should be plugin::plugin-name.actionType
29-
// // subject: null,
30-
// // },
31-
// ],
32-
// });
33-
// app.registerPlugin({
34-
// id: pluginId,
35-
// initializer: Initializer,
36-
// isReady: false,
37-
// name,
38-
// });
11+
3912
app.customFields.register({
4013
name: "text-ai",
4114
pluginId: "ai-text-generation", // the custom field is created by a color-picker plugin
@@ -61,15 +34,10 @@ export default {
6134
{
6235
sectionTitle: { // Add a "Format" settings section
6336
id: 'ai-text-generation.text-ai.api.details',
64-
defaultMessage: 'API Details',
37+
defaultMessage: 'Text Details',
6538
},
6639
items: [ // Add settings items to the section
6740
{
68-
/*
69-
Add a "Color format" dropdown
70-
to choose between 2 different format options
71-
for the color value: hexadecimal or RGBA
72-
*/
7341
intlLabel: {
7442
id: 'ai-text-generation.text-ai.key',
7543
defaultMessage: 'Key',

0 commit comments

Comments
 (0)