short link support
This commit is contained in:
@@ -5,6 +5,9 @@ BACKEND_BASE_URL=http://localhost:8080
|
||||
# Middleware to limited site to only root page
|
||||
NEXT_PUBLIC_LAUNCH_ONLY_ROOT=false
|
||||
|
||||
NEXT_PUBLIC_SHORTLINK_BASE_URL=http://localhost:8080
|
||||
|
||||
# Brevo API key for beta sign up collection
|
||||
BREVO_API_KEY=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
|
||||
BREVO_LIST_ID=9
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ NEXT_PUBLIC_API_BASE_URL=http://localhost:8080
|
||||
# Middleware to limited site to only root page
|
||||
NEXT_PUBLIC_LAUNCH_ONLY_ROOT=false
|
||||
|
||||
NEXT_PUBLIC_SHORTLINK_BASE_URL=https://battl.build
|
||||
|
||||
# Brevo API key for beta sign up collection
|
||||
BREVO_API_KEY=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
|
||||
BREVO_LIST_ID=9
|
||||
|
||||
@@ -12,7 +12,8 @@ type UiPart = {
|
||||
partRole: string;
|
||||
price: number;
|
||||
imageUrl?: string;
|
||||
buyUrl?: string;
|
||||
buyUrl?: string; // Used for debugging
|
||||
buyShortUrl?: string;
|
||||
inStock?: boolean;
|
||||
};
|
||||
|
||||
@@ -64,9 +65,9 @@ export default function PartsGrid(props: {
|
||||
>
|
||||
{addLabel}
|
||||
</button>
|
||||
) : part.buyUrl ? (
|
||||
) : part.buyShortUrl ?? part.buyUrl ? (
|
||||
<a
|
||||
href={part.buyUrl}
|
||||
href={part.buyShortUrl ?? part.buyUrl}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
className="flex-1 rounded-md bg-amber-400 px-3 py-2 text-center text-xs font-semibold text-black hover:bg-amber-300"
|
||||
@@ -161,9 +162,9 @@ export default function PartsGrid(props: {
|
||||
>
|
||||
<Plus className="h-4 w-4" />
|
||||
</button>
|
||||
) : part.buyUrl ? (
|
||||
) : part.buyShortUrl ?? part.buyUrl ? (
|
||||
<a
|
||||
href={part.buyUrl}
|
||||
href={part.buyShortUrl ?? part.buyUrl}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
className="whitespace-nowrap rounded-md bg-amber-400 px-3 py-1.5 text-xs font-semibold text-black hover:bg-amber-300"
|
||||
|
||||
Reference in New Issue
Block a user