diff --git a/web/app/components/plugins/card/base/org-info.tsx b/web/app/components/plugins/card/base/org-info.tsx index 80733a1c0e..c1b44f1bd7 100644 --- a/web/app/components/plugins/card/base/org-info.tsx +++ b/web/app/components/plugins/card/base/org-info.tsx @@ -29,7 +29,7 @@ const OrgInfo = ({ {linkToOrg ? ( { const { getByText } = render() const creatorLink = getByText('test-publisher').closest('a') - expect(creatorLink).toHaveAttribute('href', '/creators/test-publisher?publisher_type=organization') + expect(creatorLink).toHaveAttribute('href', '/creator/test-publisher?publisher_type=organization') }) }) diff --git a/web/app/components/plugins/marketplace/list/template-card.tsx b/web/app/components/plugins/marketplace/list/template-card.tsx index b248942469..755dec2813 100644 --- a/web/app/components/plugins/marketplace/list/template-card.tsx +++ b/web/app/components/plugins/marketplace/list/template-card.tsx @@ -4,7 +4,7 @@ import type { Template } from '../types' import { useLocale, useTranslation } from '#i18n' import Link from 'next/link' import * as React from 'react' -import { useCallback } from 'react' +import { useMemo } from 'react' import AppIcon from '@/app/components/base/app-icon' import CornerMark from '@/app/components/plugins/card/base/corner-mark' import { MARKETPLACE_URL_PREFIX } from '@/config' @@ -36,17 +36,16 @@ const TemplateCardComponent = ({ const isSandbox = kind === 'sandboxed' const iconUrl = getTemplateIconUrl(template) - const handleClick = useCallback(() => { + const href = useMemo(() => { const queryParams = { theme, language: locale, templateId: id, creationType: 'templates', } - const url = includeSource + return includeSource ? getMarketplaceUrl(`/template/${publisher_handle}/${template_name}`, queryParams) : `${MARKETPLACE_URL_PREFIX}/template/${publisher_handle}/${template_name}?${new URLSearchParams(queryParams).toString()}` - window.open(url, '_blank') }, [publisher_handle, template_name, theme, locale, id, includeSource]) const visibleDepsPlugins = deps_plugins?.slice(0, MAX_VISIBLE_DEPS_PLUGINS) || [] @@ -60,7 +59,6 @@ const TemplateCardComponent = ({ 'hover-bg-components-panel-on-panel-item-bg relative flex h-full cursor-pointer flex-col overflow-hidden rounded-xl border-[0.5px] border-components-panel-border bg-components-panel-on-panel-item-bg pb-3 shadow-xs', className, )} - onClick={handleClick} > {isSandbox && } {/* Header */} @@ -75,16 +73,22 @@ const TemplateCardComponent = ({ /> {/* Title */}
-

{template_name}

+ + {template_name} +
- + {t('marketplace.templateCard.by', { ns: 'plugin' })} e.stopPropagation()} > {publisher_handle} diff --git a/web/app/components/plugins/marketplace/search-box/search-dropdown/index.tsx b/web/app/components/plugins/marketplace/search-box/search-dropdown/index.tsx index 6eef0b013b..aa4cb3a47d 100644 --- a/web/app/components/plugins/marketplace/search-box/search-dropdown/index.tsx +++ b/web/app/components/plugins/marketplace/search-box/search-dropdown/index.tsx @@ -275,7 +275,7 @@ function CreatorsSection({ creators, t }: {
{ const { t } = useTranslation() - const href = getMarketplaceUrl(`/creators/${creator.unique_handle}`) + const href = getMarketplaceUrl(`/creator/${creator.unique_handle}`) const displayName = creator.display_name || creator.name return (