mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 14:03:48 +03:00
Wired save button state for portal settings modal
refs https://github.com/TryGhost/Product/issues/3545 - adds dynamic loading state for portal modal save button
This commit is contained in:
parent
ad0e52ac39
commit
26c2590923
@ -63,6 +63,7 @@ const PortalModal: React.FC = () => {
|
||||
const modal = useModal();
|
||||
|
||||
const [selectedPreviewTab, setSelectedPreviewTab] = useState('signup');
|
||||
|
||||
const {settings, saveSettings, siteData} = useContext(SettingsContext);
|
||||
const {data: tiers, update: updateTiers} = useTiers();
|
||||
|
||||
@ -143,11 +144,17 @@ const PortalModal: React.FC = () => {
|
||||
{id: 'account', title: 'Account page'},
|
||||
{id: 'links', title: 'Links'}
|
||||
];
|
||||
let okLabel = 'Save & close';
|
||||
if (saveState === 'saving') {
|
||||
okLabel = 'Saving...';
|
||||
} else if (saveState === 'saved') {
|
||||
okLabel = 'Saved';
|
||||
}
|
||||
|
||||
return <PreviewModalContent
|
||||
deviceSelector={selectedPreviewTab !== 'links'}
|
||||
dirty={saveState === 'unsaved'}
|
||||
okLabel='Save & close'
|
||||
okLabel={okLabel}
|
||||
preview={preview}
|
||||
previewBgColor={selectedPreviewTab === 'links' ? 'white' : 'grey'}
|
||||
previewToolbarTabs={previewTabs}
|
||||
|
Loading…
Reference in New Issue
Block a user