Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(cm): changed the Configure the view link icon in the edit view #20274

Merged
merged 3 commits into from
May 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
useQueryParams,
} from '@strapi/admin/strapi-admin';
import { Flex, SingleSelect, SingleSelectOption, Typography } from '@strapi/design-system';
import { Cog, Pencil, Trash, WarningCircle } from '@strapi/icons';
import { ListPlus, Pencil, Trash, WarningCircle } from '@strapi/icons';
import { useIntl } from 'react-intl';
import { useMatch, useNavigate } from 'react-router-dom';
import styled from 'styled-components';
Expand Down Expand Up @@ -376,7 +376,7 @@ const ConfigureTheViewAction: DocumentActionComponent = ({ collectionType, model
id: 'app.links.configure-view',
defaultMessage: 'Configure the view',
}),
icon: <StyledCog />,
icon: <ListPlus />,
onClick: () => {
navigate(`../${collectionType}/${model}/configurations/edit`);
},
Expand All @@ -386,16 +386,6 @@ const ConfigureTheViewAction: DocumentActionComponent = ({ collectionType, model

ConfigureTheViewAction.type = 'configure-the-view';

/**
* Because the icon system is completely broken, we have to do
* this to remove the fill from the cog.
*/
const StyledCog = styled(Cog)`
path {
fill: currentColor;
}
`;

const EditTheModelAction: DocumentActionComponent = ({ model }) => {
const navigate = useNavigate();
const { formatMessage } = useIntl();
Expand All @@ -405,7 +395,7 @@ const EditTheModelAction: DocumentActionComponent = ({ model }) => {
id: 'content-manager.link-to-ctb',
defaultMessage: 'Edit the model',
}),
icon: <StyledPencil />,
icon: <Pencil />,
onClick: () => {
navigate(`/plugins/content-type-builder/content-types/${model}`);
},
Expand All @@ -415,16 +405,6 @@ const EditTheModelAction: DocumentActionComponent = ({ model }) => {

EditTheModelAction.type = 'edit-the-model';

/**
* Because the icon system is completely broken, we have to do
* this to remove the fill from the cog.
*/
const StyledPencil = styled(Pencil)`
path {
fill: currentColor;
}
`;

const DeleteAction: DocumentActionComponent = ({ documentId, model, collectionType, document }) => {
const navigate = useNavigate();
const { formatMessage } = useIntl();
Expand All @@ -440,7 +420,7 @@ const DeleteAction: DocumentActionComponent = ({ documentId, model, collectionTy
id: 'content-manager.actions.delete.label',
defaultMessage: 'Delete document',
}),
icon: <StyledTrash />,
icon: <Trash />,
dialog: {
type: 'dialog',
title: formatMessage({
Expand Down Expand Up @@ -510,16 +490,6 @@ const DeleteAction: DocumentActionComponent = ({ documentId, model, collectionTy

DeleteAction.type = 'delete';

/**
* Because the icon system is completely broken, we have to do
* this to remove the fill from the cog.
*/
const StyledTrash = styled(Trash)`
path {
fill: currentColor;
}
`;

const DEFAULT_HEADER_ACTIONS = [EditTheModelAction, ConfigureTheViewAction, DeleteAction];

export { Header, DEFAULT_HEADER_ACTIONS };
Expand Down