Made description clearer and added link to preview recommendations modal

refs https://github.com/TryGhost/Product/issues/3816
This commit is contained in:
Djordje Vlaisavljevic 2023-09-04 21:48:23 +01:00
parent a017596a1d
commit 187f369720

View File

@ -1,4 +1,5 @@
import Button from '../../../admin-x-ds/global/Button';
import Link from '../../../admin-x-ds/global/Link';
import React, {useState} from 'react';
import RecommendationList from './recommendations/RecommendationList';
import SettingGroup from '../../../admin-x-ds/settings/SettingGroup';
@ -10,6 +11,7 @@ import {useBrowseRecommendations} from '../../../api/recommendations';
const Recommendations: React.FC<{ keywords: string[] }> = ({keywords}) => {
const {
saveState,
siteData,
handleSave
} = useSettingGroup();
const {data: {recommendations} = {}} = useBrowseRecommendations();
@ -26,23 +28,30 @@ const Recommendations: React.FC<{ keywords: string[] }> = ({keywords}) => {
}} />
);
const recommendationsURL = `${siteData?.url.replace(/\/$/, '')}/#/portal/recommendations`;
const tabs = [
{
id: 'your-recommendations',
title: 'Your recommendations',
contents: (<RecommendationList recommendations={recommendations ?? []} />)
},
{
id: 'recommending-you',
title: 'Recommending you',
contents: (<RecommendationList recommendations={[]} />)
}
// TODO: Show "Recommending you" tab once we hook it up
// {
// id: 'recommending-you',
// title: 'Recommending you',
// contents: (<RecommendationList recommendations={[]} />)
// }
];
const groupDescription = (
<>Share favorite sites with your audience after they subscribe. <Link href={recommendationsURL} target='_blank'>Preview</Link></>
);
return (
<SettingGroup
customButtons={buttons}
description="Share favorite sites with your audience"
description={groupDescription}
keywords={keywords}
navid='recommendations'
saveState={saveState}