Skip to content
Open
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
13 changes: 11 additions & 2 deletions assets/js/components/Header.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script setup>
import { __ } from '@wordpress/i18n';
import { computed } from 'vue';

const props = defineProps({
utm: {
Expand All @@ -14,14 +15,22 @@ 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 wpuf.isProActive ? 'WP User Frontend Pro' : 'WP User Frontend';
});
Comment on lines +19 to +21
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Clarify discrepancy between PR description and implementation.

The PR description states the header should display Pro title "when the isPro prop and Pro activation are true," but the implementation only checks wpuf.isProActive without an isPro prop. The component's props definition (lines 5-11) doesn't include isPro.

If relying solely on wpuf.isProActive is intentional, consider updating the PR description to reflect the actual implementation.

🤖 Prompt for AI Agents
assets/js/components/Header.vue lines 19-21: the computed headerTitle only
checks wpuf.isProActive but the PR description mentions an isPro prop that
doesn't exist in the component props (lines 5-11); either add an isPro boolean
prop and include it in the computed (e.g., check both props.isPro and
wpuf.isProActive) or, if the intention is to rely solely on wpuf.isProActive,
update the PR description to remove mention of an isPro prop and clarify that
only wpuf.isProActive controls the Pro title.


const headerVersion = computed(() => {
return wpuf.isProActive && 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