Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Add underline to the "contribute a translation" link #826

Merged
merged 1 commit into from
Feb 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 0 additions & 46 deletions src/components/NotificationBanner.vue

This file was deleted.

47 changes: 47 additions & 0 deletions src/components/VNotificationBanner.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<template>
<div
class="wrapper px-4 md:px-7 py-2 md:flex md:items-center md:justify-between"
dir="ltr"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this dir need to be always "ltr"? Doesn't this change for the Arabic language for example?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't remember why this was added 🙈

>
<p class="text-center md:text-left">
<slot name="default" />
</p>
<div class="flex">
<slot name="buttons">
<button
class="button is-text small dismiss-button"
type="button"
:aria-label="$t('modal.close')"
@click="$emit('close')"
>
<VIcon :icon-path="closeIcon" />
</button>
</slot>
</div>
</div>
</template>

<script>
import { defineComponent } from '@nuxtjs/composition-api'
import closeIcon from '~/assets/icons/close.svg'
import VIcon from '~/components/VIcon/VIcon.vue'

const VNotificationBanner = defineComponent({
name: 'VNotificationBanner',
components: {
VIcon,
},
setup() {
return { closeIcon }
},
})
export default VNotificationBanner
</script>

<style scoped lang="scss">
// Styles from learn.wordpress.org
.wrapper {
background-color: #fff8e5;
border-left: 0.25rem solid #ffb900;
}
</style>
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
<template>
<NotificationBanner v-show="!shouldHideBanner" @close="dismissBanner">
<VNotificationBanner v-show="!shouldHideBanner" @close="dismissBanner">
{{
// eslint-disable-next-line @intlify/vue-i18n/no-raw-text
'⚠️'
}}
<i18n path="notification.translation.text">
<template #link>
<a :href="translationLink" target="_blank">{{
<a :href="translationLink" target="_blank" class="underline">{{
$t('notification.translation.link')
}}</a>
</template>
<template #locale>
{{ bannerLocale.name }}
</template>
</i18n>
</NotificationBanner>
</VNotificationBanner>
</template>
<script>
import useI18nSync from '~/composables/use-i18n-sync'
import VNotificationBanner from '~/components/VNotificationBanner.vue'

export default {
name: 'TranslationStatusBanner',
name: 'VTranslationStatusBanner',
components: {
VNotificationBanner,
},
setup() {
const { shouldHideBanner, bannerLocale, translationLink, dismissBanner } =
useI18nSync()
Expand Down
6 changes: 3 additions & 3 deletions src/layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="app grid h-screen overflow-hidden">
<VTeleportTarget name="skip-to-content" />
<MigrationNotice v-show="isReferredFromCc" />
<TranslationStatusBanner />
<VTranslationStatusBanner />
<VHeader />
<main
class="main embedded overflow-x-hidden"
Expand Down Expand Up @@ -32,7 +32,7 @@ import { useMatchSearchRoutes } from '~/composables/use-match-routes'
import { useScroll } from '~/composables/use-scroll'

import MigrationNotice from '~/components/MigrationNotice.vue'
import TranslationStatusBanner from '~/components/TranslationStatusBanner.vue'
import VTranslationStatusBanner from '~/components/VTranslationStatusBanner.vue'
import VHeader from '~/components/VHeader/VHeader.vue'
import VModalTarget from '~/components/VModal/VModalTarget.vue'
import VSidebarTarget from '~/components/VModal/VSidebarTarget.vue'
Expand All @@ -43,7 +43,7 @@ const embeddedPage = {
name: 'embedded',
components: {
MigrationNotice,
TranslationStatusBanner,
VTranslationStatusBanner,
VHeader,
VModalTarget,
VTeleportTarget,
Expand Down