Skip to content
Open
Changes from 1 commit
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
18 changes: 16 additions & 2 deletions assets/js/components/Header.vue
Original file line number Diff line number Diff line change
@@ -1,27 +1,41 @@
<script setup>
import { __ } from '@wordpress/i18n';
import { computed } from 'vue';
const props = defineProps({
utm: {
type: String,
required: false,
default: 'wpuf-header',
},
isPro: {
type: Boolean,
required: false,
default: false,
},
});
const utm = props.utm;
const wpuf = wpuf_admin_script;
const logoUrl = wpuf.asset_url + '/images/wpuf-icon-circle.svg';
const upgradeUrl = wpuf.upgradeUrl + '?utm_source=' + utm + '&utm_medium=wpuf-header';
const supportUrl = wpuf.support_url;
const headerTitle = computed(() => {
return props.isPro && wpuf.isProActive ? 'WP User Frontend Pro' : 'WP User Frontend';
});
const headerVersion = computed(() => {
return props.isPro && wpuf.pro_version ? wpuf.pro_version : wpuf.version;
});
</script>

<template>
<div class="wpuf-w-[calc(100%+40px)] wpuf-ml-[-20px] wpuf-px-[20px] wpuf-flex wpuf-mt-4 wpuf-justify-between wpuf-items-center wpuf-border-b-2 wpuf-border-gray-100 wpuf-pb-4">
<div class="wpuf-flex wpuf-justify-start wpuf-items-center">
<img :src="logoUrl" alt="WPUF Icon" class="wpuf-w-12 wpuf-mr-4" />
<h2 class="wpuf-text-2xl wpuf-leading-7 wpuf-font-bold">WP User Frontend</h2>
<span class="wpuf-ml-2 wpuf-inline-flex wpuf-items-center wpuf-rounded-full wpuf-bg-green-100 wpuf-px-2 wpuf-py-1 wpuf-text-xs wpuf-font-medium wpuf-text-green-700 wpuf-ring-1 wpuf-ring-inset wpuf-ring-green-600/20">v{{ wpuf.version }}</span>
<h2 class="wpuf-text-2xl wpuf-leading-7 wpuf-font-bold">{{ headerTitle }}</h2>
<span class="wpuf-ml-2 wpuf-inline-flex wpuf-items-center wpuf-rounded-full wpuf-bg-green-100 wpuf-px-2 wpuf-py-1 wpuf-text-xs wpuf-font-medium wpuf-text-green-700 wpuf-ring-1 wpuf-ring-inset wpuf-ring-green-600/20">v{{ headerVersion }}</span>
<a
v-if="!wpuf.isProActive"
:href="upgradeUrl"
Expand Down
Loading