feat(fluxWizard): allow to specify exact content of copy-clipboard notification

pull/5852/head
Pavel Zavora 2022-02-02 12:31:28 +01:00
parent 4848895e73
commit dd012f96b9
1 changed files with 6 additions and 8 deletions

View File

@ -834,23 +834,21 @@ export const validateSuccess = (): Notification => ({
export const notifyCopyToClipboardSuccess = ( export const notifyCopyToClipboardSuccess = (
text: string | null, text: string | null,
title: string = '' title: string = '',
suffix: string = ' has been copied to clipboard.'
): Notification => ({ ): Notification => ({
...defaultSuccessNotification, ...defaultSuccessNotification,
icon: 'dash-h', icon: 'dash-h',
message: `${title}${ message: `${title}${text === null ? '' : "'" + text + "'"}${suffix}`,
text === null ? '' : "'" + text + "'"
} has been copied to clipboard.`,
}) })
export const notifyCopyToClipboardFailed = ( export const notifyCopyToClipboardFailed = (
text: string | null, text: string | null,
title: string = '' title: string = '',
suffix: string = ' was not copied to clipboard.'
): Notification => ({ ): Notification => ({
...defaultErrorNotification, ...defaultErrorNotification,
message: `${title}${ message: `${title}${text === null ? '' : "'" + text + "'"}${suffix}`,
text === null ? '' : "'" + text + "'"
} was not copied to clipboard.`,
}) })
export const notifyFluxNameAlreadyTaken = (fluxName: string): Notification => ({ export const notifyFluxNameAlreadyTaken = (fluxName: string): Notification => ({