mirror of
https://github.com/TryGhost/Ghost.git
synced 2023-12-13 21:00:40 +01:00
Added "Recommend back" button to settings
refs https://github.com/TryGhost/Product/issues/3978
This commit is contained in:
parent
b1e4ead01c
commit
27caa288e2
2 changed files with 15 additions and 3 deletions
|
@ -36,8 +36,8 @@ const TableRow: React.FC<TableRowProps> = ({id, action, hideActions, className,
|
|||
<tr className={tableRowClasses} data-testid={testId} id={id} onClick={handleClick}>
|
||||
{children}
|
||||
{action &&
|
||||
<td className={`hover:cursor-pointer`}>
|
||||
<div className={`visible flex items-center justify-end px-6 py-3 ${hideActions ? 'group-hover/table-row:visible md:invisible' : ''}`}>
|
||||
<td className={`p-0 hover:cursor-pointer`}>
|
||||
<div className={`visible flex items-center justify-end py-3 pr-6 ${hideActions ? 'group-hover/table-row:visible md:invisible' : ''}`}>
|
||||
{action}
|
||||
</div>
|
||||
</td>
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
import Button from '../../../../admin-x-ds/global/Button';
|
||||
import NoValueLabel from '../../../../admin-x-ds/global/NoValueLabel';
|
||||
import React, {useMemo} from 'react';
|
||||
import RecommendationIcon from './RecommendationIcon';
|
||||
import Table, {ShowMoreData} from '../../../../admin-x-ds/global/Table';
|
||||
import TableCell from '../../../../admin-x-ds/global/TableCell';
|
||||
import TableRow from '../../../../admin-x-ds/global/TableRow';
|
||||
import useRouting from '../../../../hooks/useRouting';
|
||||
import {Mention} from '../../../../api/mentions';
|
||||
import {PaginationData} from '../../../../hooks/usePagination';
|
||||
import {ReferrerHistoryItem} from '../../../../api/referrers';
|
||||
|
@ -43,8 +45,18 @@ const IncomingRecommendationItem: React.FC<{mention: Mention, stats: ReferrerHis
|
|||
|
||||
const freeMembersLabel = (signups) === 1 ? 'free member' : 'free members';
|
||||
|
||||
const {updateRoute} = useRouting();
|
||||
|
||||
const action = (
|
||||
<div className="flex items-center justify-end">
|
||||
<Button color='green' label='Recommend back' size='sm' link onClick={() => {
|
||||
updateRoute({route: `recommendations/add?url=${cleanedSource}`});
|
||||
}} />
|
||||
</div>
|
||||
);
|
||||
|
||||
return (
|
||||
<TableRow hideActions>
|
||||
<TableRow action={action} hideActions>
|
||||
<TableCell onClick={showDetails}>
|
||||
<div className='group flex items-center gap-3 hover:cursor-pointer'>
|
||||
<div className={`flex grow flex-col`}>
|
||||
|
|
Loading…
Reference in a new issue