mirror of
https://github.com/strapi/strapi.git
synced 2025-09-03 13:50:38 +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 React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useIntl } from 'react-intl';
|
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 { Button } from '@buffetjs/core';
|
||||||
import { CheckPermissions } from '@strapi/helper-plugin';
|
import { CheckPermissions } from '@strapi/helper-plugin';
|
||||||
import openWithNewTab from '../../utils/openWithNewTab';
|
import openWithNewTab from '../../utils/openWithNewTab';
|
||||||
@ -37,7 +37,6 @@ const Header = ({ currentDocVersion, docPrefixURL }) => {
|
|||||||
defaultMessage: 'Update',
|
defaultMessage: 'Update',
|
||||||
}),
|
}),
|
||||||
color: 'success',
|
color: 'success',
|
||||||
// onClick: () => {},
|
|
||||||
type: 'submit',
|
type: 'submit',
|
||||||
key: 'button-submit',
|
key: 'button-submit',
|
||||||
Component: props => (
|
Component: props => (
|
||||||
@ -49,7 +48,7 @@ const Header = ({ currentDocVersion, docPrefixURL }) => {
|
|||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Base
|
<BaseHeader
|
||||||
actions={headerActions}
|
actions={headerActions}
|
||||||
content={formatMessage({
|
content={formatMessage({
|
||||||
id: getTrad('containers.HomePage.PluginHeader.description'),
|
id: getTrad('containers.HomePage.PluginHeader.description'),
|
||||||
|
@ -11,6 +11,16 @@ const ButtonContainer = ({ currentDocVersion, isHeader, onClick, onClickDelete,
|
|||||||
return <div />;
|
return <div />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const handleClickGenerate = e => {
|
||||||
|
e.preventDefault();
|
||||||
|
onClick(version);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleDelete = e => {
|
||||||
|
e.preventDefault();
|
||||||
|
onClickDelete(version);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<StyledButton
|
<StyledButton
|
||||||
@ -26,22 +36,13 @@ const ButtonContainer = ({ currentDocVersion, isHeader, onClick, onClickDelete,
|
|||||||
<StyledButton
|
<StyledButton
|
||||||
// FIXME when new DS ready
|
// FIXME when new DS ready
|
||||||
type="generateDocumentation"
|
type="generateDocumentation"
|
||||||
onClick={e => {
|
onClick={handleClickGenerate}
|
||||||
e.preventDefault();
|
|
||||||
onClick(version);
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<FormattedMessage id="documentation.components.Row.regenerate" />
|
<FormattedMessage id="documentation.components.Row.regenerate" />
|
||||||
</StyledButton>
|
</StyledButton>
|
||||||
</CheckPermissions>
|
</CheckPermissions>
|
||||||
<CheckPermissions permissions={pluginPermissions.update}>
|
<CheckPermissions permissions={pluginPermissions.update}>
|
||||||
<StyledButton
|
<StyledButton type={version === currentDocVersion ? '' : 'trash'} onClick={handleDelete} />
|
||||||
type={version === currentDocVersion ? '' : 'trash'}
|
|
||||||
onClick={e => {
|
|
||||||
e.preventDefault();
|
|
||||||
onClickDelete(version);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</CheckPermissions>
|
</CheckPermissions>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user