refactor(ui): introduce landing page + minor fixes

This commit is contained in:
liyasthomas
2021-07-19 18:42:33 +05:30
parent f1ad7b9ef5
commit 68c00433f5
17 changed files with 162 additions and 124 deletions

View File

@@ -10,23 +10,38 @@
:animate-fill="false"
>
<template #trigger>
<TabPrimary
<SmartLink
v-tippy="{ theme: 'tooltip' }"
:title="$t('choose_language')"
:label="`${
$i18n.locales.find(({ code }) => code == $i18n.locale).country
} ${$i18n.locales.find(({ code }) => code == $i18n.locale).name}`"
/>
class="font-medium focus:outline-none"
>
{{ `${$i18n.locales.find(({ code }) => code == $i18n.locale).name}` }}
</SmartLink>
</template>
<SmartItem
<nuxt-link
v-for="(locale, index) in $i18n.locales.filter(
({ code }) => code !== $i18n.locale
)"
:key="`locale-${index}`"
:to="switchLocalePath(locale.code).toString()"
:label="`${locale.country} ${locale.name}`"
@click.native="$refs.language.tippy().hide()"
/>
:to="switchLocalePath(locale.code)"
@click="$refs.language.tippy().hide()"
>
<SmartItem
:label="`${getFlagEmoji(locale.country)} \xA0 ${locale.name}`"
/>
</nuxt-link>
</tippy>
</span>
</template>
<script>
export default {
methods: {
getFlagEmoji(c) {
return String.fromCodePoint(
...[...c.toUpperCase()].map((x) => 0x1f1a5 + x.charCodeAt())
)
},
},
}
</script>