diff --git a/apps/admin-x-settings/src/components/settings/general/LockSite.tsx b/apps/admin-x-settings/src/components/settings/general/LockSite.tsx index 70f1c03657..969bfc0d1a 100644 --- a/apps/admin-x-settings/src/components/settings/general/LockSite.tsx +++ b/apps/admin-x-settings/src/components/settings/general/LockSite.tsx @@ -1,10 +1,12 @@ import React from 'react'; import TopLevelGroup from '../../TopLevelGroup'; import useSettingGroup from '../../../hooks/useSettingGroup'; -import {Icon, Link, SettingGroupContent, TextField, Toggle, withErrorBoundary} from '@tryghost/admin-x-design-system'; +import {Hint, Icon, Separator, SettingGroupContent, TextField, Toggle, withErrorBoundary} from '@tryghost/admin-x-design-system'; import {getSettingValues} from '@tryghost/admin-x-framework/api/settings'; +import {useGlobalData} from '../../providers/GlobalDataProvider'; const LockSite: React.FC<{ keywords: string[] }> = ({keywords}) => { + const {siteData} = useGlobalData(); const { localSettings, isEditing, @@ -27,7 +29,7 @@ const LockSite: React.FC<{ keywords: string[] }> = ({keywords}) => { } }); - const [passwordEnabled, password] = getSettingValues(localSettings, ['is_private', 'password']) as [boolean, string]; + const [passwordEnabled, password, publicHash] = getSettingValues(localSettings, ['is_private', 'password', 'public_hash']) as [boolean, string, string]; const handleToggleChange = (e: React.ChangeEvent) => { updateSetting('is_private', e.target.checked); @@ -37,15 +39,30 @@ const LockSite: React.FC<{ keywords: string[] }> = ({keywords}) => { updateSetting('password', e.target.value); }; + const privateRssUrl = `${siteData.url.replace(/\/$/, '')}/${publicHash}/rss`; + const hint = ( + <>A private RSS feed is available at {privateRssUrl} + ); + const values = ( - - Your site is password protected +
+
+ {/*
*/} + + {/*
*/} +
+ Your site is password protected +
+
+ {hint &&
+ + {hint} +
}
) : (
@@ -58,10 +75,6 @@ const LockSite: React.FC<{ keywords: string[] }> = ({keywords}) => { /> ); - const hint = ( - <>A private RSS feed is available at http://localhost:2368/51aa059ba6eb50c24c14047d4255ac/rss - ); - const inputs = ( = ({keywords}) => { {passwordEnabled &&