Skip to content
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
4 changes: 4 additions & 0 deletions backend/app/Resources/Account/AccountResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class AccountResource extends JsonResource
public function toArray(Request $request): array
{
$activeStripePlatform = $this->getPrimaryStripePlatform();
$isHiEvents = config('app.is_hi_events', false);

return [
'id' => $this->getId(),
Expand All @@ -31,6 +32,9 @@ public function toArray(Request $request): array
'stripe_account_details' => $activeStripePlatform->getStripeAccountDetails(),
'stripe_platform' => $this->getActiveStripePlatform()?->value,
]),
$this->mergeWhen($isHiEvents, fn() => [
'stripe_hi_events_primary_platform' => config('services.stripe.primary_platform')
]),

$this->mergeWhen($this->getConfiguration() !== null, fn() => [
'configuration' => new AccountConfigurationResource($this->getConfiguration()),
Expand Down
50 changes: 38 additions & 12 deletions frontend/src/components/common/PoweredByFooter/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import {t} from "@lingui/macro";
import classes from "./FloatingPoweredBy.module.scss";
import classNames from "classnames";
import React from "react";
import React, {useMemo} from "react";
import {iHavePurchasedALicence, isHiEvents} from "../../../utilites/helpers.ts";
import {getConfig} from "../../../utilites/config.ts";

/**
* (c) Hi.Events Ltd 2025
Expand All @@ -17,29 +18,54 @@ import {iHavePurchasedALicence, isHiEvents} from "../../../utilites/helpers.ts";
*
* If you wish to remove this notice, a commercial license is available at: https://hi.events/licensing
*/
export const PoweredByFooter = (props: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>) => {
export const PoweredByFooter = (
props: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>
) => {
if (iHavePurchasedALicence()) {
return <></>;
}

const link = useMemo(() => {
let host = getConfig("VITE_FRONTEND_URL") ?? "unknown";
let medium = "app";

if (typeof window !== "undefined" && window.location) {
host = window.location.hostname;
medium = window.location.pathname.includes("/widget") ? "widget" : "app";
}

const url = new URL("https://hi.events");
url.searchParams.set("utm_source", "app-powered-by-footer");
url.searchParams.set("utm_medium", isHiEvents() ? medium : 'self-hosted-' + medium);
url.searchParams.set("utm_campaign", "powered-by");
url.searchParams.set("utm_content", isHiEvents() ? "hi.events" : host);

return url.toString();
}, []);

const footerContent = isHiEvents() ? (
<>
{t`Planning an event?`} {' '}
<a href="https://hi.events?utm_source=app-powered-by-footer&utm_content=try-hi-events-free"
target="_blank"
className={classes.ctaLink}
title={'Effortlessly manage events and sell tickets online with Hi.Events'}>
{t`Planning an event?`}{" "}
<a
href={`${link}`}
target="_blank"
className={classes.ctaLink}
title={"Effortlessly manage events and sell tickets online with Hi.Events"}
>
{t`Try Hi.Events Free`}
</a>
</>
) : (
<>
{t`Powered by`} {' '}
<a href="https://hi.events?utm_source=app-powered-by-footer"
target="_blank"
title={'Effortlessly manage events and sell tickets online with Hi.Events'}>
{t`Powered by`}{" "}
<a
href={link}
target="_blank"
title={"Effortlessly manage events and sell tickets online with Hi.Events"}
>
Hi.Events
</a> 🚀
</a>{" "}
🚀
</>
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ const MigrationBanner = ({stripeData}: { stripeData: StripeConnectAccountsRespon
<IconInfoCircle size={20}/>
</ThemeIcon>
<div>
<Title order={3}>{t`Ready to Upgrade?`}</Title>
<Text size="sm" c="dimmed">{t`Complete the setup below to continue`}</Text>
<Title order={3}>{t`Complete the setup below to continue`}</Title>
</div>
</Group>

Expand Down Expand Up @@ -370,7 +369,6 @@ const HiEventsConnectStatus = ({account}: { account: Account }) => {
const hasIrelandAccount = !!ieAccount;
const isIrelandComplete = ieAccount?.is_setup_complete === true;

// Build the appropriate UI based on clear conditions
let content;

if (isIrelandComplete) {
Expand Down Expand Up @@ -442,7 +440,7 @@ const HiEventsConnectStatus = ({account}: { account: Account }) => {
variant="light"
size="sm"
leftSection={<IconBrandStripe size={20}/>}
onClick={() => handleSetupStripe('ie')}
onClick={() => handleSetupStripe((account?.stripe_hi_events_primary_platform || 'ie') as 'ca' | 'ie')}
>
{t`Connect with Stripe`}
</Button>
Expand Down
1 change: 1 addition & 0 deletions frontend/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export interface Account {
configuration?: AccountConfiguration;
requires_manual_verification?: boolean;
stripe_platform: string;
stripe_hi_events_primary_platform?: string;
}

export interface AccountConfiguration {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/utilites/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export const iHavePurchasedALicence = () => {
}

export const isHiEvents = () => {
return true;
return getConfig('VITE_FRONTEND_URL')?.includes('.hi.events');
}

export const isEmptyHtml = (content: string) => {
Expand Down
Loading