mirror of
https://github.com/strapi/strapi.git
synced 2025-08-31 12:23:05 +00:00
Fix PR feedback
Signed-off-by: soupette <cyril.lpz@gmail.com>
This commit is contained in:
parent
3a90e30271
commit
7bcdecd2cf
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useIntl } from 'react-intl';
|
||||
import { Header as Base } from '@buffetjs/custom';
|
||||
import { Header as BaseHeader } from '@buffetjs/custom';
|
||||
import { Button } from '@buffetjs/core';
|
||||
import { CheckPermissions } from '@strapi/helper-plugin';
|
||||
import openWithNewTab from '../../utils/openWithNewTab';
|
||||
@ -37,7 +37,6 @@ const Header = ({ currentDocVersion, docPrefixURL }) => {
|
||||
defaultMessage: 'Update',
|
||||
}),
|
||||
color: 'success',
|
||||
// onClick: () => {},
|
||||
type: 'submit',
|
||||
key: 'button-submit',
|
||||
Component: props => (
|
||||
@ -49,7 +48,7 @@ const Header = ({ currentDocVersion, docPrefixURL }) => {
|
||||
];
|
||||
|
||||
return (
|
||||
<Base
|
||||
<BaseHeader
|
||||
actions={headerActions}
|
||||
content={formatMessage({
|
||||
id: getTrad('containers.HomePage.PluginHeader.description'),
|
||||
|
@ -11,6 +11,16 @@ const ButtonContainer = ({ currentDocVersion, isHeader, onClick, onClickDelete,
|
||||
return <div />;
|
||||
}
|
||||
|
||||
const handleClickGenerate = e => {
|
||||
e.preventDefault();
|
||||
onClick(version);
|
||||
};
|
||||
|
||||
const handleDelete = e => {
|
||||
e.preventDefault();
|
||||
onClickDelete(version);
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<StyledButton
|
||||
@ -26,22 +36,13 @@ const ButtonContainer = ({ currentDocVersion, isHeader, onClick, onClickDelete,
|
||||
<StyledButton
|
||||
// FIXME when new DS ready
|
||||
type="generateDocumentation"
|
||||
onClick={e => {
|
||||
e.preventDefault();
|
||||
onClick(version);
|
||||
}}
|
||||
onClick={handleClickGenerate}
|
||||
>
|
||||
<FormattedMessage id="documentation.components.Row.regenerate" />
|
||||
</StyledButton>
|
||||
</CheckPermissions>
|
||||
<CheckPermissions permissions={pluginPermissions.update}>
|
||||
<StyledButton
|
||||
type={version === currentDocVersion ? '' : 'trash'}
|
||||
onClick={e => {
|
||||
e.preventDefault();
|
||||
onClickDelete(version);
|
||||
}}
|
||||
/>
|
||||
<StyledButton type={version === currentDocVersion ? '' : 'trash'} onClick={handleDelete} />
|
||||
</CheckPermissions>
|
||||
</div>
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user