Skip to content

Commit

Permalink
Added success notification when switching to new installed theme
Browse files Browse the repository at this point in the history
refs DES-76
  • Loading branch information
djordjevlais committed Feb 6, 2024
1 parent aa29e8f commit d59775c
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import NiceModal from '@ebay/nice-modal-react';
import React from 'react';
import {Button, ButtonProps, ConfirmationModal, List, ListItem, Menu, ModalPage} from '@tryghost/admin-x-design-system';
import {Button, ButtonProps, ConfirmationModal, List, ListItem, Menu, ModalPage, showToast} from '@tryghost/admin-x-design-system';
import {Theme, isActiveTheme, isDefaultTheme, isDeletableTheme, isLegacyTheme, useActivateTheme, useDeleteTheme} from '@tryghost/admin-x-framework/api/themes';
import {downloadFile, getGhostPaths} from '@tryghost/admin-x-framework/helpers';
import {useHandleError} from '@tryghost/admin-x-framework/hooks';
Expand Down Expand Up @@ -51,6 +51,10 @@ const ThemeActions: React.FC<ThemeActionProps> = ({
const handleActivate = async () => {
try {
await activateTheme(theme.name);
showToast({
type: 'success',
message: <div><span className='capitalize'>{theme.name}</span> is now your active theme.</div>
});
} catch (e) {
handleError(e);
}
Expand Down

0 comments on commit d59775c

Please sign in to comment.