0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Added header to Recommendations table

refs https://github.com/TryGhost/Product/issues/4024
This commit is contained in:
Djordje Vlaisavljevic 2023-10-12 13:40:59 +01:00
parent d96eca7aaf
commit 45239fcc37

View file

@ -7,6 +7,7 @@ import React, {useState} from 'react';
import RecommendationIcon from './RecommendationIcon';
import Table, {ShowMoreData} from '../../../../admin-x-ds/global/Table';
import TableCell from '../../../../admin-x-ds/global/TableCell';
import TableHead from '../../../../admin-x-ds/global/TableHead';
import TableRow from '../../../../admin-x-ds/global/TableRow';
import Tooltip from '../../../../admin-x-ds/global/Tooltip';
import useRouting from '../../../../hooks/useRouting';
@ -53,7 +54,7 @@ const RecommendationItem: React.FC<{recommendation: Recommendation}> = ({recomme
</div>
</div>
</TableCell>
<TableCell className='hidden !pr-1 pl-0 text-right align-middle md:!visible md:!table-cell' onClick={showDetails}>
<TableCell className='hidden w-[1%] whitespace-nowrap !pr-1 pl-0 text-right align-middle md:!visible md:!table-cell' padding={false} onClick={showDetails}>
{(count === 0) ? (<span className="text-grey-500 dark:text-grey-900">-</span>) : (<div className='-mt-px items-end gap-1 text-right'>
<span className='text-right'>{numberWithCommas(count)}</span>
</div>)}
@ -86,8 +87,11 @@ const RecommendationList: React.FC<RecommendationListProps> = ({recommendations,
setTimeout(() => setCopied(false), 2000);
};
const tableHeader = (<><TableHead>Site</TableHead><TableHead colSpan={2}>Conversions from you</TableHead></>);
if (isLoading || recommendations.length) {
return <Table
header={tableHeader}
hint={<span className='flex items-center gap-1'>Shared with new members after signup, or anytime using <Link href={recommendationsURL} target='_blank'>this link</Link><Tooltip containerClassName='leading-none' content={copied ? 'Copied' : 'Copy link'} size='sm'><Button color='clear' hideLabel={true} icon={copied ? 'check-circle' : 'duplicate'} iconColorClass={copied ? 'text-green w-[14px] h-[14px]' : 'text-grey-600 hover:opacity-80 w-[14px] h-[14px]'} label={copied ? 'Copied' : 'Copy'} unstyled={true} onClick={copyRecommendationsUrl} /></Tooltip></span>}
isLoading={isLoading}
pagination={pagination}