diff --git a/src/content/locals.ts b/src/content/locals.ts index 269f87d2e..9341ebc20 100644 --- a/src/content/locals.ts +++ b/src/content/locals.ts @@ -52,14 +52,13 @@ export const locals: { [key: string]: any } = { statusUptoDate: 'No change', statusUnpublished: 'Unpublished', statusRemoteChanges: 'Remote changes', - statusWaiting: 'Waiting…', + statusWaiting: 'Pending…', statusNotFound: 'Not found', publish: 'Publish…', unpublish: 'Unpublish', synchronize: 'Synchronize…', revert: 'Revert', detach: 'Detach', - waiting: 'Waiting…', signIn: 'Sign in to publish', }, relaunch: { @@ -456,6 +455,11 @@ export const locals: { [key: string]: any } = { 'A top analytics platform for tracking and understanding user interactions', }, }, + pending: { + announcements: 'Pending announcements…', + primaryAction: '………', + secondaryAction: '………', + }, success: { publication: '✓ The palette has been published', nonPublication: '✓ The palette has been unpublished', @@ -511,6 +515,7 @@ export const locals: { [key: string]: any } = { addToFile: '✕ The palette cannot be added', noInternetConnection: '✕ The connection with the remote palette is unlinked', + announcements: 'The announcements cannot be loaded', }, }, } diff --git a/src/ui/modules/Highlight.tsx b/src/ui/modules/Highlight.tsx index 36cc3741d..c60f1e760 100644 --- a/src/ui/modules/Highlight.tsx +++ b/src/ui/modules/Highlight.tsx @@ -1,11 +1,12 @@ -import { Dialog, Icon, texts } from '@a_ng_d/figmug-ui' +import { Dialog, Icon, Message, texts } from '@a_ng_d/figmug-ui' import React from 'react' import { locals } from '../../content/locals' -import { Language } from '../../types/app' +import { HighlightDigest, Language } from '../../types/app' import { announcementsWorkerUrl } from '../../utils/config' interface HighlightProps { + highlight: HighlightDigest lang: Language onCloseHighlight: React.ReactEventHandler } @@ -41,15 +42,6 @@ export default class Highlight extends React.Component< }) }) .catch(() => { - parent.postMessage( - { - pluginMessage: { - type: 'SEND_MESSAGE', - message: 'Nope', - }, - }, - '*' - ) this.setState({ status: 'ERROR' }) }) } @@ -67,28 +59,37 @@ export default class Highlight extends React.Component< if (this.state.status === 'LOADING') return ( + ) + else if (this.state.status === 'ERROR') + return ( + ) else @@ -122,8 +123,21 @@ export default class Highlight extends React.Component< : undefined } onClose={(e) => { + parent.postMessage( + { + pluginMessage: { + type: 'SET_ITEMS', + items: [ + { + key: 'highlight_version', + value: this.props.highlight.version, + }, + ], + }, + }, + '*' + ) this.props.onCloseHighlight(e) - this.setState({ position: 0 }) }} >