1
0
mirror of synced 2025-12-23 11:54:18 -05:00

Adding React for the header notifications with mike

This commit is contained in:
Grace Park
2021-05-26 12:41:34 -07:00
parent 2f3dfa1f41
commit d674299496
2 changed files with 14 additions and 2 deletions

View File

@@ -19,7 +19,7 @@ type Notif = {
export const HeaderNotifications = () => {
const router = useRouter()
const { currentVersion } = useVersion()
const { relativePath, allVersions, data, languages, currentLanguage } = useMainContext()
const { relativePath, allVersions, data, languages, currentLanguage, userLanguage, currentPathWithoutLanguage } = useMainContext()
const { t } = useTranslation('header')
const translationNotices: Array<Notif> = []
@@ -39,9 +39,16 @@ export const HeaderNotifications = () => {
type: NotificationType.TRANSLATION,
content: t('notices.localization_in_progress'),
})
}
} else {
if (languages[userLanguage]?.wip === false && userLanguage !== 'en') {
translationNotices.push({
type: NotificationType.TRANSLATION,
content:
`This article is also available in your language of choice. Click <a href="/${userLanguage}${currentPathWithoutLanguage}">here</a>`
})
}
}
const releaseNotices: Array<Notif> = []
if (currentVersion === 'github-ae@latest') {
releaseNotices.push({