mirror of
https://github.com/nomadkaraoke/karaoke-gen.git
synced 2026-12-01 01:31:32 +09:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3fac565c76 | ||
|
|
43900921a5 | ||
|
|
6068ef7a93 | ||
|
|
83fdc9e786 | ||
|
|
77f64a52d7 | ||
|
|
1c1c17f9ab | ||
|
|
9283d3c1ae |
No files matched your search
@@ -40,11 +40,11 @@ class GenerateFlyerRequest(BaseModel):
|
||||
|
||||
|
||||
@router.get("/r/{code}", response_model=ReferralInterstitialResponse)
|
||||
async def get_referral_interstitial(code: str):
|
||||
async def get_referral_interstitial(code: str, no_track: bool = False):
|
||||
"""
|
||||
Public endpoint: get interstitial data for a referral link.
|
||||
|
||||
Increments click count. Returns valid=False if code not found.
|
||||
Increments click count unless no_track=true. Returns valid=False if code not found.
|
||||
"""
|
||||
service = get_referral_service()
|
||||
link = service.get_link_by_code(code)
|
||||
@@ -52,11 +52,12 @@ async def get_referral_interstitial(code: str):
|
||||
if not link:
|
||||
return ReferralInterstitialResponse(valid=False)
|
||||
|
||||
# Track the click
|
||||
try:
|
||||
service.increment_clicks(code)
|
||||
except Exception:
|
||||
logger.warning("Failed to increment clicks for code %s", code, exc_info=True)
|
||||
# Track the click (skip when fetching for display purposes)
|
||||
if not no_track:
|
||||
try:
|
||||
service.increment_clicks(code)
|
||||
except Exception:
|
||||
logger.warning("Failed to increment clicks for code %s", code, exc_info=True)
|
||||
|
||||
return ReferralInterstitialResponse(
|
||||
valid=True,
|
||||
@@ -126,6 +127,38 @@ async def start_stripe_connect(auth=Depends(require_auth)):
|
||||
return {"account_id": account_id, "onboarding_url": onboarding_url}
|
||||
|
||||
|
||||
@router.post("/me/connect/dashboard-link")
|
||||
async def get_connect_dashboard_link(auth=Depends(require_auth)):
|
||||
"""Get a login link to the Stripe Express dashboard for managing payout settings."""
|
||||
from backend.services.user_service import get_user_service
|
||||
user = get_user_service().get_user(auth.user_email)
|
||||
if not user or not user.stripe_connect_account_id:
|
||||
raise HTTPException(status_code=400, detail="No Stripe Connect account configured")
|
||||
|
||||
service = get_referral_service()
|
||||
url = service.create_connect_login_link(user.stripe_connect_account_id)
|
||||
if not url:
|
||||
raise HTTPException(status_code=500, detail="Failed to create dashboard link")
|
||||
|
||||
return {"url": url}
|
||||
|
||||
|
||||
@router.post("/me/connect/update-link")
|
||||
async def get_connect_update_link(auth=Depends(require_auth)):
|
||||
"""Get a link to update Stripe Connect account info (re-onboarding)."""
|
||||
from backend.services.user_service import get_user_service
|
||||
user = get_user_service().get_user(auth.user_email)
|
||||
if not user or not user.stripe_connect_account_id:
|
||||
raise HTTPException(status_code=400, detail="No Stripe Connect account configured")
|
||||
|
||||
service = get_referral_service()
|
||||
url = service.create_connect_update_link(user.stripe_connect_account_id)
|
||||
if not url:
|
||||
raise HTTPException(status_code=500, detail="Failed to create update link")
|
||||
|
||||
return {"url": url}
|
||||
|
||||
|
||||
class VanityRequest(BaseModel):
|
||||
desired_code: str = Field(..., min_length=2, max_length=30, pattern="^[a-z0-9-]+$")
|
||||
|
||||
|
||||
@@ -339,6 +339,24 @@ class ReferralService:
|
||||
return None, None
|
||||
return self.stripe_service.create_connect_account(email)
|
||||
|
||||
def get_connect_account_status(self, account_id: str) -> Optional[dict]:
|
||||
"""Get Stripe Connect account status."""
|
||||
if not self.stripe_service:
|
||||
return None
|
||||
return self.stripe_service.get_connect_account_status(account_id)
|
||||
|
||||
def create_connect_login_link(self, account_id: str) -> Optional[str]:
|
||||
"""Create login link for Stripe Express dashboard."""
|
||||
if not self.stripe_service:
|
||||
return None
|
||||
return self.stripe_service.create_connect_login_link(account_id)
|
||||
|
||||
def create_connect_update_link(self, account_id: str) -> Optional[str]:
|
||||
"""Create account link for updating Connect info."""
|
||||
if not self.stripe_service:
|
||||
return None
|
||||
return self.stripe_service.create_connect_update_link(account_id)
|
||||
|
||||
def get_pending_earnings(self, referrer_email: str) -> List[dict]:
|
||||
"""Get all pending earnings for a referrer."""
|
||||
query = (
|
||||
@@ -425,11 +443,17 @@ class ReferralService:
|
||||
# total_paid = total_earned - pending (since total_earned tracks all time)
|
||||
total_paid = total_earned - pending_balance
|
||||
|
||||
# Check Connect status
|
||||
# Check Connect status and fetch account details
|
||||
from backend.services.user_service import get_user_service
|
||||
user = get_user_service().get_user(user_email)
|
||||
has_connect = bool(user and user.stripe_connect_account_id)
|
||||
|
||||
connect_account = None
|
||||
if has_connect and self.stripe_service:
|
||||
connect_account = self.stripe_service.get_connect_account_status(
|
||||
user.stripe_connect_account_id
|
||||
)
|
||||
|
||||
return {
|
||||
"link": {
|
||||
"code": link.code,
|
||||
@@ -467,6 +491,7 @@ class ReferralService:
|
||||
for p in payouts
|
||||
],
|
||||
"stripe_connect_configured": has_connect,
|
||||
"stripe_connect_account": connect_account,
|
||||
}
|
||||
|
||||
def list_links(self, limit: int = 50, offset: int = 0) -> list[ReferralLink]:
|
||||
|
||||
@@ -392,8 +392,8 @@ class StripeService:
|
||||
)
|
||||
account_link = stripe.AccountLink.create(
|
||||
account=account.id,
|
||||
refresh_url=f"{self.frontend_url}/app?tab=referrals&connect=refresh",
|
||||
return_url=f"{self.frontend_url}/app?tab=referrals&connect=complete",
|
||||
refresh_url=f"{self.frontend_url}/app/referrals?connect=refresh",
|
||||
return_url=f"{self.frontend_url}/app/referrals?connect=complete",
|
||||
type="account_onboarding",
|
||||
)
|
||||
logger.info(f"Created Connect account {account.id} for {email}")
|
||||
@@ -402,6 +402,50 @@ class StripeService:
|
||||
logger.error(f"Failed to create Connect account for {email}: {e}")
|
||||
return None, None
|
||||
|
||||
def get_connect_account_status(self, account_id: str) -> Optional[dict]:
|
||||
"""Retrieve Stripe Connect account status. Returns dict with account details."""
|
||||
if not self.is_configured():
|
||||
return None
|
||||
try:
|
||||
account = stripe.Account.retrieve(account_id)
|
||||
return {
|
||||
"account_id": account.id,
|
||||
"charges_enabled": account.charges_enabled,
|
||||
"payouts_enabled": account.payouts_enabled,
|
||||
"details_submitted": account.details_submitted,
|
||||
"email": account.email,
|
||||
}
|
||||
except stripe.error.StripeError as e:
|
||||
logger.error(f"Failed to retrieve Connect account {account_id}: {e}")
|
||||
return None
|
||||
|
||||
def create_connect_login_link(self, account_id: str) -> Optional[str]:
|
||||
"""Create a login link to the Stripe Express dashboard. Returns URL."""
|
||||
if not self.is_configured():
|
||||
return None
|
||||
try:
|
||||
link = stripe.Account.create_login_link(account_id)
|
||||
return link.url
|
||||
except stripe.error.StripeError as e:
|
||||
logger.error(f"Failed to create login link for {account_id}: {e}")
|
||||
return None
|
||||
|
||||
def create_connect_update_link(self, account_id: str) -> Optional[str]:
|
||||
"""Create an account link for updating Connect account info. Returns URL."""
|
||||
if not self.is_configured():
|
||||
return None
|
||||
try:
|
||||
account_link = stripe.AccountLink.create(
|
||||
account=account_id,
|
||||
refresh_url=f"{self.frontend_url}/app/referrals?connect=refresh",
|
||||
return_url=f"{self.frontend_url}/app/referrals?connect=complete",
|
||||
type="account_onboarding",
|
||||
)
|
||||
return account_link.url
|
||||
except stripe.error.StripeError as e:
|
||||
logger.error(f"Failed to create update link for {account_id}: {e}")
|
||||
return None
|
||||
|
||||
def create_transfer(self, amount_cents: int, destination_account_id: str, description: str = "Nomad Karaoke referral payout") -> Optional[str]:
|
||||
"""Create a transfer to a Connect account. Returns transfer ID."""
|
||||
if not self.is_configured():
|
||||
|
||||
@@ -130,6 +130,23 @@ class TestGetInterstitial:
|
||||
data = response.json()
|
||||
assert data["valid"] is True
|
||||
|
||||
@patch("backend.api.routes.referrals.get_referral_service")
|
||||
def test_no_track_skips_click_increment(self, mock_get_service, client):
|
||||
"""no_track=true should return data without incrementing clicks."""
|
||||
mock_service = Mock()
|
||||
link = _make_referral_link()
|
||||
mock_service.get_link_by_code.return_value = link
|
||||
mock_get_service.return_value = mock_service
|
||||
|
||||
response = client.get("/api/referrals/r/abc12345?no_track=true")
|
||||
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
assert data["valid"] is True
|
||||
assert data["referral_code"] == "abc12345"
|
||||
assert data["referrer_display_name"] == "Test Referrer"
|
||||
mock_service.increment_clicks.assert_not_called()
|
||||
|
||||
|
||||
# ============================================================================
|
||||
# GET /api/referrals/me - Dashboard
|
||||
|
||||
+19
-1
@@ -1894,7 +1894,25 @@ POST /api/referrals/me/connect
|
||||
Authorization: Bearer TOKEN
|
||||
```
|
||||
|
||||
Creates a Stripe Connect Express account and returns an onboarding URL. Saves the Connect account ID to the user doc.
|
||||
Creates a Stripe Connect Express account and returns an onboarding URL. Saves the Connect account ID to the user doc. The dashboard response (`GET /api/referrals/me`) includes `stripe_connect_account` with account status details (payouts_enabled, details_submitted, etc.).
|
||||
|
||||
### Get Stripe Connect Dashboard Link
|
||||
|
||||
```http
|
||||
POST /api/referrals/me/connect/dashboard-link
|
||||
Authorization: Bearer TOKEN
|
||||
```
|
||||
|
||||
Returns a one-time login URL to the Stripe Express dashboard where the user can manage their payout settings, view transfer history, and update bank details.
|
||||
|
||||
### Get Stripe Connect Update Link
|
||||
|
||||
```http
|
||||
POST /api/referrals/me/connect/update-link
|
||||
Authorization: Bearer TOKEN
|
||||
```
|
||||
|
||||
Returns a Stripe AccountLink URL for re-onboarding — allows the user to update their bank account or complete setup if they didn't finish initially.
|
||||
|
||||
### Create Vanity Link (Admin)
|
||||
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
# Mobile-Friendly Header Design
|
||||
|
||||
**Date:** 2026-04-06
|
||||
**Status:** Approved
|
||||
**File:** `frontend/components/app-header.tsx`
|
||||
|
||||
## Problem
|
||||
|
||||
The app header crams 6-7 icon-only buttons into a single row on mobile. The referrals icon in particular isn't recognizable, and the row is too crowded for the available width.
|
||||
|
||||
## Solution
|
||||
|
||||
Add a second row on mobile (`< sm` breakpoint) to give action buttons room for text labels. Desktop layout is unchanged.
|
||||
|
||||
## Layout
|
||||
|
||||
### Mobile (`< 640px`)
|
||||
|
||||
```
|
||||
┌──────────────────────────────────────┐
|
||||
│ [Logo] Title [👤 Login] │
|
||||
├──────────────────────────────────────┤
|
||||
│ [↻ Refresh] [👥 Referrals] [? Help] │
|
||||
│ [🇬🇧 Lang] [☀ Theme] │
|
||||
└──────────────────────────────────────┘
|
||||
```
|
||||
|
||||
- **Row 1:** Logo + title (left), AuthStatus (right)
|
||||
- **Row 2:** Action buttons with text labels, wrapped with `flex-wrap`
|
||||
- Separated by a subtle border or spacing
|
||||
|
||||
### Desktop (`≥ 640px`) — unchanged
|
||||
|
||||
Single row: Logo, Title, [children], Help, Referrals, Language, Auth, Theme.
|
||||
|
||||
## Implementation
|
||||
|
||||
### Changes to `app-header.tsx`
|
||||
|
||||
1. **Restructure the outer container** to stack two rows on mobile:
|
||||
- Outer: `flex flex-col sm:flex-row` (or keep current layout and add a second div that's `sm:hidden`)
|
||||
- Row 1 (mobile): logo/title + AuthStatus
|
||||
- Row 2 (mobile): all other action buttons with text labels visible
|
||||
|
||||
2. **Move AuthStatus** into row 1 on mobile. On desktop it stays in the existing position.
|
||||
|
||||
3. **Show text labels on mobile** for row 2 items:
|
||||
- Refresh: show `t('refresh')` text
|
||||
- Referrals: show `t('referrals')` text
|
||||
- Help: show `tHeader('help')` or similar text label
|
||||
- Language: show native language name (remove `hidden sm:inline` from LanguageSwitcher)
|
||||
- Theme: stays icon-only (sun/moon is universally understood)
|
||||
|
||||
4. **`children` prop** (page-specific buttons like Refresh, Admin toggle): render in row 2 on mobile, current position on desktop.
|
||||
|
||||
### Files Changed
|
||||
|
||||
- `frontend/components/app-header.tsx` — layout restructure
|
||||
- `frontend/components/LanguageSwitcher.tsx` — remove `hidden sm:inline` from the native language name span so it's always visible
|
||||
- `frontend/components/auth/AuthStatus.tsx` — may need minor adjustments for row 1 placement on mobile
|
||||
- `frontend/messages/en.json` — add `header.help` key if not already present
|
||||
|
||||
### No i18n Translation Run Needed
|
||||
|
||||
All text labels (`refresh`, `referrals`, login/auth text) already exist as translation keys — they're currently hidden via CSS `hidden sm:inline`. We're just making them visible on mobile. The only potential new key is a "Help" label for the help button.
|
||||
|
||||
## Approach
|
||||
|
||||
Use Tailwind responsive classes (`sm:hidden` / `hidden sm:flex`) to render two different layouts from the same component, rather than duplicating the buttons. Specifically:
|
||||
|
||||
- On mobile: render row 1 (brand + auth) and row 2 (actions with text)
|
||||
- On desktop: render the current single-row layout
|
||||
- Shared button components, just different container layout
|
||||
|
||||
## Spacing
|
||||
|
||||
- Row 2 gets the same horizontal padding as row 1 (`px-3 sm:px-4`)
|
||||
- Slightly reduced vertical padding on mobile to keep total header height reasonable
|
||||
- `pt-[header-height]` on main content needs updating to account for taller mobile header
|
||||
|
||||
## Testing
|
||||
|
||||
- Visual check on mobile viewport (375px, 390px widths)
|
||||
- Verify desktop layout is unchanged
|
||||
- Check with children (dashboard page) and without (referrals page)
|
||||
- Check logged-in vs logged-out states
|
||||
- Verify language switcher dropdown still positions correctly from row 2
|
||||
@@ -0,0 +1,199 @@
|
||||
# Referral Flyer Customisation — Design Spec
|
||||
|
||||
**Date:** 2026-04-09
|
||||
**Branch:** `feat/sess-20260409-1813-referral-flyer-customisation`
|
||||
**Status:** Design approved, ready for implementation planning
|
||||
|
||||
## Overview
|
||||
|
||||
Expand the existing QR Code Generator dialog into a tabbed "Referral Tools" dialog with two tabs: **QR Code** and **Printable Flyer**. The Flyer tab provides a live preview with extensive customisation options and client-side export (PDF, HTML, PNG). This replaces the current server-side flyer generation with a fully client-side approach.
|
||||
|
||||
## Goals
|
||||
|
||||
1. Live flyer preview with instant feedback on customisation changes
|
||||
2. Configurable colors, text, section visibility, branding, and print layout
|
||||
3. Client-side export to PDF (primary), HTML, and PNG — no server round-trip
|
||||
4. Preset themes (Light, Dark) with ability to save/load custom presets
|
||||
5. Multi-per-page PDF layout (1, 2, or 4 flyers per US Letter page)
|
||||
|
||||
## Architecture
|
||||
|
||||
### Approach: Client-Side Rendering
|
||||
|
||||
The flyer is rendered as a React component in the dialog preview. Export uses `html2canvas` + `jsPDF` for PDF/PNG, and DOM serialization for HTML. This gives:
|
||||
- Instant preview of all customisation changes
|
||||
- Export to PDF, HTML, and PNG without backend involvement
|
||||
- No backend changes required — existing server-side endpoints remain but are unused
|
||||
|
||||
### Component Structure
|
||||
|
||||
```
|
||||
frontend/components/referrals/
|
||||
├── ReferralToolsDialog.tsx # Tabbed shell (QR Code | Printable Flyer)
|
||||
├── QRCodeTab.tsx # Extracted from current QRCodeDialog (preview + controls)
|
||||
├── FlyerTab.tsx # Flyer preview + controls container
|
||||
├── FlyerPreview.tsx # Flyer rendered as React component (live preview)
|
||||
├── FlyerControls.tsx # Right-side customisation panel
|
||||
├── FlyerExport.tsx # PDF/HTML/PNG export logic
|
||||
└── flyer-presets.ts # Built-in presets + localStorage save/load helpers
|
||||
```
|
||||
|
||||
### State Flow
|
||||
|
||||
- `ReferralToolsDialog` owns active tab state and QR style prefs (both tabs need them)
|
||||
- `QRCodeTab` receives QR prefs + updater — works exactly as current `QRCodeDialog`
|
||||
- `FlyerTab` receives QR prefs (read-only, for embedding styled QR in flyer) + owns its own flyer config state
|
||||
- Flyer config persisted to localStorage under `nk-flyer-prefs` (same debounced pattern as QR prefs)
|
||||
- A small "Edit QR Style" link on the Flyer tab (near the QR in the preview) switches to the QR tab
|
||||
|
||||
## Flyer Config Model
|
||||
|
||||
```typescript
|
||||
interface FlyerConfig {
|
||||
// Colors
|
||||
bgColor: string; // default: '#faf8f5'
|
||||
headlineGradient: string[]; // default: ['#c45aff', '#ff7acc', '#ff5a8a']
|
||||
headlineSubColor: string; // default: '#1a1a1a'
|
||||
textColor: string; // default: '#1a1a1a'
|
||||
subtextColor: string; // default: '#666'
|
||||
accentColor: string; // step numbers, divider
|
||||
|
||||
// Text overrides (null = use default)
|
||||
headlineMain: string | null;
|
||||
headlineSub: string | null;
|
||||
subtitle: string | null;
|
||||
ctaLabel: string | null;
|
||||
ctaNote: string | null;
|
||||
steps: Array<{ title: string | null; desc: string | null }>;
|
||||
|
||||
// Section visibility
|
||||
showSubtitle: boolean;
|
||||
showSteps: boolean;
|
||||
showDivider: boolean;
|
||||
showBottomFeatures: boolean;
|
||||
showBottomTagline: boolean;
|
||||
|
||||
// Custom branding
|
||||
customLogoUrl: string | null; // data URL from file upload
|
||||
|
||||
// Print layout
|
||||
perPage: 1 | 2 | 4;
|
||||
marginMm: number; // page margin in mm, default 15
|
||||
}
|
||||
```
|
||||
|
||||
## Built-in Presets
|
||||
|
||||
**Light:** Current light template defaults — cream background (`#faf8f5`), dark text, pink/purple accent gradient.
|
||||
|
||||
**Dark:** Current dark template defaults — dark background, light text, pink/purple accent gradient.
|
||||
|
||||
## Custom Presets
|
||||
|
||||
- Stored in localStorage under `nk-flyer-custom-presets` as `Array<{ name: string; config: FlyerConfig }>`
|
||||
- "Save as Preset" button in controls — prompts for a name inline
|
||||
- "Load Preset" dropdown shows built-in + custom presets
|
||||
- "Delete" option on custom presets only
|
||||
- Editing any value after loading a preset shows dropdown as "Custom" / unsaved state
|
||||
|
||||
## Flyer Preview
|
||||
|
||||
`FlyerPreview.tsx` is a React port of the existing `backend/templates/printables/website-referral-flyer.html`.
|
||||
|
||||
- Rendered at fixed internal size matching US Letter proportions (8.5" x 11")
|
||||
- CSS `transform: scale()` fits it into the dialog preview area
|
||||
- All config changes reflect instantly via React re-rendering
|
||||
- QR code rendered via `qr-code-styling` instance using the current QR prefs from the QR tab
|
||||
- Custom logo shown to the right of the Nomad Karaoke logo in the header
|
||||
|
||||
**Multi-page preview:** When `perPage` is 2 or 4, the preview shows the page layout with the flyer duplicated and scaled into a grid (1x2 or 2x2) with configured margins. Shows exactly what the printed page will look like.
|
||||
|
||||
## Flyer Controls Panel
|
||||
|
||||
`FlyerControls.tsx` — right side, scrollable, organized in collapsible sections:
|
||||
|
||||
### Preset Selector (top, always visible)
|
||||
- Dropdown: Light, Dark, custom presets
|
||||
- "Save as Preset" button
|
||||
|
||||
### Colors
|
||||
- Background — color picker
|
||||
- Headline gradient — 3 color pickers (start, mid, end)
|
||||
- Headline sub — color picker
|
||||
- Text — color picker
|
||||
- Subtext — color picker
|
||||
- Accent — color picker
|
||||
- "Reset Colors" button
|
||||
|
||||
### Text Overrides
|
||||
- Each field shows default as placeholder; empty = use default
|
||||
- Headline main, Headline sub, Subtitle, CTA label, CTA note
|
||||
- Steps 1-4: title + description each, collapsible per step
|
||||
|
||||
### Sections
|
||||
- Toggle switches: Subtitle, How-It-Works Steps, Divider, Bottom Features, Bottom Tagline
|
||||
|
||||
### Branding
|
||||
- File upload (png, jpg, svg)
|
||||
- Thumbnail preview + "Remove" button
|
||||
|
||||
### Print Layout
|
||||
- Per page: segmented button (1 / 2 / 4)
|
||||
- Page margins: slider (0-30mm, default 15mm)
|
||||
|
||||
## Export
|
||||
|
||||
### Formats
|
||||
- **PDF** (primary) — `html2canvas` at 2x resolution + `jsPDF`. Multi-per-page: render once, place multiple times at scale with margins.
|
||||
- **HTML** — serialize flyer DOM + inline styles, Google Fonts as links. Self-contained file.
|
||||
- **PNG** — `html2canvas` at 2x, single flyer only (ignores per-page setting).
|
||||
|
||||
### UX
|
||||
- Primary button: "Download PDF"
|
||||
- Secondary buttons: "Download HTML", "Download PNG"
|
||||
- Filename: `nomad-karaoke-flyer-{referralCode}.{ext}` (overridable via `flyerFilename` prop)
|
||||
|
||||
### New Dependencies
|
||||
- `html2canvas` — DOM-to-canvas rasterization
|
||||
- `jspdf` — PDF composition
|
||||
- ~200KB combined, client-side only
|
||||
|
||||
## Migration & Integration
|
||||
|
||||
### Dialog Rename
|
||||
- `QRCodeDialog` → `ReferralToolsDialog` (same props interface)
|
||||
- `ReferralDashboard.tsx` — update import
|
||||
- `admin/referrals/page.tsx` — update import; `onGenerateFlyer` prop becomes unused but kept for backwards compat
|
||||
|
||||
### Dialog Sizing
|
||||
- Expand from `sm:max-w-2xl` to `sm:max-w-4xl`
|
||||
|
||||
### i18n
|
||||
- New keys in `referrals` namespace for tab names, control labels, section headers, preset names, export buttons
|
||||
- Run `translate.py --target all` for all 33 locales
|
||||
- Admin pages are English-only, no concern
|
||||
|
||||
### Backend
|
||||
- No changes. Existing flyer endpoints remain functional but unused by frontend.
|
||||
|
||||
## Testing
|
||||
|
||||
- Unit tests for preset save/load logic and config defaults (`flyer-presets.ts`)
|
||||
- Unit tests for export functions with mocked html2canvas/jsPDF (`FlyerExport.tsx`)
|
||||
- Update existing `QRCodeDialog.test.tsx` → `ReferralToolsDialog.test.tsx`
|
||||
- Tab switching
|
||||
- Flyer config persistence to localStorage
|
||||
- QR-to-flyer state flow (QR prefs reflected in flyer preview)
|
||||
- Section visibility toggles
|
||||
- Preset loading/saving
|
||||
|
||||
## Decisions Log
|
||||
|
||||
| Decision | Rationale |
|
||||
|----------|-----------|
|
||||
| Client-side rendering over server-side | Instant preview, export to HTML/PNG/PDF, no backend changes |
|
||||
| Tabbed dialog over separate modals | Cohesive UX, natural QR→flyer flow |
|
||||
| QR config shared via parent state | Single source of truth, "Edit QR Style" link for easy tab switch |
|
||||
| localStorage for presets | Same pattern as existing QR prefs, no backend persistence needed |
|
||||
| html2canvas + jsPDF over other libs | Well-maintained, reasonable bundle size, handles single-page flyer well |
|
||||
| Keep backend endpoints | No breaking changes, can deprecate later |
|
||||
File diff suppressed because it is too large.
Load diff
@@ -221,8 +221,8 @@ function AppPageContent() {
|
||||
className="min-h-[40px] px-2 sm:px-3"
|
||||
style={{ color: 'var(--text-muted)' }}
|
||||
>
|
||||
<RefreshCw className={`w-4 h-4 sm:me-2 ${isLoadingJobs ? 'animate-spin' : ''}`} />
|
||||
<span className="hidden sm:inline">{t('refresh')}</span>
|
||||
<RefreshCw className={`w-4 h-4 me-1.5 ${isLoadingJobs ? 'animate-spin' : ''}`} />
|
||||
<span className="text-sm">{t('refresh')}</span>
|
||||
</Button>
|
||||
{isAdmin && (
|
||||
<TooltipProvider>
|
||||
@@ -256,7 +256,7 @@ function AppPageContent() {
|
||||
onClose={() => setShowFeedbackDialog(false)}
|
||||
/>
|
||||
|
||||
<main className="px-4 pt-24 pb-8 space-y-6">
|
||||
<main className="px-4 pt-28 sm:pt-24 pb-8 space-y-6">
|
||||
{/* Push notification prompt - shows once when appropriate */}
|
||||
<PushNotificationPrompt />
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
'use client';
|
||||
|
||||
import { Suspense } from 'react';
|
||||
import ReferralDashboard from '@/components/referrals/ReferralDashboard';
|
||||
import { AppHeader } from '@/components/app-header';
|
||||
import { Link } from '@/i18n/routing';
|
||||
import { ChevronLeft } from 'lucide-react';
|
||||
import { ChevronLeft, Loader2 } from 'lucide-react';
|
||||
import { useTranslations } from 'next-intl';
|
||||
|
||||
export default function ReferralsPage() {
|
||||
@@ -12,7 +13,7 @@ export default function ReferralsPage() {
|
||||
return (
|
||||
<div className="min-h-screen" style={{ backgroundColor: 'var(--background)' }}>
|
||||
<AppHeader />
|
||||
<main className="container mx-auto max-w-4xl px-4 pt-20 pb-6">
|
||||
<main className="container mx-auto max-w-4xl px-4 pt-24 sm:pt-20 pb-6">
|
||||
<Link
|
||||
href="/app"
|
||||
className="inline-flex items-center gap-1 text-sm mb-4 hover:underline"
|
||||
@@ -21,7 +22,9 @@ export default function ReferralsPage() {
|
||||
<ChevronLeft className="w-4 h-4" />
|
||||
{t('backToDashboard')}
|
||||
</Link>
|
||||
<ReferralDashboard />
|
||||
<Suspense fallback={<Loader2 className="w-6 h-6 animate-spin mx-auto mt-8" style={{ color: 'var(--text-muted)' }} />}>
|
||||
<ReferralDashboard />
|
||||
</Suspense>
|
||||
</main>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -6,7 +6,7 @@ import { useTranslations } from 'next-intl';
|
||||
import { getReferralInterstitial } from '@/lib/api';
|
||||
import { setReferralCode } from '@/lib/referral';
|
||||
import { useAuth } from '@/lib/auth';
|
||||
import { getAccessToken } from '@/lib/api';
|
||||
import { getAccessToken, clearAccessToken, API_BASE_URL } from '@/lib/api';
|
||||
import type { ReferralInterstitial } from '@/lib/types';
|
||||
import { Gift, ArrowRight, Mail, CheckCircle, Loader2 } from 'lucide-react';
|
||||
|
||||
@@ -34,9 +34,23 @@ export function ReferralInterstitialClient() {
|
||||
// Store referral code immediately
|
||||
setReferralCode(code);
|
||||
|
||||
// Check if already logged in
|
||||
if (getAccessToken()) {
|
||||
setIsLoggedIn(true);
|
||||
// Validate token with backend (don't trust localStorage alone — token may be stale)
|
||||
const token = getAccessToken();
|
||||
if (token) {
|
||||
fetch(`${API_BASE_URL}/api/users/me`, {
|
||||
headers: { 'Authorization': `Bearer ${token}` },
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.ok) {
|
||||
setIsLoggedIn(true);
|
||||
} else {
|
||||
// Stale token — clear it so the user can re-authenticate
|
||||
clearAccessToken();
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
// Network error — don't assume logged in
|
||||
});
|
||||
}
|
||||
|
||||
getReferralInterstitial(code)
|
||||
|
||||
@@ -20,7 +20,7 @@ import {
|
||||
Share2, Link as LinkIcon, Users, MousePointerClick, DollarSign,
|
||||
Plus, Copy, Check, RefreshCw, Loader2, ToggleLeft, ToggleRight, Pencil, QrCode,
|
||||
} from "lucide-react"
|
||||
import QRCodeDialog from "@/components/referrals/QRCodeDialog"
|
||||
import ReferralToolsDialog from "@/components/referrals/ReferralToolsDialog"
|
||||
import { NextIntlClientProvider } from "next-intl"
|
||||
import enMessages from "@/messages/en.json"
|
||||
|
||||
@@ -498,12 +498,12 @@ export default function ReferralsPage() {
|
||||
{/* QR Code / Flyer Dialog */}
|
||||
{qrDialogCode && (
|
||||
<NextIntlClientProvider locale="en" messages={enMessages}>
|
||||
<QRCodeDialog
|
||||
<ReferralToolsDialog
|
||||
referralUrl={`https://nomadkaraoke.com/r/${qrDialogCode}`}
|
||||
open={!!qrDialogCode}
|
||||
onOpenChange={(open) => { if (!open) setQrDialogCode(null) }}
|
||||
onGenerateFlyer={(theme, qrDataUrl) => adminApi.generateFlyer(qrDialogCode, theme, qrDataUrl)}
|
||||
flyerFilename={`nomad-karaoke-flyer-${qrDialogCode}.pdf`}
|
||||
flyerFilename={`nomad-karaoke-flyer-${qrDialogCode}`}
|
||||
referralCode={qrDialogCode}
|
||||
/>
|
||||
</NextIntlClientProvider>
|
||||
)}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
import { LocaleRedirect } from "@/components/LocaleRedirect"
|
||||
|
||||
export default function ReferralsRedirect() {
|
||||
return <LocaleRedirect />
|
||||
}
|
||||
@@ -40,7 +40,7 @@ const LOCALE_INFO: { code: string; native: string; english: string; flag: string
|
||||
{ code: 'ca', native: 'Catal\u00e0', english: 'Catalan', flag: '\u{1F3F4}' },
|
||||
];
|
||||
|
||||
export default function LanguageSwitcher() {
|
||||
export default function LanguageSwitcher({ showLabel }: { showLabel?: boolean } = {}) {
|
||||
const locale = useLocale();
|
||||
const router = useRouter();
|
||||
const pathname = usePathname();
|
||||
@@ -87,7 +87,7 @@ export default function LanguageSwitcher() {
|
||||
className="inline-flex items-center gap-1.5 bg-transparent border border-border/50 rounded-md px-2 py-1 text-sm cursor-pointer text-muted-foreground hover:text-foreground hover:border-border transition-colors"
|
||||
>
|
||||
<span className="text-base leading-none">{current.flag}</span>
|
||||
<span className="hidden sm:inline">{current.native}</span>
|
||||
<span className={showLabel ? '' : 'hidden sm:inline'}>{current.native}</span>
|
||||
</button>
|
||||
|
||||
{open && (
|
||||
|
||||
@@ -7,6 +7,12 @@ import { AuthStatus } from '../auth/AuthStatus'
|
||||
import { AuthDialog } from '../auth/AuthDialog'
|
||||
import { useAuth } from '@/lib/auth'
|
||||
|
||||
// Mock next/navigation
|
||||
const mockPush = jest.fn()
|
||||
jest.mock('next/navigation', () => ({
|
||||
useRouter: () => ({ push: mockPush }),
|
||||
}))
|
||||
|
||||
// Mock the auth module
|
||||
jest.mock('@/lib/auth', () => ({
|
||||
useAuth: jest.fn(),
|
||||
|
||||
@@ -30,11 +30,14 @@ import { ReactNode, useState, useEffect } from "react"
|
||||
* Matches the dashboard header style. Pass page-specific
|
||||
* buttons via the `children` prop (rendered before the
|
||||
* standard right-side controls).
|
||||
*
|
||||
* Mobile: two rows — row 1 (brand + auth), row 2 (actions with text labels).
|
||||
* Desktop (sm+): single row as before.
|
||||
*/
|
||||
export function AppHeader({ children }: { children?: ReactNode }) {
|
||||
const t = useTranslations('dashboard')
|
||||
const tHeader = useTranslations('header')
|
||||
const { branding, isDefaultTenant } = useTenant()
|
||||
const { branding, isDefault: isDefaultTenant } = useTenant()
|
||||
const { isDarkMode, toggleTheme } = useTheme()
|
||||
const [mounted, setMounted] = useState(false)
|
||||
|
||||
@@ -42,86 +45,132 @@ export function AppHeader({ children }: { children?: ReactNode }) {
|
||||
|
||||
return (
|
||||
<header className="fixed top-0 left-0 right-0 z-50 bg-dark-900/80 backdrop-blur-md border-b border-dark-700">
|
||||
<div className="px-3 sm:px-4 py-2 sm:py-3 flex items-center justify-between gap-2">
|
||||
<div className="flex items-center gap-2 sm:gap-3 min-w-0">
|
||||
{/* Desktop: single row (sm+) */}
|
||||
<div className="hidden sm:flex px-4 py-3 items-center justify-between gap-2">
|
||||
<div className="flex items-center gap-3 min-w-0">
|
||||
<Link href="/app">
|
||||
{isDefaultTenant ? (
|
||||
/* eslint-disable-next-line @next/next/no-img-element */
|
||||
<img src="/nomad-karaoke-logo.svg" alt="Nomad Karaoke" className="h-8 sm:h-10 shrink-0" />
|
||||
<img src="/nomad-karaoke-logo.svg" alt="Nomad Karaoke" className="h-10 shrink-0" />
|
||||
) : (
|
||||
<TenantLogo size="sm" />
|
||||
)}
|
||||
</Link>
|
||||
<div className="min-w-0">
|
||||
<Link href="/app" className="text-base sm:text-xl font-bold truncate block" style={{ color: 'var(--text)' }}>
|
||||
<Link href="/app" className="text-xl font-bold truncate block" style={{ color: 'var(--text)' }}>
|
||||
{isDefaultTenant ? t('title') : branding.site_title}
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center gap-1 sm:gap-2 shrink-0">
|
||||
<div className="flex items-center gap-2 shrink-0">
|
||||
{children}
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="min-h-[40px] px-2 sm:px-3"
|
||||
style={{ color: 'var(--text-muted)' }}
|
||||
>
|
||||
<HelpCircle className="w-4 h-4" />
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent align="end" className="w-64">
|
||||
<DropdownMenuLabel className="text-sm font-normal">
|
||||
{tHeader('helpPrompt')}
|
||||
</DropdownMenuLabel>
|
||||
<DropdownMenuSeparator />
|
||||
<DropdownMenuItem asChild>
|
||||
<a href="mailto:andrew@nomadkaraoke.com">
|
||||
<Mail className="w-4 h-4 me-2" />
|
||||
andrew@nomadkaraoke.com
|
||||
</a>
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem asChild>
|
||||
<a href="tel:+18036363267">
|
||||
<Phone className="w-4 h-4 me-2" />
|
||||
+1 (803) 636-3267
|
||||
</a>
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
<Link href="/app/referrals" className="flex items-center gap-1.5 text-sm hover:underline min-h-[40px] px-2 sm:px-3" style={{ color: 'var(--text-muted)' }}>
|
||||
<HelpDropdown tHeader={tHeader} />
|
||||
<Link href="/app/referrals" className="flex items-center gap-1.5 text-sm hover:underline min-h-[40px] px-3" style={{ color: 'var(--text-muted)' }}>
|
||||
<Users className="w-4 h-4" />
|
||||
<span className="hidden sm:inline">{t('referrals')}</span>
|
||||
<span>{t('referrals')}</span>
|
||||
</Link>
|
||||
<LanguageSwitcher />
|
||||
<AuthStatus />
|
||||
{mounted && (
|
||||
<TooltipProvider>
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={toggleTheme}
|
||||
className="min-h-[40px] px-2 sm:px-3"
|
||||
style={{ color: 'var(--text-muted)' }}
|
||||
>
|
||||
{isDarkMode ? (
|
||||
<Sun className="w-4 h-4" />
|
||||
) : (
|
||||
<Moon className="w-4 h-4" />
|
||||
)}
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent side="bottom">
|
||||
<p>{isDarkMode ? t('switchToLightMode') : t('switchToDarkMode')}</p>
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
</TooltipProvider>
|
||||
)}
|
||||
{mounted && <ThemeToggle isDarkMode={isDarkMode} toggleTheme={toggleTheme} t={t} />}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Mobile: two rows (< sm) */}
|
||||
<div className="sm:hidden">
|
||||
{/* Row 1: Brand + Auth */}
|
||||
<div className="px-3 py-2 flex items-center justify-between gap-2">
|
||||
<div className="flex items-center gap-2 min-w-0">
|
||||
<Link href="/app">
|
||||
{isDefaultTenant ? (
|
||||
/* eslint-disable-next-line @next/next/no-img-element */
|
||||
<img src="/nomad-karaoke-logo.svg" alt="Nomad Karaoke" className="h-8 shrink-0" />
|
||||
) : (
|
||||
<TenantLogo size="sm" />
|
||||
)}
|
||||
</Link>
|
||||
<div className="min-w-0">
|
||||
<Link href="/app" className="text-base font-bold truncate block" style={{ color: 'var(--text)' }}>
|
||||
{isDefaultTenant ? t('title') : branding.site_title}
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
<AuthStatus />
|
||||
</div>
|
||||
{/* Row 2: Action buttons with text labels */}
|
||||
<div className="px-3 pb-2 flex items-center gap-1 flex-wrap">
|
||||
{children}
|
||||
<HelpDropdown tHeader={tHeader} showLabel />
|
||||
<Link href="/app/referrals" className="flex items-center gap-1.5 text-sm hover:underline min-h-[36px] px-2" style={{ color: 'var(--text-muted)' }}>
|
||||
<Users className="w-4 h-4" />
|
||||
<span>{t('referrals')}</span>
|
||||
</Link>
|
||||
<LanguageSwitcher showLabel />
|
||||
{mounted && <ThemeToggle isDarkMode={isDarkMode} toggleTheme={toggleTheme} t={t} />}
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
)
|
||||
}
|
||||
|
||||
function HelpDropdown({ tHeader, showLabel }: { tHeader: ReturnType<typeof useTranslations>; showLabel?: boolean }) {
|
||||
return (
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="min-h-[40px] px-2 sm:px-3"
|
||||
style={{ color: 'var(--text-muted)' }}
|
||||
>
|
||||
<HelpCircle className="w-4 h-4" />
|
||||
{showLabel && <span className="ms-1.5 text-sm">{tHeader('needHelp')}</span>}
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent align="end" className="w-64">
|
||||
<DropdownMenuLabel className="text-sm font-normal">
|
||||
{tHeader('helpPrompt')}
|
||||
</DropdownMenuLabel>
|
||||
<DropdownMenuSeparator />
|
||||
<DropdownMenuItem asChild>
|
||||
<a href="mailto:andrew@nomadkaraoke.com">
|
||||
<Mail className="w-4 h-4 me-2" />
|
||||
andrew@nomadkaraoke.com
|
||||
</a>
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem asChild>
|
||||
<a href="tel:+18036363267">
|
||||
<Phone className="w-4 h-4 me-2" />
|
||||
+1 (803) 636-3267
|
||||
</a>
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
)
|
||||
}
|
||||
|
||||
function ThemeToggle({ isDarkMode, toggleTheme, t }: { isDarkMode: boolean; toggleTheme: () => void; t: ReturnType<typeof useTranslations> }) {
|
||||
return (
|
||||
<TooltipProvider>
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={toggleTheme}
|
||||
className="min-h-[40px] px-2 sm:px-3"
|
||||
style={{ color: 'var(--text-muted)' }}
|
||||
>
|
||||
{isDarkMode ? (
|
||||
<Sun className="w-4 h-4" />
|
||||
) : (
|
||||
<Moon className="w-4 h-4" />
|
||||
)}
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent side="bottom">
|
||||
<p>{isDarkMode ? t('switchToLightMode') : t('switchToDarkMode')}</p>
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
</TooltipProvider>
|
||||
)
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
"use client"
|
||||
|
||||
import { useState, useEffect } from "react"
|
||||
import { useRouter } from "next/navigation"
|
||||
import { User, LogOut, CreditCard, Coins, KeyRound, Shield, FlaskConical, Gift, Tag } from "lucide-react"
|
||||
import NextLink from "next/link"
|
||||
import { Button } from "@/components/ui/button"
|
||||
@@ -27,6 +28,7 @@ interface AuthStatusProps {
|
||||
export function AuthStatus({ onAuthChange }: AuthStatusProps) {
|
||||
const t = useTranslations('auth.status')
|
||||
const tHeader = useTranslations('header')
|
||||
const router = useRouter()
|
||||
const { user, logout } = useAuth()
|
||||
const { showTestData, setShowTestData } = useAdminSettings()
|
||||
const [showAuthDialog, setShowAuthDialog] = useState(false)
|
||||
@@ -106,8 +108,12 @@ export function AuthStatus({ onAuthChange }: AuthStatusProps) {
|
||||
</DropdownMenuItem>
|
||||
{user.has_active_referral_discount && user.referral_discount_percent && (
|
||||
<DropdownMenuItem
|
||||
className="text-green-500 focus:text-green-400 focus:bg-secondary cursor-default"
|
||||
disabled
|
||||
className="text-green-500 focus:text-green-400 focus:bg-secondary cursor-pointer"
|
||||
onClick={() => {
|
||||
localStorage.removeItem("nomad-discount-banner-dismissed")
|
||||
router.push("/app")
|
||||
}}
|
||||
title={t('discountActiveHint')}
|
||||
>
|
||||
<Tag className="w-4 h-4 mr-2" />
|
||||
<span>{user.referral_discount_percent}% {t('discountActive')}</span>
|
||||
|
||||
@@ -4,9 +4,9 @@ import { useState, useEffect } from 'react'
|
||||
import { CreditCard, Loader2 } from 'lucide-react'
|
||||
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription } from '@/components/ui/dialog'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { api, CreditPackage } from '@/lib/api'
|
||||
import { api, CreditPackage, getReferralInterstitial } from '@/lib/api'
|
||||
import { useAuth } from '@/lib/auth'
|
||||
import { useTranslations } from 'next-intl'
|
||||
import { useTranslations, useLocale } from 'next-intl'
|
||||
|
||||
interface BuyCreditsDialogProps {
|
||||
open: boolean
|
||||
@@ -22,12 +22,14 @@ export function BuyCreditsDialog({ open, onClose }: BuyCreditsDialogProps) {
|
||||
const t = useTranslations('credits')
|
||||
const tCommon = useTranslations('common')
|
||||
const tRef = useTranslations('referrals')
|
||||
const locale = useLocale()
|
||||
const { user } = useAuth()
|
||||
const [packages, setPackages] = useState<CreditPackage[]>([])
|
||||
const [selectedPackage, setSelectedPackage] = useState<CreditPackage | null>(null)
|
||||
const [loading, setLoading] = useState(false)
|
||||
const [checkoutLoading, setCheckoutLoading] = useState(false)
|
||||
const [error, setError] = useState('')
|
||||
const [referrerName, setReferrerName] = useState<string | null>(null)
|
||||
|
||||
useEffect(() => {
|
||||
if (!open) return
|
||||
@@ -45,7 +47,15 @@ export function BuyCreditsDialog({ open, onClose }: BuyCreditsDialogProps) {
|
||||
setError(err instanceof Error ? err.message : 'Failed to load packages')
|
||||
})
|
||||
.finally(() => setLoading(false))
|
||||
}, [open])
|
||||
|
||||
// Fetch referrer details if user has an active referral discount
|
||||
setReferrerName(null)
|
||||
if (user?.referred_by_code) {
|
||||
getReferralInterstitial(user.referred_by_code, true)
|
||||
.then((info) => setReferrerName(info.referrer_display_name))
|
||||
.catch(() => setReferrerName(null))
|
||||
}
|
||||
}, [open, user?.referred_by_code])
|
||||
|
||||
const handleCheckout = async () => {
|
||||
if (!selectedPackage || !user?.email) return
|
||||
@@ -79,9 +89,19 @@ export function BuyCreditsDialog({ open, onClose }: BuyCreditsDialogProps) {
|
||||
<p className="text-green-600 dark:text-green-400 text-sm font-medium">
|
||||
{tRef('discountBadge', { percent: user.referral_discount_percent })}
|
||||
</p>
|
||||
{referrerName && (
|
||||
<p className="text-green-600/80 dark:text-green-400/80 text-xs mt-1">
|
||||
{tRef('referredBy', { name: referrerName })}
|
||||
</p>
|
||||
)}
|
||||
{user.referred_by_code && (
|
||||
<p className="text-green-600/60 dark:text-green-400/60 text-xs mt-0.5">
|
||||
{tRef('usingCode', { code: user.referred_by_code })}
|
||||
</p>
|
||||
)}
|
||||
{user.referral_discount_expires_at && (
|
||||
<p className="text-green-600/70 dark:text-green-400/70 text-xs mt-1">
|
||||
Applied automatically at checkout · Expires {new Date(user.referral_discount_expires_at).toLocaleDateString()}
|
||||
{tRef('appliedAtCheckout')} · {tRef('expires', { date: new Date(user.referral_discount_expires_at).toLocaleDateString(locale, { year: 'numeric', month: 'short', day: 'numeric' }) })}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,339 @@
|
||||
'use client';
|
||||
|
||||
import { useRef, useState } from 'react';
|
||||
import { useTranslations } from 'next-intl';
|
||||
import { ChevronDown, Trash2, Upload, X } from 'lucide-react';
|
||||
import { Switch } from '@/components/ui/switch';
|
||||
import { Slider } from '@/components/ui/slider';
|
||||
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/components/ui/collapsible';
|
||||
import type { FlyerConfig, NamedPreset } from './flyer-presets';
|
||||
import {
|
||||
BUILT_IN_PRESETS,
|
||||
loadCustomPresets,
|
||||
saveCustomPreset,
|
||||
deleteCustomPreset,
|
||||
} from './flyer-presets';
|
||||
|
||||
interface FlyerControlsProps {
|
||||
config: FlyerConfig;
|
||||
onChange: <K extends keyof FlyerConfig>(key: K, value: FlyerConfig[K]) => void;
|
||||
onLoadPreset: (config: FlyerConfig) => void;
|
||||
}
|
||||
|
||||
function ColorPicker({ label, value, onChange }: { label: string; value: string; onChange: (v: string) => void }) {
|
||||
return (
|
||||
<div className="flex items-center gap-2">
|
||||
<input
|
||||
type="color"
|
||||
value={value.startsWith('#') ? value : '#000000'}
|
||||
onChange={(e) => onChange(e.target.value)}
|
||||
className="w-8 h-8 rounded border border-border cursor-pointer"
|
||||
/>
|
||||
<span className="text-xs text-muted-foreground">{label}</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function Section({ title, defaultOpen, children }: { title: string; defaultOpen?: boolean; children: React.ReactNode }) {
|
||||
const [open, setOpen] = useState(defaultOpen ?? true);
|
||||
return (
|
||||
<Collapsible open={open} onOpenChange={setOpen}>
|
||||
<CollapsibleTrigger className="flex items-center justify-between w-full py-1.5 text-sm font-medium text-foreground hover:text-primary transition-colors">
|
||||
{title}
|
||||
<ChevronDown className={`w-4 h-4 transition-transform ${open ? 'rotate-180' : ''}`} />
|
||||
</CollapsibleTrigger>
|
||||
<CollapsibleContent className="pt-2 pb-3 space-y-3">
|
||||
{children}
|
||||
</CollapsibleContent>
|
||||
</Collapsible>
|
||||
);
|
||||
}
|
||||
|
||||
const STEP_PLACEHOLDERS = [
|
||||
{ title: 'Pick any song', desc: 'Search by artist & title...' },
|
||||
{ title: 'Our system does the work', desc: 'Vocals removed, lyrics synced...' },
|
||||
{ title: 'Review & correct the lyrics and instrumental', desc: 'Fine-tune everything...' },
|
||||
{ title: 'Download or publish to YouTube', desc: 'Get your finished karaoke video...' },
|
||||
];
|
||||
|
||||
function detectActivePreset(config: FlyerConfig): string {
|
||||
const all = [...BUILT_IN_PRESETS, ...loadCustomPresets()];
|
||||
for (const preset of all) {
|
||||
if (preset.config.bgColor === config.bgColor
|
||||
&& preset.config.textColor === config.textColor
|
||||
&& preset.config.accentColor === config.accentColor
|
||||
&& JSON.stringify(preset.config.headlineGradient) === JSON.stringify(config.headlineGradient)) {
|
||||
return preset.name;
|
||||
}
|
||||
}
|
||||
return 'Custom';
|
||||
}
|
||||
|
||||
export default function FlyerControls({ config, onChange, onLoadPreset }: FlyerControlsProps) {
|
||||
const t = useTranslations('referrals');
|
||||
const [customPresets, setCustomPresets] = useState<NamedPreset[]>(loadCustomPresets);
|
||||
const [activePreset, setActivePreset] = useState<string>(() => detectActivePreset(config));
|
||||
const [saveName, setSaveName] = useState('');
|
||||
const [showSave, setShowSave] = useState(false);
|
||||
const fileInputRef = useRef<HTMLInputElement>(null);
|
||||
|
||||
const allPresets = [...BUILT_IN_PRESETS, ...customPresets];
|
||||
|
||||
const handleLoadPreset = (name: string) => {
|
||||
const preset = allPresets.find(p => p.name === name);
|
||||
if (preset) {
|
||||
onLoadPreset(preset.config);
|
||||
setActivePreset(name);
|
||||
}
|
||||
};
|
||||
|
||||
const handleSavePreset = () => {
|
||||
if (!saveName.trim()) return;
|
||||
saveCustomPreset(saveName.trim(), config);
|
||||
setCustomPresets(loadCustomPresets());
|
||||
setActivePreset(saveName.trim());
|
||||
setSaveName('');
|
||||
setShowSave(false);
|
||||
};
|
||||
|
||||
const handleDeletePreset = (name: string) => {
|
||||
deleteCustomPreset(name);
|
||||
setCustomPresets(loadCustomPresets());
|
||||
if (activePreset === name) setActivePreset('Custom');
|
||||
};
|
||||
|
||||
const handleConfigChange = <K extends keyof FlyerConfig>(key: K, value: FlyerConfig[K]) => {
|
||||
setActivePreset('Custom');
|
||||
onChange(key, value);
|
||||
};
|
||||
|
||||
const handleStepChange = (index: number, field: 'title' | 'desc', value: string) => {
|
||||
const newSteps = [...config.steps];
|
||||
newSteps[index] = { ...newSteps[index], [field]: value || null };
|
||||
handleConfigChange('steps', newSteps);
|
||||
};
|
||||
|
||||
const handleGradientChange = (index: number, value: string) => {
|
||||
const newGradient = [...config.headlineGradient];
|
||||
newGradient[index] = value;
|
||||
handleConfigChange('headlineGradient', newGradient);
|
||||
};
|
||||
|
||||
const handleLogoUpload = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
const file = e.target.files?.[0];
|
||||
if (!file) return;
|
||||
const reader = new FileReader();
|
||||
reader.onloadend = () => {
|
||||
handleConfigChange('customLogoUrl', reader.result as string);
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="flex-1 space-y-1 min-w-0 overflow-y-auto max-h-[65vh] pr-1">
|
||||
{/* Preset selector */}
|
||||
<div className="flex items-center gap-2 pb-2 border-b border-border">
|
||||
<select
|
||||
value={activePreset}
|
||||
onChange={(e) => handleLoadPreset(e.target.value)}
|
||||
className="flex-1 rounded border border-border bg-background text-foreground text-sm px-2 py-1.5"
|
||||
>
|
||||
{activePreset === 'Custom' && <option value="Custom">{t('flyerPresetCustom')}</option>}
|
||||
{allPresets.map(p => (
|
||||
<option key={p.name} value={p.name}>{p.name}</option>
|
||||
))}
|
||||
</select>
|
||||
{showSave ? (
|
||||
<div className="flex gap-1">
|
||||
<input
|
||||
value={saveName}
|
||||
onChange={(e) => setSaveName(e.target.value)}
|
||||
onKeyDown={(e) => e.key === 'Enter' && handleSavePreset()}
|
||||
placeholder={t('flyerPresetName')}
|
||||
className="w-28 rounded border border-border bg-background text-foreground text-xs px-2 py-1"
|
||||
autoFocus
|
||||
/>
|
||||
<button onClick={handleSavePreset} className="text-xs px-2 py-1 bg-primary text-primary-foreground rounded">
|
||||
{t('save')}
|
||||
</button>
|
||||
<button onClick={() => setShowSave(false)} className="text-xs px-1 py-1 text-muted-foreground">
|
||||
<X className="w-3 h-3" />
|
||||
</button>
|
||||
</div>
|
||||
) : (
|
||||
<button onClick={() => setShowSave(true)} className="text-xs px-2 py-1.5 border border-border rounded text-muted-foreground hover:text-foreground">
|
||||
{t('flyerPresetSave')}
|
||||
</button>
|
||||
)}
|
||||
{customPresets.some(p => p.name === activePreset) && (
|
||||
<button onClick={() => handleDeletePreset(activePreset)} className="text-xs px-1 py-1 text-destructive">
|
||||
<Trash2 className="w-3.5 h-3.5" />
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Colors */}
|
||||
<Section title={t('flyerColors')}>
|
||||
<ColorPicker label={t('qrBackground')} value={config.bgColor} onChange={(v) => handleConfigChange('bgColor', v)} />
|
||||
<div>
|
||||
<span className="text-xs text-muted-foreground">{t('flyerHeadlineGradient')}</span>
|
||||
<div className="flex gap-2 mt-1">
|
||||
{config.headlineGradient.map((c, i) => (
|
||||
<input
|
||||
key={i}
|
||||
type="color"
|
||||
value={c}
|
||||
onChange={(e) => handleGradientChange(i, e.target.value)}
|
||||
className="w-8 h-8 rounded border border-border cursor-pointer"
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<ColorPicker label={t('flyerHeadlineSubColor')} value={config.headlineSubColor} onChange={(v) => handleConfigChange('headlineSubColor', v)} />
|
||||
<ColorPicker label={t('flyerTextColor')} value={config.textColor} onChange={(v) => handleConfigChange('textColor', v)} />
|
||||
<ColorPicker label={t('flyerSubtextColor')} value={config.subtextColor} onChange={(v) => handleConfigChange('subtextColor', v)} />
|
||||
<ColorPicker label={t('flyerAccentColor')} value={config.accentColor} onChange={(v) => handleConfigChange('accentColor', v)} />
|
||||
</Section>
|
||||
|
||||
{/* Text Overrides */}
|
||||
<Section title={t('flyerTextOverrides')} defaultOpen={false}>
|
||||
<div className="space-y-2">
|
||||
<input
|
||||
value={config.headlineMain ?? ''}
|
||||
onChange={(e) => handleConfigChange('headlineMain', e.target.value || null)}
|
||||
placeholder="MAKE YOUR OWN"
|
||||
className="w-full rounded border border-border bg-background text-foreground text-xs px-2 py-1.5"
|
||||
/>
|
||||
<input
|
||||
value={config.headlineSub ?? ''}
|
||||
onChange={(e) => handleConfigChange('headlineSub', e.target.value || null)}
|
||||
placeholder="KARAOKE VIDEOS"
|
||||
className="w-full rounded border border-border bg-background text-foreground text-xs px-2 py-1.5"
|
||||
/>
|
||||
<textarea
|
||||
value={config.subtitle ?? ''}
|
||||
onChange={(e) => handleConfigChange('subtitle', e.target.value || null)}
|
||||
placeholder="Turn any song into a professional karaoke video..."
|
||||
className="w-full rounded border border-border bg-background text-foreground text-xs px-2 py-1.5 h-16 resize-none"
|
||||
/>
|
||||
<input
|
||||
value={config.ctaLabel ?? ''}
|
||||
onChange={(e) => handleConfigChange('ctaLabel', e.target.value || null)}
|
||||
placeholder="First track free + X% off with this link"
|
||||
className="w-full rounded border border-border bg-background text-foreground text-xs px-2 py-1.5"
|
||||
/>
|
||||
<input
|
||||
value={config.ctaNote ?? ''}
|
||||
onChange={(e) => handleConfigChange('ctaNote', e.target.value || null)}
|
||||
placeholder="Scan the QR code or visit the link above"
|
||||
className="w-full rounded border border-border bg-background text-foreground text-xs px-2 py-1.5"
|
||||
/>
|
||||
{config.steps.map((step, i) => (
|
||||
<Collapsible key={i}>
|
||||
<CollapsibleTrigger className="text-xs text-muted-foreground hover:text-foreground flex items-center gap-1">
|
||||
<ChevronDown className="w-3 h-3" /> Step {i + 1}
|
||||
</CollapsibleTrigger>
|
||||
<CollapsibleContent className="pl-4 pt-1 space-y-1">
|
||||
<input
|
||||
value={step.title ?? ''}
|
||||
onChange={(e) => handleStepChange(i, 'title', e.target.value)}
|
||||
placeholder={STEP_PLACEHOLDERS[i].title}
|
||||
className="w-full rounded border border-border bg-background text-foreground text-xs px-2 py-1"
|
||||
/>
|
||||
<input
|
||||
value={step.desc ?? ''}
|
||||
onChange={(e) => handleStepChange(i, 'desc', e.target.value)}
|
||||
placeholder={STEP_PLACEHOLDERS[i].desc}
|
||||
className="w-full rounded border border-border bg-background text-foreground text-xs px-2 py-1"
|
||||
/>
|
||||
</CollapsibleContent>
|
||||
</Collapsible>
|
||||
))}
|
||||
</div>
|
||||
</Section>
|
||||
|
||||
{/* Sections */}
|
||||
<Section title={t('flyerSections')}>
|
||||
{([
|
||||
['showSubtitle', t('flyerToggleSubtitle')],
|
||||
['showSteps', t('flyerToggleSteps')],
|
||||
['showDivider', t('flyerToggleDivider')],
|
||||
['showBottomFeatures', t('flyerToggleFeatures')],
|
||||
['showBottomTagline', t('flyerToggleTagline')],
|
||||
] as const).map(([key, label]) => (
|
||||
<div key={key} className="flex items-center justify-between">
|
||||
<span className="text-xs text-muted-foreground">{label}</span>
|
||||
<Switch
|
||||
checked={config[key] as boolean}
|
||||
onCheckedChange={(v) => handleConfigChange(key, v)}
|
||||
/>
|
||||
</div>
|
||||
))}
|
||||
</Section>
|
||||
|
||||
{/* Branding */}
|
||||
<Section title={t('flyerBranding')} defaultOpen={false}>
|
||||
<input
|
||||
ref={fileInputRef}
|
||||
type="file"
|
||||
accept="image/png,image/jpeg,image/svg+xml"
|
||||
onChange={handleLogoUpload}
|
||||
className="hidden"
|
||||
/>
|
||||
{config.customLogoUrl ? (
|
||||
<div className="flex items-center gap-2">
|
||||
<img src={config.customLogoUrl} alt="Custom logo" className="h-10 w-auto rounded border border-border" />
|
||||
<button
|
||||
onClick={() => handleConfigChange('customLogoUrl', null)}
|
||||
className="text-xs text-destructive flex items-center gap-1"
|
||||
>
|
||||
<X className="w-3 h-3" /> {t('flyerRemoveLogo')}
|
||||
</button>
|
||||
</div>
|
||||
) : (
|
||||
<button
|
||||
onClick={() => fileInputRef.current?.click()}
|
||||
className="text-xs px-3 py-1.5 border border-border rounded text-muted-foreground hover:text-foreground flex items-center gap-1.5"
|
||||
>
|
||||
<Upload className="w-3.5 h-3.5" /> {t('flyerUploadLogo')}
|
||||
</button>
|
||||
)}
|
||||
</Section>
|
||||
|
||||
{/* Print Layout */}
|
||||
<Section title={t('flyerPrintLayout')}>
|
||||
<div>
|
||||
<span className="text-xs text-muted-foreground">{t('flyerPerPage')}</span>
|
||||
<div className="flex gap-1.5 mt-1">
|
||||
{([1, 2, 4] as const).map(n => (
|
||||
<button
|
||||
key={n}
|
||||
onClick={() => handleConfigChange('perPage', n)}
|
||||
className={`px-3 py-1.5 text-xs rounded border transition-colors ${
|
||||
config.perPage === n
|
||||
? 'border-primary bg-primary/10 text-primary font-medium'
|
||||
: 'border-border text-muted-foreground hover:border-primary/50'
|
||||
}`}
|
||||
>
|
||||
{n}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div className="flex items-center justify-between">
|
||||
<span className="text-xs text-muted-foreground">{t('flyerMargins')}</span>
|
||||
<span className="text-xs text-muted-foreground">{config.marginMm}mm</span>
|
||||
</div>
|
||||
<Slider
|
||||
value={[config.marginMm]}
|
||||
onValueChange={([v]) => handleConfigChange('marginMm', v)}
|
||||
min={0}
|
||||
max={30}
|
||||
className="mt-1"
|
||||
/>
|
||||
</div>
|
||||
</Section>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
import html2canvas from 'html2canvas';
|
||||
import jsPDF from 'jspdf';
|
||||
|
||||
// US Letter in mm
|
||||
const PAGE_W_MM = 215.9;
|
||||
const PAGE_H_MM = 279.4;
|
||||
|
||||
interface PdfOptions {
|
||||
perPage: 1 | 2 | 4;
|
||||
marginMm: number;
|
||||
filename: string;
|
||||
}
|
||||
|
||||
export async function exportFlyerPdf(
|
||||
flyerElement: HTMLElement,
|
||||
options: PdfOptions,
|
||||
): Promise<void> {
|
||||
const { perPage, marginMm, filename } = options;
|
||||
|
||||
const canvas = await html2canvas(flyerElement, {
|
||||
scale: 2,
|
||||
useCORS: true,
|
||||
allowTaint: true,
|
||||
backgroundColor: null,
|
||||
});
|
||||
|
||||
const imgData = canvas.toDataURL('image/png');
|
||||
const pdf = new jsPDF({ orientation: 'portrait', unit: 'mm', format: 'letter' });
|
||||
|
||||
const margin = marginMm;
|
||||
const usableW = PAGE_W_MM - margin * 2;
|
||||
const usableH = PAGE_H_MM - margin * 2;
|
||||
const flyerAspect = 8.5 / 11;
|
||||
|
||||
if (perPage === 1) {
|
||||
let w = usableW;
|
||||
let h = w / flyerAspect;
|
||||
if (h > usableH) {
|
||||
h = usableH;
|
||||
w = h * flyerAspect;
|
||||
}
|
||||
const x = margin + (usableW - w) / 2;
|
||||
const y = margin + (usableH - h) / 2;
|
||||
pdf.addImage(imgData, 'PNG', x, y, w, h);
|
||||
} else if (perPage === 2) {
|
||||
const gapMm = margin;
|
||||
const slotH = (usableH - gapMm) / 2;
|
||||
let w = usableW;
|
||||
let h = w / flyerAspect;
|
||||
if (h > slotH) {
|
||||
h = slotH;
|
||||
w = h * flyerAspect;
|
||||
}
|
||||
const x = margin + (usableW - w) / 2;
|
||||
pdf.addImage(imgData, 'PNG', x, margin, w, h);
|
||||
pdf.addImage(imgData, 'PNG', x, margin + slotH + gapMm, w, h);
|
||||
} else {
|
||||
const gapMm = margin;
|
||||
const slotW = (usableW - gapMm) / 2;
|
||||
const slotH = (usableH - gapMm) / 2;
|
||||
let w = slotW;
|
||||
let h = w / flyerAspect;
|
||||
if (h > slotH) {
|
||||
h = slotH;
|
||||
w = h * flyerAspect;
|
||||
}
|
||||
const positions = [
|
||||
[margin, margin],
|
||||
[margin + slotW + gapMm, margin],
|
||||
[margin, margin + slotH + gapMm],
|
||||
[margin + slotW + gapMm, margin + slotH + gapMm],
|
||||
];
|
||||
for (const [px, py] of positions) {
|
||||
const offsetX = px + (slotW - w) / 2;
|
||||
const offsetY = py + (slotH - h) / 2;
|
||||
pdf.addImage(imgData, 'PNG', offsetX, offsetY, w, h);
|
||||
}
|
||||
}
|
||||
|
||||
pdf.save(filename);
|
||||
}
|
||||
|
||||
export function exportFlyerHtml(flyerElement: HTMLElement): Blob {
|
||||
const html = `<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Nomad Karaoke Referral Flyer</title>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Outfit:wght@400;500;600;700;800&display=swap" rel="stylesheet">
|
||||
<style>
|
||||
*, html { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
@page { size: 8.5in 11in; margin: 0; }
|
||||
body { display: flex; justify-content: center; }
|
||||
@media print { body { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
${flyerElement.outerHTML}
|
||||
</body>
|
||||
</html>`;
|
||||
return new Blob([html], { type: 'text/html' });
|
||||
}
|
||||
|
||||
export async function exportFlyerPng(
|
||||
flyerElement: HTMLElement,
|
||||
filename: string,
|
||||
): Promise<void> {
|
||||
const canvas = await html2canvas(flyerElement, {
|
||||
scale: 2,
|
||||
useCORS: true,
|
||||
allowTaint: true,
|
||||
backgroundColor: null,
|
||||
});
|
||||
|
||||
const blob = await new Promise<Blob>((resolve, reject) => {
|
||||
canvas.toBlob((b: Blob | null) => {
|
||||
if (b) resolve(b);
|
||||
else reject(new Error('Failed to export flyer as PNG'));
|
||||
}, 'image/png');
|
||||
});
|
||||
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = document.createElement('a');
|
||||
a.href = url;
|
||||
a.download = filename;
|
||||
a.click();
|
||||
URL.revokeObjectURL(url);
|
||||
}
|
||||
@@ -0,0 +1,286 @@
|
||||
'use client';
|
||||
|
||||
import { useEffect, useRef } from 'react';
|
||||
import type { FlyerConfig } from './flyer-presets';
|
||||
|
||||
// Default text values matching the original HTML template
|
||||
const DEFAULTS = {
|
||||
headlineMain: 'MAKE YOUR OWN',
|
||||
headlineSub: 'KARAOKE VIDEOS',
|
||||
subtitle:
|
||||
'Turn any song into a professional karaoke video with synced lyrics, vocal removal, and automatic YouTube publishing.',
|
||||
ctaLabel: (discountPercent: number) =>
|
||||
`First track free + ${discountPercent}% off with this link`,
|
||||
ctaNote: 'Scan the QR code or visit the link above',
|
||||
steps: [
|
||||
{ title: 'Pick any song', desc: 'Search by artist & title or paste a YouTube link' },
|
||||
{ title: 'Our system does the work', desc: 'Vocals removed, lyrics synced, video rendered automatically' },
|
||||
{ title: 'Review & correct the lyrics and instrumental', desc: 'Fine-tune everything before publishing' },
|
||||
{ title: 'Download or publish to YouTube', desc: 'Get your finished karaoke video in minutes' },
|
||||
],
|
||||
};
|
||||
|
||||
// Inline SVG Nomad Karaoke wordmark (from the HTML template)
|
||||
function NomadLogo({ color }: { color: string }) {
|
||||
return (
|
||||
<svg style={{ width: 260, height: 'auto' }} viewBox="45 60 255 135" xmlns="http://www.w3.org/2000/svg">
|
||||
<g fill={color} transform="translate(48.368003845214844,62.62239074707031)">
|
||||
<g transform="translate(0,0)">
|
||||
<g transform="scale(1.4000000000000004)">
|
||||
<g stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" paintOrder="stroke" fillOpacity="0">
|
||||
<path d="M1.4-33.44L1.4 0C31.48 0 3.96 0 34.04 0L34.04-32.64 17.81-32.64 17.81-20.61 1.4-33.44ZM52.21-33.76C42.6-33.76 34.81-25.97 34.81-16.37 34.81-6.76 42.6 1.03 52.21 1.03 61.81 1.03 69.6-6.76 69.6-16.37 69.6-25.97 61.81-33.76 52.21-33.76ZM70.7 0L103.34 0 103.25-33.9 86.93-21.54 70.61-33.9 70.7 0ZM102.34 0C138.2 0 107.52 0 143.56 0L122.95-34.93 102.34 0ZM158.84 0.05C167.84 0.05 175.16-7.27 175.16-16.27 175.16-25.27 167.84-32.64 158.84-32.64L142.52-32.64C142.52 0.75 142.52-33.34 142.52 0.05L158.84 0.05Z" transform="translate(-1.399999976158142, 34.93000030517578)" />
|
||||
</g>
|
||||
<g transform="translate(0,38.959999084472656)">
|
||||
<g stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" paintOrder="stroke" fill={color} fillOpacity="0" transform="scale(1.02719)">
|
||||
<path d="M24.43 0L17.67 0 7.98-11.87 7.98 0 2.63 0 2.63-26.64 7.98-26.64 7.98-14.69 17.67-26.64 24.12-26.64 13.13-13.44 24.43 0ZM45.03 0L43.27-5.08 32.66-5.08 30.91 0 25.3 0 34.88-26.68 41.1-26.68 50.68 0 45.03 0ZM34.11-9.35L41.82-9.35 37.97-20.5 34.11-9.35ZM73.19 0L67.01 0 61.13-10.38 58.61-10.38 58.61 0 53.27 0 53.27-26.64 63.27-26.64Q66.36-26.64 68.53-25.55 70.71-24.47 71.8-22.61 72.89-20.76 72.89-18.47L72.89-18.47Q72.89-15.84 71.36-13.72 69.83-11.6 66.82-10.8L66.82-10.8 73.19 0ZM58.61-22.21L58.61-14.39 63.08-14.39Q65.25-14.39 66.32-15.44 67.39-16.49 67.39-18.36L67.39-18.36Q67.39-20.19 66.32-21.2 65.25-22.21 63.08-22.21L63.08-22.21 58.61-22.21ZM94.82 0L93.07-5.08 82.46-5.08 80.7 0 75.09 0 84.67-26.68 90.89-26.68 100.47 0 94.82 0ZM83.91-9.35L91.62-9.35 87.76-20.5 83.91-9.35ZM115.43 0.27Q111.69 0.27 108.56-1.49 105.43-3.24 103.6-6.35 101.76-9.47 101.76-13.4L101.76-13.4Q101.76-17.29 103.6-20.4 105.43-23.51 108.56-25.27 111.69-27.02 115.43-27.02L115.43-27.02Q119.21-27.02 122.32-25.27 125.43-23.51 127.24-20.4 129.05-17.29 129.05-13.4L129.05-13.4Q129.05-9.47 127.24-6.35 125.43-3.24 122.3-1.49 119.17 0.27 115.43 0.27L115.43 0.27ZM115.43-4.5Q117.83-4.5 119.66-5.59 121.5-6.68 122.53-8.7 123.56-10.73 123.56-13.4L123.56-13.4Q123.56-16.07 122.53-18.07 121.5-20.08 119.66-21.15 117.83-22.21 115.43-22.21L115.43-22.21Q113.02-22.21 111.17-21.15 109.32-20.08 108.29-18.07 107.26-16.07 107.26-13.4L107.26-13.4Q107.26-10.73 108.29-8.7 109.32-6.68 111.17-5.59 113.02-4.5 115.43-4.5L115.43-4.5ZM153.82 0L147.06 0 137.37-11.87 137.37 0 132.02 0 132.02-26.64 137.37-26.64 137.37-14.69 147.06-26.64 153.51-26.64 142.52-13.44 153.82 0ZM171.79-22.33L161.67-22.33 161.67-15.65 170.64-15.65 170.64-11.41 161.67-11.41 161.67-4.35 171.79-4.35 171.79 0 156.33 0 156.33-26.68 171.79-26.68 171.79-22.33Z" transform="translate(-2.630000114440918, 27.020000457763672)" />
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
|
||||
interface FlyerPreviewProps {
|
||||
config: FlyerConfig;
|
||||
referralCode: string;
|
||||
discountPercent: number;
|
||||
qrDataUrl: string | null;
|
||||
/** Ref to the inner flyer element for export */
|
||||
flyerRef?: React.RefObject<HTMLDivElement | null>;
|
||||
}
|
||||
|
||||
export default function FlyerPreview({
|
||||
config,
|
||||
referralCode,
|
||||
discountPercent,
|
||||
qrDataUrl,
|
||||
flyerRef,
|
||||
}: FlyerPreviewProps) {
|
||||
const containerRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
// Scale flyer to fit its preview container
|
||||
useEffect(() => {
|
||||
const container = containerRef.current;
|
||||
if (!container) return;
|
||||
|
||||
const resize = () => {
|
||||
const flyerEl = container.querySelector('[data-flyer-page]') as HTMLElement;
|
||||
if (!flyerEl) return;
|
||||
const parentW = container.parentElement?.clientWidth || container.clientWidth;
|
||||
// Flyer: 8.5in x 11in at 96dpi = 816 x 1056 px
|
||||
const flyerW = 816;
|
||||
const flyerH = 1056;
|
||||
const scale = Math.min(parentW / flyerW, 1);
|
||||
flyerEl.style.transform = `scale(${scale})`;
|
||||
flyerEl.style.transformOrigin = 'top left';
|
||||
container.style.width = `${flyerW * scale}px`;
|
||||
container.style.height = `${flyerH * scale}px`;
|
||||
};
|
||||
|
||||
const observer = new ResizeObserver(resize);
|
||||
observer.observe(container.parentElement || container);
|
||||
resize();
|
||||
return () => observer.disconnect();
|
||||
}, []);
|
||||
|
||||
const headlineMain = config.headlineMain ?? DEFAULTS.headlineMain;
|
||||
const headlineSub = config.headlineSub ?? DEFAULTS.headlineSub;
|
||||
const subtitle = config.subtitle ?? DEFAULTS.subtitle;
|
||||
const ctaLabel = config.ctaLabel ?? DEFAULTS.ctaLabel(discountPercent);
|
||||
const ctaNote = config.ctaNote ?? DEFAULTS.ctaNote;
|
||||
const steps = DEFAULTS.steps.map((def, i) => ({
|
||||
title: config.steps[i]?.title ?? def.title,
|
||||
desc: config.steps[i]?.desc ?? def.desc,
|
||||
}));
|
||||
|
||||
const gradientStr = `linear-gradient(135deg, ${config.headlineGradient.join(', ')})`;
|
||||
|
||||
return (
|
||||
<div ref={containerRef} className="relative overflow-hidden">
|
||||
<div
|
||||
ref={flyerRef}
|
||||
data-flyer-page=""
|
||||
style={{
|
||||
width: 816,
|
||||
height: 1056,
|
||||
fontFamily: "'Outfit', sans-serif",
|
||||
background: config.bgColor,
|
||||
position: 'relative',
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
alignItems: 'center',
|
||||
padding: '0.6in 0.65in 0.5in',
|
||||
overflow: 'hidden',
|
||||
}}
|
||||
>
|
||||
{/* Logo row */}
|
||||
<div style={{ marginBottom: 24, display: 'flex', alignItems: 'center', gap: 16 }}>
|
||||
<NomadLogo color={config.accentColor} />
|
||||
{config.customLogoUrl && (
|
||||
<img
|
||||
src={config.customLogoUrl}
|
||||
alt="Custom logo"
|
||||
style={{ height: 60, width: 'auto', objectFit: 'contain' }}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Headline */}
|
||||
<div style={{ fontFamily: "'Bebas Neue', sans-serif", textAlign: 'center', lineHeight: 0.92, marginBottom: 6 }}>
|
||||
<div
|
||||
style={{
|
||||
fontSize: 96,
|
||||
letterSpacing: 3,
|
||||
background: gradientStr,
|
||||
WebkitBackgroundClip: 'text',
|
||||
WebkitTextFillColor: 'transparent',
|
||||
backgroundClip: 'text',
|
||||
}}
|
||||
>
|
||||
{headlineMain}
|
||||
</div>
|
||||
<div style={{ fontSize: 62, letterSpacing: 2, color: config.headlineSubColor }}>
|
||||
{headlineSub}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Subtitle */}
|
||||
{config.showSubtitle && (
|
||||
<div
|
||||
style={{
|
||||
fontSize: 20,
|
||||
fontWeight: 500,
|
||||
color: config.subtextColor,
|
||||
textAlign: 'center',
|
||||
maxWidth: '5.5in',
|
||||
lineHeight: 1.4,
|
||||
marginBottom: 28,
|
||||
}}
|
||||
>
|
||||
{subtitle}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Steps */}
|
||||
{config.showSteps && (
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 18, width: '100%', maxWidth: '6in', marginBottom: 28 }}>
|
||||
{steps.map((step, i) => (
|
||||
<div key={i} style={{ display: 'flex', alignItems: 'center', gap: 18 }}>
|
||||
<div
|
||||
style={{
|
||||
width: 52,
|
||||
height: 52,
|
||||
flexShrink: 0,
|
||||
borderRadius: '50%',
|
||||
background: `linear-gradient(135deg, ${config.accentColor}, ${config.headlineGradient[1] || config.accentColor})`,
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
fontFamily: "'Bebas Neue', sans-serif",
|
||||
fontSize: 30,
|
||||
color: '#fff',
|
||||
letterSpacing: 1,
|
||||
}}
|
||||
>
|
||||
{i + 1}
|
||||
</div>
|
||||
<div style={{ flex: 1 }}>
|
||||
<div style={{ fontSize: 22, fontWeight: 800, color: config.textColor, letterSpacing: -0.3 }}>
|
||||
{step.title}
|
||||
</div>
|
||||
<div style={{ fontSize: 16, fontWeight: 400, color: config.subtextColor, marginTop: 2 }}>
|
||||
{step.desc}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Divider */}
|
||||
{config.showDivider && (
|
||||
<div
|
||||
style={{
|
||||
width: '80%',
|
||||
height: 2,
|
||||
background: `linear-gradient(90deg, transparent, ${config.accentColor}4D, ${config.headlineGradient[1] || config.accentColor}4D, transparent)`,
|
||||
margin: '4px 0 24px',
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* CTA section */}
|
||||
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 40, width: '100%', marginBottom: 20 }}>
|
||||
<div
|
||||
style={{
|
||||
width: 180,
|
||||
height: 180,
|
||||
borderRadius: 16,
|
||||
background: '#fff',
|
||||
border: '3px solid #e8e4e0',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
flexShrink: 0,
|
||||
boxShadow: '0 4px 20px rgba(0,0,0,0.06)',
|
||||
overflow: 'hidden',
|
||||
}}
|
||||
>
|
||||
{qrDataUrl ? (
|
||||
<img src={qrDataUrl} alt={`QR Code - nomadkaraoke.com/r/${referralCode.toLowerCase()}`} style={{ width: '100%', height: '100%', objectFit: 'contain' }} />
|
||||
) : (
|
||||
<span style={{ fontSize: 14, color: '#999', textAlign: 'center', padding: 20 }}>QR Code</span>
|
||||
)}
|
||||
</div>
|
||||
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'flex-start' }}>
|
||||
<div style={{ fontSize: 16, fontWeight: 600, color: config.subtextColor, textTransform: 'uppercase', letterSpacing: 2, marginBottom: 6 }}>
|
||||
{ctaLabel}
|
||||
</div>
|
||||
<div style={{ fontFamily: "'Bebas Neue', sans-serif", fontSize: 38, letterSpacing: 2, color: config.textColor, lineHeight: 1, whiteSpace: 'nowrap' }}>
|
||||
NOMADKARAOKE.COM/R/
|
||||
<span
|
||||
style={{
|
||||
background: `linear-gradient(135deg, ${config.headlineGradient.join(', ')}, #ffdf6b)`,
|
||||
WebkitBackgroundClip: 'text',
|
||||
WebkitTextFillColor: 'transparent',
|
||||
backgroundClip: 'text',
|
||||
letterSpacing: 4,
|
||||
}}
|
||||
>
|
||||
{referralCode.toUpperCase()}
|
||||
</span>
|
||||
</div>
|
||||
<div style={{ fontSize: 15, color: config.subtextColor, marginTop: 8, fontWeight: 500 }}>
|
||||
{ctaNote}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Bottom */}
|
||||
<div style={{ marginTop: 'auto', width: '100%', display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
|
||||
{config.showBottomFeatures && (
|
||||
<div style={{ display: 'flex', gap: 24 }}>
|
||||
{[
|
||||
{ icon: '\u{1F3A4}', label: 'Any Song' },
|
||||
{ icon: '\u26A1', label: 'Automatic' },
|
||||
{ icon: '\u{1F3AC}', label: 'Pro Quality' },
|
||||
].map(({ icon, label }) => (
|
||||
<div key={label} style={{ display: 'flex', alignItems: 'center', gap: 8, fontSize: 14, fontWeight: 600, color: config.subtextColor }}>
|
||||
<span style={{ fontSize: 20 }}>{icon}</span>
|
||||
<span>{label}</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
{config.showBottomTagline && (
|
||||
<div style={{ fontSize: 14, fontWeight: 500, color: config.subtextColor, letterSpacing: 1, marginLeft: 'auto' }}>
|
||||
Wherever you are, sing!
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,194 @@
|
||||
'use client';
|
||||
|
||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import { useTranslations } from 'next-intl';
|
||||
import { Download, Pencil } from 'lucide-react';
|
||||
import type { QRStylePrefs } from './QRCodeTab';
|
||||
import type { FlyerConfig } from './flyer-presets';
|
||||
import { DEFAULT_FLYER_CONFIG, loadFlyerConfig, saveFlyerConfig } from './flyer-presets';
|
||||
import FlyerPreview from './FlyerPreview';
|
||||
import FlyerControls from './FlyerControls';
|
||||
import { exportFlyerPdf, exportFlyerHtml, exportFlyerPng } from './FlyerExport';
|
||||
|
||||
interface FlyerTabProps {
|
||||
referralCode: string;
|
||||
discountPercent: number;
|
||||
qrPrefs: QRStylePrefs;
|
||||
onSwitchToQr: () => void;
|
||||
flyerFilename?: string;
|
||||
}
|
||||
|
||||
export default function FlyerTab({ referralCode, discountPercent, qrPrefs, onSwitchToQr, flyerFilename }: FlyerTabProps) {
|
||||
const t = useTranslations('referrals');
|
||||
const flyerRef = useRef<HTMLDivElement>(null);
|
||||
const [config, setConfig] = useState<FlyerConfig>(DEFAULT_FLYER_CONFIG);
|
||||
const [exporting, setExporting] = useState<string | null>(null);
|
||||
const debounceRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
||||
const [qrDataUrl, setQrDataUrl] = useState<string | null>(null);
|
||||
|
||||
// Load saved config
|
||||
useEffect(() => {
|
||||
setConfig(loadFlyerConfig());
|
||||
}, []);
|
||||
|
||||
// Debounced save
|
||||
const updateConfig = useCallback(<K extends keyof FlyerConfig>(key: K, value: FlyerConfig[K]) => {
|
||||
setConfig(prev => {
|
||||
const next = { ...prev, [key]: value };
|
||||
if (debounceRef.current) clearTimeout(debounceRef.current);
|
||||
debounceRef.current = setTimeout(() => saveFlyerConfig(next), 300);
|
||||
return next;
|
||||
});
|
||||
}, []);
|
||||
|
||||
const loadPreset = useCallback((presetConfig: FlyerConfig) => {
|
||||
// Cancel any pending debounce to avoid overwriting the preset
|
||||
if (debounceRef.current) {
|
||||
clearTimeout(debounceRef.current);
|
||||
debounceRef.current = null;
|
||||
}
|
||||
setConfig(presetConfig);
|
||||
saveFlyerConfig(presetConfig);
|
||||
}, []);
|
||||
|
||||
// Render QR code for flyer using qr-code-styling
|
||||
useEffect(() => {
|
||||
let cancelled = false;
|
||||
const renderQr = async () => {
|
||||
const QRCodeStyling = (await import('qr-code-styling')).default;
|
||||
if (cancelled) return;
|
||||
|
||||
let image: string | undefined;
|
||||
if (qrPrefs.logo === 'nomad') {
|
||||
image = '/nomad-karaoke-logo.svg';
|
||||
} else if (qrPrefs.logo === 'emoji' && qrPrefs.logoEmoji) {
|
||||
const canvas = document.createElement('canvas');
|
||||
canvas.width = 64;
|
||||
canvas.height = 64;
|
||||
const ctx = canvas.getContext('2d');
|
||||
if (ctx) {
|
||||
ctx.font = '52px serif';
|
||||
ctx.textAlign = 'center';
|
||||
ctx.textBaseline = 'middle';
|
||||
ctx.fillText(qrPrefs.logoEmoji, 32, 36);
|
||||
image = canvas.toDataURL('image/png');
|
||||
}
|
||||
}
|
||||
|
||||
const qr = new QRCodeStyling({
|
||||
width: 160,
|
||||
height: 160,
|
||||
data: `https://nomadkaraoke.com/r/${referralCode.toLowerCase()}`,
|
||||
dotsOptions: { type: qrPrefs.dotStyle, color: qrPrefs.fgColor },
|
||||
cornersSquareOptions: { type: qrPrefs.cornerSquareStyle, color: qrPrefs.fgColor },
|
||||
cornersDotOptions: { type: qrPrefs.cornerDotStyle, color: qrPrefs.fgColor },
|
||||
backgroundOptions: { color: qrPrefs.bgColor },
|
||||
image,
|
||||
imageOptions: { hideBackgroundDots: true, imageSize: 0.2, margin: 4 },
|
||||
});
|
||||
|
||||
if (cancelled) return;
|
||||
|
||||
const blob = await qr.getRawData('png');
|
||||
if (blob && !cancelled) {
|
||||
const reader = new FileReader();
|
||||
reader.onloadend = () => {
|
||||
if (!cancelled) setQrDataUrl(reader.result as string);
|
||||
};
|
||||
reader.readAsDataURL(blob as Blob);
|
||||
}
|
||||
};
|
||||
renderQr();
|
||||
return () => { cancelled = true; };
|
||||
}, [qrPrefs, referralCode]);
|
||||
|
||||
// Cleanup debounce
|
||||
useEffect(() => {
|
||||
return () => { if (debounceRef.current) clearTimeout(debounceRef.current); };
|
||||
}, []);
|
||||
|
||||
const baseFilename = flyerFilename?.replace(/\.[^.]+$/, '') || `nomad-karaoke-flyer-${referralCode}`;
|
||||
|
||||
const handleExport = async (format: 'pdf' | 'html' | 'png') => {
|
||||
const el = flyerRef.current;
|
||||
if (!el) return;
|
||||
setExporting(format);
|
||||
try {
|
||||
if (format === 'pdf') {
|
||||
await exportFlyerPdf(el, {
|
||||
perPage: config.perPage,
|
||||
marginMm: config.marginMm,
|
||||
filename: `${baseFilename}.pdf`,
|
||||
});
|
||||
} else if (format === 'html') {
|
||||
const blob = exportFlyerHtml(el);
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = document.createElement('a');
|
||||
a.href = url;
|
||||
a.download = `${baseFilename}.html`;
|
||||
a.click();
|
||||
URL.revokeObjectURL(url);
|
||||
} else {
|
||||
await exportFlyerPng(el, `${baseFilename}.png`);
|
||||
}
|
||||
} finally {
|
||||
setExporting(null);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="space-y-4">
|
||||
<div className="flex flex-col md:flex-row gap-6">
|
||||
{/* Left: Flyer Preview */}
|
||||
<div className="flex-shrink-0 relative">
|
||||
<FlyerPreview
|
||||
config={config}
|
||||
referralCode={referralCode}
|
||||
discountPercent={discountPercent}
|
||||
qrDataUrl={qrDataUrl}
|
||||
flyerRef={flyerRef}
|
||||
/>
|
||||
{/* Edit QR Style link */}
|
||||
<button
|
||||
onClick={onSwitchToQr}
|
||||
className="absolute bottom-2 left-2 text-xs text-primary flex items-center gap-1 hover:underline bg-background/80 rounded px-1.5 py-0.5"
|
||||
>
|
||||
<Pencil className="w-3 h-3" />
|
||||
{t('flyerEditQr')}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* Right: Controls */}
|
||||
<FlyerControls config={config} onChange={updateConfig} onLoadPreset={loadPreset} />
|
||||
</div>
|
||||
|
||||
{/* Export buttons */}
|
||||
<div className="flex gap-2 pt-2 border-t border-border sm:justify-end">
|
||||
<button
|
||||
onClick={() => handleExport('pdf')}
|
||||
disabled={!!exporting || !qrDataUrl}
|
||||
className="flex-1 sm:flex-none px-4 py-2 bg-primary text-primary-foreground rounded text-sm flex items-center justify-center gap-2 disabled:opacity-50"
|
||||
>
|
||||
<Download className="w-4 h-4" />
|
||||
{exporting === 'pdf' ? t('flyerExporting') : t('flyerDownloadPdf')}
|
||||
</button>
|
||||
<button
|
||||
onClick={() => handleExport('html')}
|
||||
disabled={!!exporting || !qrDataUrl}
|
||||
className="flex-1 sm:flex-none px-4 py-2 rounded text-sm border border-border text-foreground flex items-center justify-center gap-2 hover:bg-secondary disabled:opacity-50"
|
||||
>
|
||||
<Download className="w-4 h-4" />
|
||||
{t('flyerDownloadHtml')}
|
||||
</button>
|
||||
<button
|
||||
onClick={() => handleExport('png')}
|
||||
disabled={!!exporting || !qrDataUrl}
|
||||
className="flex-1 sm:flex-none px-4 py-2 rounded text-sm border border-border text-foreground flex items-center justify-center gap-2 hover:bg-secondary disabled:opacity-50"
|
||||
>
|
||||
<Download className="w-4 h-4" />
|
||||
{t('flyerDownloadPng')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,461 +0,0 @@
|
||||
'use client';
|
||||
|
||||
import { useEffect, useRef, useState, useCallback } from 'react';
|
||||
import { useTranslations } from 'next-intl';
|
||||
import { QrCode, Download } from 'lucide-react';
|
||||
import { generateFlyer } from '@/lib/api';
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
DialogFooter,
|
||||
} from '@/components/ui/dialog';
|
||||
|
||||
const STORAGE_KEY = 'nk-qr-style-prefs';
|
||||
|
||||
type DotStyle = 'square' | 'rounded' | 'dots' | 'classy' | 'classy-rounded' | 'extra-rounded';
|
||||
type CornerSquareStyle = 'square' | 'dot' | 'extra-rounded';
|
||||
type CornerDotStyle = 'square' | 'dot';
|
||||
type LogoOption = 'none' | 'nomad' | 'emoji';
|
||||
|
||||
interface QRStylePrefs {
|
||||
dotStyle: DotStyle;
|
||||
cornerSquareStyle: CornerSquareStyle;
|
||||
cornerDotStyle: CornerDotStyle;
|
||||
fgColor: string;
|
||||
bgColor: string;
|
||||
logo: LogoOption;
|
||||
logoEmoji: string;
|
||||
}
|
||||
|
||||
const DEFAULT_PREFS: QRStylePrefs = {
|
||||
dotStyle: 'square',
|
||||
cornerSquareStyle: 'square',
|
||||
cornerDotStyle: 'square',
|
||||
fgColor: '#000000',
|
||||
bgColor: '#ffffff',
|
||||
logo: 'none',
|
||||
logoEmoji: '🎤',
|
||||
};
|
||||
|
||||
const DOT_STYLES: DotStyle[] = ['square', 'rounded', 'dots', 'classy', 'classy-rounded', 'extra-rounded'];
|
||||
const CORNER_SQUARE_STYLES: CornerSquareStyle[] = ['square', 'dot', 'extra-rounded'];
|
||||
const CORNER_DOT_STYLES: CornerDotStyle[] = ['square', 'dot'];
|
||||
|
||||
const DOT_STYLE_LABELS: Record<DotStyle, string> = {
|
||||
'square': 'qrStyleSquare',
|
||||
'rounded': 'qrStyleRounded',
|
||||
'dots': 'qrStyleDots',
|
||||
'classy': 'qrStyleClassy',
|
||||
'classy-rounded': 'qrStyleClassyRounded',
|
||||
'extra-rounded': 'qrStyleExtraRounded',
|
||||
};
|
||||
|
||||
const CORNER_SQUARE_LABELS: Record<CornerSquareStyle, string> = {
|
||||
'square': 'qrStyleSquare',
|
||||
'dot': 'qrStyleDot',
|
||||
'extra-rounded': 'qrStyleExtraRounded',
|
||||
};
|
||||
|
||||
const CORNER_DOT_LABELS: Record<CornerDotStyle, string> = {
|
||||
'square': 'qrStyleSquare',
|
||||
'dot': 'qrStyleDot',
|
||||
};
|
||||
|
||||
function loadPrefs(): QRStylePrefs {
|
||||
try {
|
||||
const saved = localStorage.getItem(STORAGE_KEY);
|
||||
if (saved) {
|
||||
return { ...DEFAULT_PREFS, ...JSON.parse(saved) };
|
||||
}
|
||||
} catch {}
|
||||
return { ...DEFAULT_PREFS };
|
||||
}
|
||||
|
||||
function savePrefs(prefs: QRStylePrefs) {
|
||||
try {
|
||||
localStorage.setItem(STORAGE_KEY, JSON.stringify(prefs));
|
||||
} catch {}
|
||||
}
|
||||
|
||||
function emojiToDataUrl(emoji: string): string {
|
||||
const canvas = document.createElement('canvas');
|
||||
canvas.width = 64;
|
||||
canvas.height = 64;
|
||||
const ctx = canvas.getContext('2d');
|
||||
if (!ctx) return '';
|
||||
ctx.font = '52px serif';
|
||||
ctx.textAlign = 'center';
|
||||
ctx.textBaseline = 'middle';
|
||||
ctx.fillText(emoji, 32, 36);
|
||||
return canvas.toDataURL('image/png');
|
||||
}
|
||||
|
||||
interface QRCodeDialogProps {
|
||||
referralUrl: string;
|
||||
open: boolean;
|
||||
onOpenChange: (open: boolean) => void;
|
||||
/** Override the flyer generator (e.g. admin endpoint). Receives theme + QR data URL, returns PDF blob. */
|
||||
onGenerateFlyer?: (theme: 'light' | 'dark', qrDataUrl: string) => Promise<Blob>;
|
||||
/** Override the download filename */
|
||||
flyerFilename?: string;
|
||||
}
|
||||
|
||||
export default function QRCodeDialog({ referralUrl, open, onOpenChange, onGenerateFlyer, flyerFilename }: QRCodeDialogProps) {
|
||||
const t = useTranslations('referrals');
|
||||
const containerRef = useRef<HTMLDivElement>(null);
|
||||
const qrRef = useRef<InstanceType<typeof import('qr-code-styling').default> | null>(null);
|
||||
const [prefs, setPrefs] = useState<QRStylePrefs>(DEFAULT_PREFS);
|
||||
const [loaded, setLoaded] = useState(false);
|
||||
const debounceRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
||||
const [flyerTheme, setFlyerTheme] = useState<'light' | 'dark'>('light');
|
||||
const [flyerLoading, setFlyerLoading] = useState(false);
|
||||
const [flyerError, setFlyerError] = useState('');
|
||||
|
||||
// Load prefs from localStorage on open
|
||||
useEffect(() => {
|
||||
if (open) {
|
||||
setPrefs(loadPrefs());
|
||||
}
|
||||
}, [open]);
|
||||
|
||||
// Build QR options from prefs
|
||||
const buildOptions = useCallback((p: QRStylePrefs) => {
|
||||
let image: string | undefined;
|
||||
if (p.logo === 'nomad') {
|
||||
image = '/nomad-karaoke-logo.svg';
|
||||
} else if (p.logo === 'emoji' && p.logoEmoji) {
|
||||
image = emojiToDataUrl(p.logoEmoji);
|
||||
}
|
||||
|
||||
return {
|
||||
width: 250,
|
||||
height: 250,
|
||||
data: referralUrl,
|
||||
dotsOptions: { type: p.dotStyle, color: p.fgColor },
|
||||
cornersSquareOptions: { type: p.cornerSquareStyle, color: p.fgColor },
|
||||
cornersDotOptions: { type: p.cornerDotStyle, color: p.fgColor },
|
||||
backgroundOptions: { color: p.bgColor },
|
||||
image,
|
||||
imageOptions: { hideBackgroundDots: true, imageSize: 0.2, margin: 4 },
|
||||
};
|
||||
}, [referralUrl]);
|
||||
|
||||
// Initialize / update QR code
|
||||
useEffect(() => {
|
||||
if (!open) return;
|
||||
|
||||
let cancelled = false;
|
||||
|
||||
const init = async () => {
|
||||
const QRCodeStyling = (await import('qr-code-styling')).default;
|
||||
|
||||
if (cancelled) return;
|
||||
|
||||
if (!qrRef.current) {
|
||||
qrRef.current = new QRCodeStyling(buildOptions(prefs));
|
||||
if (!cancelled && containerRef.current) {
|
||||
containerRef.current.innerHTML = '';
|
||||
qrRef.current.append(containerRef.current);
|
||||
}
|
||||
} else if (!cancelled) {
|
||||
qrRef.current.update(buildOptions(prefs));
|
||||
}
|
||||
|
||||
if (!cancelled) {
|
||||
setLoaded(true);
|
||||
}
|
||||
};
|
||||
|
||||
init();
|
||||
|
||||
return () => {
|
||||
cancelled = true;
|
||||
};
|
||||
}, [open, prefs, buildOptions]);
|
||||
|
||||
// Clean up on close
|
||||
useEffect(() => {
|
||||
if (!open) {
|
||||
qrRef.current = null;
|
||||
setLoaded(false);
|
||||
}
|
||||
}, [open]);
|
||||
|
||||
// Clean up debounce timer on unmount
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
if (debounceRef.current) clearTimeout(debounceRef.current);
|
||||
};
|
||||
}, []);
|
||||
|
||||
const updatePref = <K extends keyof QRStylePrefs>(key: K, value: QRStylePrefs[K]) => {
|
||||
setPrefs(prev => {
|
||||
const next = { ...prev, [key]: value };
|
||||
// Debounce localStorage save
|
||||
if (debounceRef.current) clearTimeout(debounceRef.current);
|
||||
debounceRef.current = setTimeout(() => savePrefs(next), 300);
|
||||
return next;
|
||||
});
|
||||
};
|
||||
|
||||
const handleGenerateFlyer = async () => {
|
||||
setFlyerLoading(true);
|
||||
setFlyerError('');
|
||||
try {
|
||||
let qrDataUrl: string;
|
||||
if (qrRef.current) {
|
||||
const blob = await qrRef.current.getRawData('svg');
|
||||
if (blob) {
|
||||
qrDataUrl = await new Promise<string>((resolve, reject) => {
|
||||
const reader = new FileReader();
|
||||
reader.onloadend = () => resolve(reader.result as string);
|
||||
reader.onerror = () => reject(new Error('Failed to read QR code data'));
|
||||
reader.readAsDataURL(blob);
|
||||
});
|
||||
} else {
|
||||
throw new Error('Failed to generate QR code image');
|
||||
}
|
||||
} else {
|
||||
throw new Error('QR code not initialized');
|
||||
}
|
||||
|
||||
const flyerFn = onGenerateFlyer || generateFlyer;
|
||||
const pdfBlob = await flyerFn(flyerTheme, qrDataUrl);
|
||||
const url = URL.createObjectURL(pdfBlob);
|
||||
const a = document.createElement('a');
|
||||
a.href = url;
|
||||
a.download = flyerFilename || 'nomad-karaoke-referral-flyer.pdf';
|
||||
a.click();
|
||||
URL.revokeObjectURL(url);
|
||||
} catch (err) {
|
||||
const message = err instanceof Error ? err.message : 'Failed to generate flyer';
|
||||
setFlyerError(message);
|
||||
console.error('Failed to generate flyer:', err);
|
||||
} finally {
|
||||
setFlyerLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
const handleDownload = async (extension: 'png' | 'svg') => {
|
||||
// Initialize QR instance if not yet ready (e.g., download clicked before init effect completes)
|
||||
if (!qrRef.current) {
|
||||
const QRCodeStyling = (await import('qr-code-styling')).default;
|
||||
qrRef.current = new QRCodeStyling(buildOptions(prefs));
|
||||
}
|
||||
await qrRef.current.download({ name: 'referral-qr', extension });
|
||||
};
|
||||
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={onOpenChange}>
|
||||
<DialogContent className="sm:max-w-2xl bg-card border-border max-h-[90vh] overflow-y-auto">
|
||||
<DialogHeader>
|
||||
<DialogTitle className="text-foreground flex items-center gap-2">
|
||||
<QrCode className="w-5 h-5" />
|
||||
{t('qrTitle')}
|
||||
</DialogTitle>
|
||||
</DialogHeader>
|
||||
|
||||
<div className="flex flex-col md:flex-row gap-6">
|
||||
{/* Left: QR Preview */}
|
||||
<div className="flex-shrink-0 flex items-center justify-center">
|
||||
<div
|
||||
className="relative w-[250px] h-[250px] rounded-lg border border-border"
|
||||
style={{ backgroundColor: prefs.bgColor }}
|
||||
>
|
||||
{/* QR code is appended into this container by qr-code-styling */}
|
||||
<div ref={containerRef} className="w-full h-full" />
|
||||
{/* Loading skeleton rendered as a sibling so innerHTML clear doesn't affect React tree */}
|
||||
{!loaded && (
|
||||
<div className="absolute inset-0 flex items-center justify-center">
|
||||
<div className="animate-pulse w-[200px] h-[200px] bg-muted rounded" />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Right: Controls */}
|
||||
<div className="flex-1 space-y-4 min-w-0">
|
||||
{/* Dot Style */}
|
||||
<div>
|
||||
<label className="text-sm font-medium text-foreground">{t('qrDotStyle')}</label>
|
||||
<div className="grid grid-cols-3 gap-1.5 mt-1">
|
||||
{DOT_STYLES.map(style => (
|
||||
<button
|
||||
key={style}
|
||||
onClick={() => updatePref('dotStyle', style)}
|
||||
className={`px-2 py-1.5 text-xs rounded border transition-colors ${
|
||||
prefs.dotStyle === style
|
||||
? 'border-primary bg-primary/10 text-primary font-medium'
|
||||
: 'border-border text-muted-foreground hover:border-primary/50'
|
||||
}`}
|
||||
>
|
||||
{t(DOT_STYLE_LABELS[style])}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Corner Frame */}
|
||||
<div>
|
||||
<label className="text-sm font-medium text-foreground">{t('qrCornerFrame')}</label>
|
||||
<div className="grid grid-cols-3 gap-1.5 mt-1">
|
||||
{CORNER_SQUARE_STYLES.map(style => (
|
||||
<button
|
||||
key={style}
|
||||
onClick={() => updatePref('cornerSquareStyle', style)}
|
||||
className={`px-2 py-1.5 text-xs rounded border transition-colors ${
|
||||
prefs.cornerSquareStyle === style
|
||||
? 'border-primary bg-primary/10 text-primary font-medium'
|
||||
: 'border-border text-muted-foreground hover:border-primary/50'
|
||||
}`}
|
||||
>
|
||||
{t(CORNER_SQUARE_LABELS[style])}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Corner Dot */}
|
||||
<div>
|
||||
<label className="text-sm font-medium text-foreground">{t('qrCornerDot')}</label>
|
||||
<div className="grid grid-cols-3 gap-1.5 mt-1">
|
||||
{CORNER_DOT_STYLES.map(style => (
|
||||
<button
|
||||
key={style}
|
||||
onClick={() => updatePref('cornerDotStyle', style)}
|
||||
className={`px-2 py-1.5 text-xs rounded border transition-colors ${
|
||||
prefs.cornerDotStyle === style
|
||||
? 'border-primary bg-primary/10 text-primary font-medium'
|
||||
: 'border-border text-muted-foreground hover:border-primary/50'
|
||||
}`}
|
||||
>
|
||||
{t(CORNER_DOT_LABELS[style])}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Colors */}
|
||||
<div>
|
||||
<label className="text-sm font-medium text-foreground">{t('qrColors')}</label>
|
||||
<div className="flex gap-4 mt-1">
|
||||
<div className="flex items-center gap-2">
|
||||
<input
|
||||
type="color"
|
||||
value={prefs.fgColor}
|
||||
onChange={(e) => updatePref('fgColor', e.target.value)}
|
||||
className="w-8 h-8 rounded border border-border cursor-pointer"
|
||||
/>
|
||||
<span className="text-xs text-muted-foreground">{t('qrForeground')}</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<input
|
||||
type="color"
|
||||
value={prefs.bgColor}
|
||||
onChange={(e) => updatePref('bgColor', e.target.value)}
|
||||
className="w-8 h-8 rounded border border-border cursor-pointer"
|
||||
/>
|
||||
<span className="text-xs text-muted-foreground">{t('qrBackground')}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Center Logo */}
|
||||
<div>
|
||||
<label className="text-sm font-medium text-foreground">{t('qrLogo')}</label>
|
||||
<div className="flex gap-1.5 mt-1">
|
||||
{(['none', 'nomad', 'emoji'] as LogoOption[]).map(option => {
|
||||
const labelKeys: Record<LogoOption, string> = {
|
||||
none: 'qrLogoNone',
|
||||
nomad: 'qrLogoNomad',
|
||||
emoji: 'qrLogoEmoji',
|
||||
};
|
||||
return (
|
||||
<button
|
||||
key={option}
|
||||
onClick={() => updatePref('logo', option)}
|
||||
className={`px-2 py-1.5 text-xs rounded border transition-colors ${
|
||||
prefs.logo === option
|
||||
? 'border-primary bg-primary/10 text-primary font-medium'
|
||||
: 'border-border text-muted-foreground hover:border-primary/50'
|
||||
}`}
|
||||
>
|
||||
{t(labelKeys[option])}
|
||||
</button>
|
||||
);
|
||||
})}
|
||||
{prefs.logo === 'emoji' && (
|
||||
<input
|
||||
type="text"
|
||||
value={prefs.logoEmoji}
|
||||
onChange={(e) => {
|
||||
// Take only the last entered character/emoji
|
||||
const val = e.target.value;
|
||||
const emoji = [...val].pop() || '';
|
||||
updatePref('logoEmoji', emoji);
|
||||
}}
|
||||
className="w-10 h-7 text-center text-base rounded border border-border"
|
||||
maxLength={4}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<DialogFooter>
|
||||
<div className="w-full space-y-3">
|
||||
{/* Flyer generation */}
|
||||
<div className="flex items-center gap-3 pt-2 border-t border-border">
|
||||
<span className="text-sm font-medium text-foreground">{t('flyerTheme')}</span>
|
||||
<div className="flex gap-1.5">
|
||||
{(['light', 'dark'] as const).map(theme => (
|
||||
<button
|
||||
key={theme}
|
||||
onClick={() => setFlyerTheme(theme)}
|
||||
className={`px-2 py-1 text-xs rounded border transition-colors ${
|
||||
flyerTheme === theme
|
||||
? 'border-primary bg-primary/10 text-primary font-medium'
|
||||
: 'border-border text-muted-foreground hover:border-primary/50'
|
||||
}`}
|
||||
>
|
||||
{t(theme === 'light' ? 'flyerThemeLight' : 'flyerThemeDark')}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
<button
|
||||
onClick={handleGenerateFlyer}
|
||||
disabled={flyerLoading}
|
||||
className="ml-auto px-4 py-2 bg-primary text-primary-foreground rounded text-sm flex items-center gap-2 disabled:opacity-50"
|
||||
>
|
||||
{flyerLoading ? t('flyerGenerating') : t('flyerGenerate')}
|
||||
</button>
|
||||
</div>
|
||||
{flyerError && (
|
||||
<p className="text-xs text-destructive">{flyerError}</p>
|
||||
)}
|
||||
{/* QR download buttons */}
|
||||
<div className="flex gap-2 sm:justify-end">
|
||||
<button
|
||||
onClick={() => handleDownload('png')}
|
||||
className="flex-1 sm:flex-none px-4 py-2 bg-primary text-primary-foreground rounded text-sm flex items-center justify-center gap-2"
|
||||
>
|
||||
<Download className="w-4 h-4" />
|
||||
{t('qrDownloadPng')}
|
||||
</button>
|
||||
<button
|
||||
onClick={() => handleDownload('svg')}
|
||||
className="flex-1 sm:flex-none px-4 py-2 rounded text-sm border border-border text-foreground flex items-center justify-center gap-2 hover:bg-secondary"
|
||||
>
|
||||
<Download className="w-4 h-4" />
|
||||
{t('qrDownloadSvg')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,332 @@
|
||||
'use client';
|
||||
|
||||
import { useEffect, useRef, useState, useCallback } from 'react';
|
||||
import { useTranslations } from 'next-intl';
|
||||
import { Download } from 'lucide-react';
|
||||
|
||||
export type DotStyle = 'square' | 'rounded' | 'dots' | 'classy' | 'classy-rounded' | 'extra-rounded';
|
||||
export type CornerSquareStyle = 'square' | 'dot' | 'extra-rounded';
|
||||
export type CornerDotStyle = 'square' | 'dot';
|
||||
export type LogoOption = 'none' | 'nomad' | 'emoji';
|
||||
|
||||
export interface QRStylePrefs {
|
||||
dotStyle: DotStyle;
|
||||
cornerSquareStyle: CornerSquareStyle;
|
||||
cornerDotStyle: CornerDotStyle;
|
||||
fgColor: string;
|
||||
bgColor: string;
|
||||
logo: LogoOption;
|
||||
logoEmoji: string;
|
||||
}
|
||||
|
||||
export const DEFAULT_QR_PREFS: QRStylePrefs = {
|
||||
dotStyle: 'square',
|
||||
cornerSquareStyle: 'square',
|
||||
cornerDotStyle: 'square',
|
||||
fgColor: '#000000',
|
||||
bgColor: '#ffffff',
|
||||
logo: 'none',
|
||||
logoEmoji: '🎤',
|
||||
};
|
||||
|
||||
const QR_STORAGE_KEY = 'nk-qr-style-prefs';
|
||||
|
||||
const DOT_STYLES: DotStyle[] = ['square', 'rounded', 'dots', 'classy', 'classy-rounded', 'extra-rounded'];
|
||||
const CORNER_SQUARE_STYLES: CornerSquareStyle[] = ['square', 'dot', 'extra-rounded'];
|
||||
const CORNER_DOT_STYLES: CornerDotStyle[] = ['square', 'dot'];
|
||||
|
||||
const DOT_STYLE_LABELS: Record<DotStyle, string> = {
|
||||
'square': 'qrStyleSquare',
|
||||
'rounded': 'qrStyleRounded',
|
||||
'dots': 'qrStyleDots',
|
||||
'classy': 'qrStyleClassy',
|
||||
'classy-rounded': 'qrStyleClassyRounded',
|
||||
'extra-rounded': 'qrStyleExtraRounded',
|
||||
};
|
||||
|
||||
const CORNER_SQUARE_LABELS: Record<CornerSquareStyle, string> = {
|
||||
'square': 'qrStyleSquare',
|
||||
'dot': 'qrStyleDot',
|
||||
'extra-rounded': 'qrStyleExtraRounded',
|
||||
};
|
||||
|
||||
const CORNER_DOT_LABELS: Record<CornerDotStyle, string> = {
|
||||
'square': 'qrStyleSquare',
|
||||
'dot': 'qrStyleDot',
|
||||
};
|
||||
|
||||
export function loadQrPrefs(): QRStylePrefs {
|
||||
try {
|
||||
const saved = localStorage.getItem(QR_STORAGE_KEY);
|
||||
if (saved) {
|
||||
return { ...DEFAULT_QR_PREFS, ...JSON.parse(saved) };
|
||||
}
|
||||
} catch {}
|
||||
return { ...DEFAULT_QR_PREFS };
|
||||
}
|
||||
|
||||
export function saveQrPrefs(prefs: QRStylePrefs): void {
|
||||
try {
|
||||
localStorage.setItem(QR_STORAGE_KEY, JSON.stringify(prefs));
|
||||
} catch {}
|
||||
}
|
||||
|
||||
function emojiToDataUrl(emoji: string): string {
|
||||
const canvas = document.createElement('canvas');
|
||||
canvas.width = 64;
|
||||
canvas.height = 64;
|
||||
const ctx = canvas.getContext('2d');
|
||||
if (!ctx) return '';
|
||||
ctx.font = '52px serif';
|
||||
ctx.textAlign = 'center';
|
||||
ctx.textBaseline = 'middle';
|
||||
ctx.fillText(emoji, 32, 36);
|
||||
return canvas.toDataURL('image/png');
|
||||
}
|
||||
|
||||
interface QRCodeTabProps {
|
||||
referralUrl: string;
|
||||
prefs: QRStylePrefs;
|
||||
onPrefsChange: (prefs: QRStylePrefs) => void;
|
||||
visible: boolean;
|
||||
}
|
||||
|
||||
export default function QRCodeTab({ referralUrl, prefs, onPrefsChange, visible }: QRCodeTabProps) {
|
||||
const t = useTranslations('referrals');
|
||||
const containerRef = useRef<HTMLDivElement>(null);
|
||||
const qrRef = useRef<InstanceType<typeof import('qr-code-styling').default> | null>(null);
|
||||
const [loaded, setLoaded] = useState(false);
|
||||
const debounceRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
||||
|
||||
const buildOptions = useCallback((p: QRStylePrefs) => {
|
||||
let image: string | undefined;
|
||||
if (p.logo === 'nomad') {
|
||||
image = '/nomad-karaoke-logo.svg';
|
||||
} else if (p.logo === 'emoji' && p.logoEmoji) {
|
||||
image = emojiToDataUrl(p.logoEmoji);
|
||||
}
|
||||
return {
|
||||
width: 250,
|
||||
height: 250,
|
||||
data: referralUrl,
|
||||
dotsOptions: { type: p.dotStyle, color: p.fgColor },
|
||||
cornersSquareOptions: { type: p.cornerSquareStyle, color: p.fgColor },
|
||||
cornersDotOptions: { type: p.cornerDotStyle, color: p.fgColor },
|
||||
backgroundOptions: { color: p.bgColor },
|
||||
image,
|
||||
imageOptions: { hideBackgroundDots: true, imageSize: 0.2, margin: 4 },
|
||||
};
|
||||
}, [referralUrl]);
|
||||
|
||||
// Initialize / update QR code
|
||||
useEffect(() => {
|
||||
if (!visible) return;
|
||||
let cancelled = false;
|
||||
const init = async () => {
|
||||
const QRCodeStyling = (await import('qr-code-styling')).default;
|
||||
if (cancelled) return;
|
||||
if (!qrRef.current) {
|
||||
qrRef.current = new QRCodeStyling(buildOptions(prefs));
|
||||
if (!cancelled && containerRef.current) {
|
||||
containerRef.current.innerHTML = '';
|
||||
qrRef.current.append(containerRef.current);
|
||||
}
|
||||
} else if (!cancelled) {
|
||||
qrRef.current.update(buildOptions(prefs));
|
||||
}
|
||||
if (!cancelled) setLoaded(true);
|
||||
};
|
||||
init();
|
||||
return () => { cancelled = true; };
|
||||
}, [visible, prefs, buildOptions]);
|
||||
|
||||
// Clean up on hide
|
||||
useEffect(() => {
|
||||
if (!visible) {
|
||||
qrRef.current = null;
|
||||
setLoaded(false);
|
||||
}
|
||||
}, [visible]);
|
||||
|
||||
useEffect(() => {
|
||||
return () => { if (debounceRef.current) clearTimeout(debounceRef.current); };
|
||||
}, []);
|
||||
|
||||
const updatePref = <K extends keyof QRStylePrefs>(key: K, value: QRStylePrefs[K]) => {
|
||||
const next = { ...prefs, [key]: value };
|
||||
onPrefsChange(next);
|
||||
if (debounceRef.current) clearTimeout(debounceRef.current);
|
||||
debounceRef.current = setTimeout(() => saveQrPrefs(next), 300);
|
||||
};
|
||||
|
||||
const handleDownload = async (extension: 'png' | 'svg') => {
|
||||
if (!qrRef.current) {
|
||||
const QRCodeStyling = (await import('qr-code-styling')).default;
|
||||
qrRef.current = new QRCodeStyling(buildOptions(prefs));
|
||||
}
|
||||
await qrRef.current.download({ name: 'referral-qr', extension });
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="space-y-4">
|
||||
<div className="flex flex-col md:flex-row gap-6">
|
||||
{/* Left: QR Preview */}
|
||||
<div className="flex-shrink-0 flex items-center justify-center">
|
||||
<div
|
||||
className="relative w-[250px] h-[250px] rounded-lg border border-border"
|
||||
style={{ backgroundColor: prefs.bgColor }}
|
||||
>
|
||||
<div ref={containerRef} className="w-full h-full" />
|
||||
{!loaded && (
|
||||
<div className="absolute inset-0 flex items-center justify-center">
|
||||
<div className="animate-pulse w-[200px] h-[200px] bg-muted rounded" />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Right: Controls */}
|
||||
<div className="flex-1 space-y-4 min-w-0">
|
||||
{/* Dot Style */}
|
||||
<div>
|
||||
<label className="text-sm font-medium text-foreground">{t('qrDotStyle')}</label>
|
||||
<div className="grid grid-cols-3 gap-1.5 mt-1">
|
||||
{DOT_STYLES.map(style => (
|
||||
<button
|
||||
key={style}
|
||||
onClick={() => updatePref('dotStyle', style)}
|
||||
className={`px-2 py-1.5 text-xs rounded border transition-colors ${
|
||||
prefs.dotStyle === style
|
||||
? 'border-primary bg-primary/10 text-primary font-medium'
|
||||
: 'border-border text-muted-foreground hover:border-primary/50'
|
||||
}`}
|
||||
>
|
||||
{t(DOT_STYLE_LABELS[style])}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Corner Frame */}
|
||||
<div>
|
||||
<label className="text-sm font-medium text-foreground">{t('qrCornerFrame')}</label>
|
||||
<div className="grid grid-cols-3 gap-1.5 mt-1">
|
||||
{CORNER_SQUARE_STYLES.map(style => (
|
||||
<button
|
||||
key={style}
|
||||
onClick={() => updatePref('cornerSquareStyle', style)}
|
||||
className={`px-2 py-1.5 text-xs rounded border transition-colors ${
|
||||
prefs.cornerSquareStyle === style
|
||||
? 'border-primary bg-primary/10 text-primary font-medium'
|
||||
: 'border-border text-muted-foreground hover:border-primary/50'
|
||||
}`}
|
||||
>
|
||||
{t(CORNER_SQUARE_LABELS[style])}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Corner Dot */}
|
||||
<div>
|
||||
<label className="text-sm font-medium text-foreground">{t('qrCornerDot')}</label>
|
||||
<div className="grid grid-cols-3 gap-1.5 mt-1">
|
||||
{CORNER_DOT_STYLES.map(style => (
|
||||
<button
|
||||
key={style}
|
||||
onClick={() => updatePref('cornerDotStyle', style)}
|
||||
className={`px-2 py-1.5 text-xs rounded border transition-colors ${
|
||||
prefs.cornerDotStyle === style
|
||||
? 'border-primary bg-primary/10 text-primary font-medium'
|
||||
: 'border-border text-muted-foreground hover:border-primary/50'
|
||||
}`}
|
||||
>
|
||||
{t(CORNER_DOT_LABELS[style])}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Colors */}
|
||||
<div>
|
||||
<label className="text-sm font-medium text-foreground">{t('qrColors')}</label>
|
||||
<div className="flex gap-4 mt-1">
|
||||
<div className="flex items-center gap-2">
|
||||
<input
|
||||
type="color"
|
||||
value={prefs.fgColor}
|
||||
onChange={(e) => updatePref('fgColor', e.target.value)}
|
||||
className="w-8 h-8 rounded border border-border cursor-pointer"
|
||||
/>
|
||||
<span className="text-xs text-muted-foreground">{t('qrForeground')}</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<input
|
||||
type="color"
|
||||
value={prefs.bgColor}
|
||||
onChange={(e) => updatePref('bgColor', e.target.value)}
|
||||
className="w-8 h-8 rounded border border-border cursor-pointer"
|
||||
/>
|
||||
<span className="text-xs text-muted-foreground">{t('qrBackground')}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Center Logo */}
|
||||
<div>
|
||||
<label className="text-sm font-medium text-foreground">{t('qrLogo')}</label>
|
||||
<div className="flex gap-1.5 mt-1">
|
||||
{(['none', 'nomad', 'emoji'] as const).map(option => {
|
||||
const labelKeys = { none: 'qrLogoNone', nomad: 'qrLogoNomad', emoji: 'qrLogoEmoji' } as const;
|
||||
return (
|
||||
<button
|
||||
key={option}
|
||||
onClick={() => updatePref('logo', option)}
|
||||
className={`px-2 py-1.5 text-xs rounded border transition-colors ${
|
||||
prefs.logo === option
|
||||
? 'border-primary bg-primary/10 text-primary font-medium'
|
||||
: 'border-border text-muted-foreground hover:border-primary/50'
|
||||
}`}
|
||||
>
|
||||
{t(labelKeys[option])}
|
||||
</button>
|
||||
);
|
||||
})}
|
||||
{prefs.logo === 'emoji' && (
|
||||
<input
|
||||
type="text"
|
||||
value={prefs.logoEmoji}
|
||||
onChange={(e) => {
|
||||
const val = e.target.value;
|
||||
const emoji = [...val].pop() || '';
|
||||
updatePref('logoEmoji', emoji);
|
||||
}}
|
||||
className="w-10 h-7 text-center text-base rounded border border-border"
|
||||
maxLength={4}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* QR download buttons */}
|
||||
<div className="flex gap-2 pt-2 border-t border-border sm:justify-end">
|
||||
<button
|
||||
onClick={() => handleDownload('png')}
|
||||
className="flex-1 sm:flex-none px-4 py-2 bg-primary text-primary-foreground rounded text-sm flex items-center justify-center gap-2"
|
||||
>
|
||||
<Download className="w-4 h-4" />
|
||||
{t('qrDownloadPng')}
|
||||
</button>
|
||||
<button
|
||||
onClick={() => handleDownload('svg')}
|
||||
className="flex-1 sm:flex-none px-4 py-2 rounded text-sm border border-border text-foreground flex items-center justify-center gap-2 hover:bg-secondary"
|
||||
>
|
||||
<Download className="w-4 h-4" />
|
||||
{t('qrDownloadSvg')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,16 +1,22 @@
|
||||
'use client';
|
||||
|
||||
import { useEffect, useState, useCallback } from 'react';
|
||||
import { useSearchParams } from 'next/navigation';
|
||||
import { useTranslations } from 'next-intl';
|
||||
import {
|
||||
getReferralDashboard,
|
||||
updateReferralLink,
|
||||
startConnectOnboarding,
|
||||
getConnectDashboardLink,
|
||||
getConnectUpdateLink,
|
||||
requestVanityUrl,
|
||||
} from '@/lib/api';
|
||||
import type { ReferralDashboard as ReferralDashboardData } from '@/lib/types';
|
||||
import { QrCode, Gift, DollarSign, Users, Clock, Share2, Sparkles, ExternalLink } from 'lucide-react';
|
||||
import QRCodeDialog from './QRCodeDialog';
|
||||
import {
|
||||
QrCode, Sparkles, ExternalLink, CheckCircle, AlertCircle,
|
||||
Loader2, Banknote, Settings,
|
||||
} from 'lucide-react';
|
||||
import ReferralToolsDialog from './ReferralToolsDialog';
|
||||
|
||||
function formatCents(cents: number): string {
|
||||
return `$${(cents / 100).toFixed(2)}`;
|
||||
@@ -18,6 +24,7 @@ function formatCents(cents: number): string {
|
||||
|
||||
export default function ReferralDashboard() {
|
||||
const t = useTranslations('referrals');
|
||||
const searchParams = useSearchParams();
|
||||
const [data, setData] = useState<ReferralDashboardData | null>(null);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [copied, setCopied] = useState(false);
|
||||
@@ -30,6 +37,11 @@ export default function ReferralDashboard() {
|
||||
const [vanitySubmitting, setVanitySubmitting] = useState(false);
|
||||
const [desiredVanity, setDesiredVanity] = useState('');
|
||||
const [showVanityForm, setShowVanityForm] = useState(false);
|
||||
const [connectStatus, setConnectStatus] = useState<'complete' | 'refresh' | null>(null);
|
||||
const [connectLoading, setConnectLoading] = useState(false);
|
||||
const [connectError, setConnectError] = useState('');
|
||||
const [dashboardLinkLoading, setDashboardLinkLoading] = useState(false);
|
||||
const [actionError, setActionError] = useState('');
|
||||
|
||||
const fetchDashboard = useCallback(async () => {
|
||||
try {
|
||||
@@ -48,6 +60,18 @@ export default function ReferralDashboard() {
|
||||
fetchDashboard();
|
||||
}, [fetchDashboard]);
|
||||
|
||||
// Handle Stripe Connect redirect params
|
||||
useEffect(() => {
|
||||
const connect = searchParams.get('connect');
|
||||
if (connect === 'complete') {
|
||||
setConnectStatus('complete');
|
||||
window.history.replaceState({}, '', window.location.pathname);
|
||||
} else if (connect === 'refresh') {
|
||||
setConnectStatus('refresh');
|
||||
window.history.replaceState({}, '', window.location.pathname);
|
||||
}
|
||||
}, [searchParams]);
|
||||
|
||||
const copyLink = () => {
|
||||
if (!data) return;
|
||||
const url = `https://nomadkaraoke.com/r/${data.link.code}`;
|
||||
@@ -67,11 +91,42 @@ export default function ReferralDashboard() {
|
||||
};
|
||||
|
||||
const handleConnectBank = async () => {
|
||||
setConnectLoading(true);
|
||||
setConnectError('');
|
||||
try {
|
||||
const { onboarding_url } = await startConnectOnboarding();
|
||||
window.location.href = onboarding_url;
|
||||
} catch (err) {
|
||||
console.error('Failed to start Connect onboarding:', err);
|
||||
setConnectError(t('connectFailed'));
|
||||
setConnectLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
const handleManagePayouts = async () => {
|
||||
setDashboardLinkLoading(true);
|
||||
setActionError('');
|
||||
try {
|
||||
const { url } = await getConnectDashboardLink();
|
||||
window.open(url, '_blank');
|
||||
} catch (err) {
|
||||
console.error('Failed to get dashboard link:', err);
|
||||
setActionError(t('connectFailed'));
|
||||
} finally {
|
||||
setDashboardLinkLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
const handleUpdateAccount = async () => {
|
||||
setConnectLoading(true);
|
||||
setActionError('');
|
||||
try {
|
||||
const { url } = await getConnectUpdateLink();
|
||||
window.location.href = url;
|
||||
} catch (err) {
|
||||
console.error('Failed to get update link:', err);
|
||||
setActionError(t('connectFailed'));
|
||||
setConnectLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -100,6 +155,8 @@ export default function ReferralDashboard() {
|
||||
|
||||
if (!data) return null;
|
||||
|
||||
const connectAccount = data.stripe_connect_account;
|
||||
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
<h2 className="text-xl font-bold">{t('title')}</h2>
|
||||
@@ -300,25 +357,122 @@ export default function ReferralDashboard() {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Payout section */}
|
||||
<div className="rounded-lg p-4 space-y-3" style={{ backgroundColor: 'var(--card)', border: '1px solid var(--card-border)' }}>
|
||||
{/* Payout & Bank Account section */}
|
||||
<div className="rounded-lg p-4 space-y-4" style={{ backgroundColor: 'var(--card)', border: '1px solid var(--card-border)' }}>
|
||||
<div className="flex justify-between items-center">
|
||||
<h3 className="font-semibold">{t('earnings')}</h3>
|
||||
<h3 className="font-semibold flex items-center gap-2">
|
||||
<Banknote className="w-5 h-5" style={{ color: 'var(--text-muted)' }} />
|
||||
{t('payoutTitle')}
|
||||
</h3>
|
||||
<div className="text-right">
|
||||
<p className="text-lg font-bold">{formatCents(data.pending_balance_cents)}</p>
|
||||
<p className="text-xs" style={{ color: 'var(--text-muted)' }}>{t('pendingBalance')}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{!data.stripe_connect_configured ? (
|
||||
<div className="rounded-lg p-4 space-y-2" style={{ backgroundColor: 'var(--secondary)' }}>
|
||||
<p className="text-sm">{t('connectDescription')}</p>
|
||||
<button onClick={handleConnectBank} className="px-4 py-2 bg-primary text-primary-foreground rounded text-sm">
|
||||
{t('connectBank')}
|
||||
</button>
|
||||
{/* Connect complete banner */}
|
||||
{connectStatus === 'complete' && (
|
||||
<div className="rounded-lg p-3 flex items-center gap-2 border border-green-500/30" style={{ backgroundColor: 'rgba(34, 197, 94, 0.1)' }}>
|
||||
<CheckCircle className="w-5 h-5 text-green-500 shrink-0" />
|
||||
<p className="text-sm text-green-500">{t('connectComplete')}</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Connect refresh banner */}
|
||||
{connectStatus === 'refresh' && !data.stripe_connect_configured && (
|
||||
<div className="rounded-lg p-3 flex items-center gap-2 border" style={{ borderColor: 'var(--card-border)', backgroundColor: 'var(--secondary)' }}>
|
||||
<AlertCircle className="w-4 h-4 shrink-0" style={{ color: 'var(--text-muted)' }} />
|
||||
<p className="text-sm" style={{ color: 'var(--text-muted)' }}>{t('connectRefresh')}</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{data.stripe_connect_configured ? (
|
||||
/* Connected state — show account status and management */
|
||||
<div className="space-y-3">
|
||||
{/* Account status */}
|
||||
<div className="rounded-lg p-3 space-y-2" style={{ backgroundColor: 'var(--secondary)' }}>
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="flex items-center gap-2">
|
||||
<div className={`w-2 h-2 rounded-full ${connectAccount?.payouts_enabled ? 'bg-green-500' : 'bg-yellow-500'}`} />
|
||||
<span className="text-sm font-medium">
|
||||
{connectAccount?.payouts_enabled ? t('connectStatusActive') : t('connectStatusPending')}
|
||||
</span>
|
||||
</div>
|
||||
{connectAccount?.email && (
|
||||
<span className="text-xs font-mono" style={{ color: 'var(--text-muted)' }}>
|
||||
{connectAccount.email}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{connectAccount && !connectAccount.details_submitted && (
|
||||
<p className="text-xs" style={{ color: 'var(--text-muted)' }}>
|
||||
{t('connectDetailsNeeded')}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Payout info */}
|
||||
<p className="text-sm" style={{ color: 'var(--text-muted)' }}>{t('payoutThreshold')}</p>
|
||||
|
||||
{/* Management buttons */}
|
||||
<div className="flex flex-wrap gap-2">
|
||||
{connectAccount?.details_submitted && (
|
||||
<button
|
||||
onClick={handleManagePayouts}
|
||||
disabled={dashboardLinkLoading}
|
||||
className="px-3 py-1.5 rounded text-sm border flex items-center gap-1.5 hover:bg-white/5 transition-colors disabled:opacity-50"
|
||||
style={{ borderColor: 'var(--card-border)', color: 'var(--text)' }}
|
||||
>
|
||||
{dashboardLinkLoading ? (
|
||||
<Loader2 className="w-3.5 h-3.5 animate-spin" />
|
||||
) : (
|
||||
<ExternalLink className="w-3.5 h-3.5" />
|
||||
)}
|
||||
{t('managePayouts')}
|
||||
</button>
|
||||
)}
|
||||
<button
|
||||
onClick={handleUpdateAccount}
|
||||
disabled={connectLoading}
|
||||
className="px-3 py-1.5 rounded text-sm border flex items-center gap-1.5 hover:bg-white/5 transition-colors disabled:opacity-50"
|
||||
style={{ borderColor: 'var(--card-border)', color: 'var(--text-muted)' }}
|
||||
>
|
||||
{connectLoading ? (
|
||||
<Loader2 className="w-3.5 h-3.5 animate-spin" />
|
||||
) : (
|
||||
<Settings className="w-3.5 h-3.5" />
|
||||
)}
|
||||
{t('updateBankAccount')}
|
||||
</button>
|
||||
</div>
|
||||
{actionError && (
|
||||
<p className="text-sm text-red-500">{actionError}</p>
|
||||
)}
|
||||
</div>
|
||||
) : (
|
||||
<p className="text-sm" style={{ color: 'var(--text-muted)' }}>{t('payoutThreshold')}</p>
|
||||
/* Not connected — show setup prompt */
|
||||
<div className="rounded-lg p-4 space-y-3" style={{ backgroundColor: 'var(--secondary)' }}>
|
||||
<p className="text-sm">{t('connectDescription')}</p>
|
||||
<p className="text-xs" style={{ color: 'var(--text-muted)' }}>{t('connectStripeNote')}</p>
|
||||
<button
|
||||
onClick={handleConnectBank}
|
||||
disabled={connectLoading}
|
||||
className="px-4 py-2 bg-primary text-primary-foreground rounded text-sm flex items-center gap-2 disabled:opacity-70"
|
||||
>
|
||||
{connectLoading ? (
|
||||
<>
|
||||
<Loader2 className="w-4 h-4 animate-spin" />
|
||||
{t('connectBankLoading')}
|
||||
</>
|
||||
) : (
|
||||
t('connectBank')
|
||||
)}
|
||||
</button>
|
||||
{connectError && (
|
||||
<p className="text-sm text-red-500">{connectError}</p>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -359,10 +513,12 @@ export default function ReferralDashboard() {
|
||||
</div>
|
||||
)}
|
||||
|
||||
<QRCodeDialog
|
||||
<ReferralToolsDialog
|
||||
referralUrl={`https://nomadkaraoke.com/r/${data.link.code}`}
|
||||
open={qrOpen}
|
||||
onOpenChange={setQrOpen}
|
||||
referralCode={data.link.code}
|
||||
discountPercent={data.link.discount_percent}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
'use client';
|
||||
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useTranslations } from 'next-intl';
|
||||
import { QrCode, FileText } from 'lucide-react';
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from '@/components/ui/dialog';
|
||||
import { Tabs, TabsList, TabsTrigger, TabsContent } from '@/components/ui/tabs';
|
||||
import QRCodeTab, { type QRStylePrefs, DEFAULT_QR_PREFS, loadQrPrefs } from './QRCodeTab';
|
||||
import FlyerTab from './FlyerTab';
|
||||
|
||||
interface ReferralToolsDialogProps {
|
||||
referralUrl: string;
|
||||
open: boolean;
|
||||
onOpenChange: (open: boolean) => void;
|
||||
/** @deprecated — flyer generation is now client-side. Kept for backwards compat. */
|
||||
onGenerateFlyer?: (theme: 'light' | 'dark', qrDataUrl: string) => Promise<Blob>;
|
||||
flyerFilename?: string;
|
||||
/** Referral code (for flyer CTA display). Extracted from referralUrl if not provided. */
|
||||
referralCode?: string;
|
||||
/** Discount percentage (for flyer CTA). Defaults to 20. */
|
||||
discountPercent?: number;
|
||||
}
|
||||
|
||||
export default function ReferralToolsDialog({
|
||||
referralUrl,
|
||||
open,
|
||||
onOpenChange,
|
||||
flyerFilename,
|
||||
referralCode: referralCodeProp,
|
||||
discountPercent = 20,
|
||||
}: ReferralToolsDialogProps) {
|
||||
const t = useTranslations('referrals');
|
||||
const [activeTab, setActiveTab] = useState('qr');
|
||||
const [qrPrefs, setQrPrefs] = useState<QRStylePrefs>(DEFAULT_QR_PREFS);
|
||||
|
||||
// Extract referral code from URL if not provided, stripping query/hash/path
|
||||
const referralCode = referralCodeProp
|
||||
|| referralUrl.split('/r/').pop()?.split(/[?#/]/)[0]
|
||||
|| 'CODE';
|
||||
|
||||
// Load QR prefs on open
|
||||
useEffect(() => {
|
||||
if (open) {
|
||||
setQrPrefs(loadQrPrefs());
|
||||
}
|
||||
}, [open]);
|
||||
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={onOpenChange}>
|
||||
<DialogContent className="sm:max-w-4xl bg-card border-border max-h-[90vh] overflow-y-auto">
|
||||
<DialogHeader>
|
||||
<DialogTitle className="text-foreground flex items-center gap-2">
|
||||
<QrCode className="w-5 h-5" />
|
||||
{t('toolsTitle')}
|
||||
</DialogTitle>
|
||||
</DialogHeader>
|
||||
|
||||
<Tabs value={activeTab} onValueChange={setActiveTab}>
|
||||
<TabsList>
|
||||
<TabsTrigger value="qr" className="flex items-center gap-1.5">
|
||||
<QrCode className="w-3.5 h-3.5" />
|
||||
{t('tabQrCode')}
|
||||
</TabsTrigger>
|
||||
<TabsTrigger value="flyer" className="flex items-center gap-1.5">
|
||||
<FileText className="w-3.5 h-3.5" />
|
||||
{t('tabFlyer')}
|
||||
</TabsTrigger>
|
||||
</TabsList>
|
||||
|
||||
<TabsContent value="qr">
|
||||
<QRCodeTab
|
||||
referralUrl={referralUrl}
|
||||
prefs={qrPrefs}
|
||||
onPrefsChange={setQrPrefs}
|
||||
visible={activeTab === 'qr' && open}
|
||||
/>
|
||||
</TabsContent>
|
||||
|
||||
<TabsContent value="flyer">
|
||||
<FlyerTab
|
||||
referralCode={referralCode}
|
||||
discountPercent={discountPercent}
|
||||
qrPrefs={qrPrefs}
|
||||
onSwitchToQr={() => setActiveTab('qr')}
|
||||
flyerFilename={flyerFilename}
|
||||
/>
|
||||
</TabsContent>
|
||||
</Tabs>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
import { exportFlyerPdf, exportFlyerHtml, exportFlyerPng } from '../FlyerExport';
|
||||
|
||||
// Mock html2canvas — factory must be self-contained (jest hoists it)
|
||||
jest.mock('html2canvas', () => {
|
||||
return jest.fn().mockResolvedValue({
|
||||
toDataURL: jest.fn().mockReturnValue('data:image/png;base64,fakepng'),
|
||||
toBlob: jest.fn((cb: (blob: Blob) => void) => cb(new Blob(['png'], { type: 'image/png' }))),
|
||||
width: 1632,
|
||||
height: 2112,
|
||||
});
|
||||
});
|
||||
|
||||
// Mock jsPDF
|
||||
const mockAddImage = jest.fn();
|
||||
const mockSave = jest.fn();
|
||||
jest.mock('jspdf', () => {
|
||||
// Must use require-style access for outer variables with jest.mock hoisting
|
||||
return function JsPDFMock() {
|
||||
return {
|
||||
addImage: (...args: unknown[]) => mockAddImage(...args),
|
||||
save: (...args: unknown[]) => mockSave(...args),
|
||||
addPage: jest.fn(),
|
||||
internal: { pageSize: { getWidth: () => 215.9, getHeight: () => 279.4 } },
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
});
|
||||
|
||||
describe('FlyerExport', () => {
|
||||
const mockElement = document.createElement('div');
|
||||
mockElement.setAttribute('data-flyer-page', '');
|
||||
Object.defineProperty(mockElement, 'outerHTML', { value: '<div data-flyer-page="">test</div>' });
|
||||
|
||||
describe('exportFlyerPdf', () => {
|
||||
it('generates PDF with 1 per page', async () => {
|
||||
await exportFlyerPdf(mockElement, { perPage: 1, marginMm: 15, filename: 'test.pdf' });
|
||||
expect(mockAddImage).toHaveBeenCalledTimes(1);
|
||||
expect(mockSave).toHaveBeenCalledWith('test.pdf');
|
||||
});
|
||||
|
||||
it('generates PDF with 2 per page', async () => {
|
||||
await exportFlyerPdf(mockElement, { perPage: 2, marginMm: 10, filename: 'test-2up.pdf' });
|
||||
expect(mockAddImage).toHaveBeenCalledTimes(2);
|
||||
expect(mockSave).toHaveBeenCalledWith('test-2up.pdf');
|
||||
});
|
||||
|
||||
it('generates PDF with 4 per page', async () => {
|
||||
await exportFlyerPdf(mockElement, { perPage: 4, marginMm: 5, filename: 'test-4up.pdf' });
|
||||
expect(mockAddImage).toHaveBeenCalledTimes(4);
|
||||
expect(mockSave).toHaveBeenCalledWith('test-4up.pdf');
|
||||
});
|
||||
});
|
||||
|
||||
describe('exportFlyerHtml', () => {
|
||||
it('returns a blob containing the flyer HTML', () => {
|
||||
const blob = exportFlyerHtml(mockElement);
|
||||
expect(blob).toBeInstanceOf(Blob);
|
||||
expect(blob.type).toBe('text/html');
|
||||
});
|
||||
});
|
||||
|
||||
describe('exportFlyerPng', () => {
|
||||
it('calls html2canvas and triggers download', async () => {
|
||||
const mockUrl = 'blob:test-png';
|
||||
global.URL.createObjectURL = jest.fn().mockReturnValue(mockUrl);
|
||||
global.URL.revokeObjectURL = jest.fn();
|
||||
|
||||
const mockClick = jest.fn();
|
||||
const origCreateElement = document.createElement.bind(document);
|
||||
jest.spyOn(document, 'createElement').mockImplementation((tag: string) => {
|
||||
const el = origCreateElement(tag);
|
||||
if (tag === 'a') {
|
||||
el.click = mockClick;
|
||||
}
|
||||
return el;
|
||||
});
|
||||
|
||||
await exportFlyerPng(mockElement, 'test.png');
|
||||
|
||||
const html2canvas = require('html2canvas');
|
||||
expect(html2canvas).toHaveBeenCalledWith(mockElement, expect.objectContaining({ scale: 2 }));
|
||||
expect(mockClick).toHaveBeenCalled();
|
||||
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,145 +0,0 @@
|
||||
import { render, screen, fireEvent, waitFor, act } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { NextIntlClientProvider } from 'next-intl';
|
||||
import QRCodeDialog from '../QRCodeDialog';
|
||||
|
||||
// Mock qr-code-styling — it requires canvas/DOM APIs not available in jsdom
|
||||
const mockAppend = jest.fn();
|
||||
const mockUpdate = jest.fn();
|
||||
const mockDownload = jest.fn().mockResolvedValue(undefined);
|
||||
|
||||
jest.mock('qr-code-styling', () => {
|
||||
return jest.fn().mockImplementation(() => ({
|
||||
append: mockAppend,
|
||||
update: mockUpdate,
|
||||
download: mockDownload,
|
||||
}));
|
||||
});
|
||||
|
||||
// Load real English messages for the referrals namespace
|
||||
const messages = require('../../../messages/en.json');
|
||||
|
||||
function renderDialog(props: Partial<React.ComponentProps<typeof QRCodeDialog>> = {}) {
|
||||
return render(
|
||||
<NextIntlClientProvider locale="en" messages={messages}>
|
||||
<QRCodeDialog
|
||||
referralUrl="https://nomadkaraoke.com/r/testcode"
|
||||
open={true}
|
||||
onOpenChange={jest.fn()}
|
||||
{...props}
|
||||
/>
|
||||
</NextIntlClientProvider>
|
||||
);
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
localStorage.clear();
|
||||
});
|
||||
|
||||
describe('QRCodeDialog', () => {
|
||||
it('renders the dialog title and download buttons when open', () => {
|
||||
renderDialog();
|
||||
expect(screen.getByText('QR Code Generator')).toBeInTheDocument();
|
||||
expect(screen.getByText('Download PNG')).toBeInTheDocument();
|
||||
expect(screen.getByText('Download SVG')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('does not render when closed', () => {
|
||||
renderDialog({ open: false });
|
||||
expect(screen.queryByText('QR Code Generator')).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders all dot style options', () => {
|
||||
renderDialog();
|
||||
// "Square" appears multiple times (dot style, corner frame, corner dot) — use getAllByText
|
||||
expect(screen.getAllByText('Square').length).toBeGreaterThanOrEqual(1);
|
||||
expect(screen.getByText('Rounded')).toBeInTheDocument();
|
||||
expect(screen.getByText('Dots')).toBeInTheDocument();
|
||||
expect(screen.getByText('Classy')).toBeInTheDocument();
|
||||
expect(screen.getByText('Classy Rounded')).toBeInTheDocument();
|
||||
expect(screen.getAllByText('Extra Rounded').length).toBeGreaterThanOrEqual(1);
|
||||
});
|
||||
|
||||
it('renders corner frame and corner dot style sections', () => {
|
||||
renderDialog();
|
||||
expect(screen.getByText('Corner Frame')).toBeInTheDocument();
|
||||
expect(screen.getByText('Corner Dot')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders center logo options', () => {
|
||||
renderDialog();
|
||||
expect(screen.getByText('Center Logo')).toBeInTheDocument();
|
||||
expect(screen.getByText('None')).toBeInTheDocument();
|
||||
expect(screen.getByText('NK Logo')).toBeInTheDocument();
|
||||
expect(screen.getByText('Emoji')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders color picker inputs', () => {
|
||||
renderDialog();
|
||||
expect(screen.getByText('Foreground')).toBeInTheDocument();
|
||||
expect(screen.getByText('Background')).toBeInTheDocument();
|
||||
// Color inputs
|
||||
const colorInputs = screen.getAllByDisplayValue('#000000');
|
||||
expect(colorInputs.length).toBeGreaterThanOrEqual(1);
|
||||
});
|
||||
|
||||
it('saves style prefs to localStorage on change', async () => {
|
||||
jest.useFakeTimers();
|
||||
renderDialog();
|
||||
// Click "Rounded" dot style
|
||||
fireEvent.click(screen.getByText('Rounded'));
|
||||
// Flush the debounce timer
|
||||
act(() => { jest.runAllTimers(); });
|
||||
const saved = JSON.parse(localStorage.getItem('nk-qr-style-prefs') || '{}');
|
||||
expect(saved.dotStyle).toBe('rounded');
|
||||
jest.useRealTimers();
|
||||
});
|
||||
|
||||
it('restores style prefs from localStorage on open', () => {
|
||||
localStorage.setItem('nk-qr-style-prefs', JSON.stringify({
|
||||
dotStyle: 'dots',
|
||||
cornerSquareStyle: 'dot',
|
||||
cornerDotStyle: 'dot',
|
||||
fgColor: '#ff0000',
|
||||
bgColor: '#00ff00',
|
||||
logo: 'nomad',
|
||||
}));
|
||||
renderDialog();
|
||||
// The foreground color input should have the saved value
|
||||
const fgInput = screen.getByDisplayValue('#ff0000');
|
||||
expect(fgInput).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('calls download with PNG extension when Download PNG clicked', async () => {
|
||||
const user = userEvent.setup();
|
||||
renderDialog();
|
||||
await user.click(screen.getByText('Download PNG'));
|
||||
await waitFor(() => {
|
||||
expect(mockDownload).toHaveBeenCalledWith({
|
||||
name: 'referral-qr',
|
||||
extension: 'png',
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('calls download with SVG extension when Download SVG clicked', async () => {
|
||||
const user = userEvent.setup();
|
||||
renderDialog();
|
||||
await user.click(screen.getByText('Download SVG'));
|
||||
await waitFor(() => {
|
||||
expect(mockDownload).toHaveBeenCalledWith({
|
||||
name: 'referral-qr',
|
||||
extension: 'svg',
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('renders flyer generation controls', () => {
|
||||
renderDialog();
|
||||
expect(screen.getByText('Generate Flyer')).toBeInTheDocument();
|
||||
expect(screen.getByText('Light')).toBeInTheDocument();
|
||||
expect(screen.getByText('Dark')).toBeInTheDocument();
|
||||
expect(screen.getByText('Flyer Theme')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,199 @@
|
||||
import { render, screen, fireEvent, act } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { NextIntlClientProvider } from 'next-intl';
|
||||
import ReferralToolsDialog from '../ReferralToolsDialog';
|
||||
|
||||
// Mock qr-code-styling
|
||||
const mockAppend = jest.fn();
|
||||
const mockUpdate = jest.fn();
|
||||
const mockDownload = jest.fn().mockResolvedValue(undefined);
|
||||
const mockGetRawData = jest.fn().mockResolvedValue(new Blob(['fake'], { type: 'image/png' }));
|
||||
|
||||
jest.mock('qr-code-styling', () => {
|
||||
return jest.fn().mockImplementation(() => ({
|
||||
append: mockAppend,
|
||||
update: mockUpdate,
|
||||
download: mockDownload,
|
||||
getRawData: mockGetRawData,
|
||||
}));
|
||||
});
|
||||
|
||||
// Mock html2canvas
|
||||
jest.mock('html2canvas', () => {
|
||||
return jest.fn().mockResolvedValue({
|
||||
toDataURL: jest.fn().mockReturnValue('data:image/png;base64,fake'),
|
||||
toBlob: jest.fn((cb: (b: Blob) => void) => cb(new Blob(['png']))),
|
||||
width: 1632,
|
||||
height: 2112,
|
||||
});
|
||||
});
|
||||
|
||||
// Mock jsPDF
|
||||
jest.mock('jspdf', () => {
|
||||
return function JsPDFMock() {
|
||||
return {
|
||||
addImage: jest.fn(),
|
||||
save: jest.fn(),
|
||||
addPage: jest.fn(),
|
||||
internal: { pageSize: { getWidth: () => 215.9, getHeight: () => 279.4 } },
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
const messages = require('../../../messages/en.json');
|
||||
|
||||
function renderDialog(props: Partial<React.ComponentProps<typeof ReferralToolsDialog>> = {}) {
|
||||
return render(
|
||||
<NextIntlClientProvider locale="en" messages={messages}>
|
||||
<ReferralToolsDialog
|
||||
referralUrl="https://nomadkaraoke.com/r/testcode"
|
||||
open={true}
|
||||
onOpenChange={jest.fn()}
|
||||
referralCode="testcode"
|
||||
discountPercent={20}
|
||||
{...props}
|
||||
/>
|
||||
</NextIntlClientProvider>
|
||||
);
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
localStorage.clear();
|
||||
});
|
||||
|
||||
describe('ReferralToolsDialog', () => {
|
||||
it('renders with tabs for QR Code and Flyer', () => {
|
||||
renderDialog();
|
||||
expect(screen.getByText('QR Code & Flyer Generator')).toBeInTheDocument();
|
||||
expect(screen.getByText('QR Code')).toBeInTheDocument();
|
||||
expect(screen.getByText('Printable Flyer')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('does not render when closed', () => {
|
||||
renderDialog({ open: false });
|
||||
expect(screen.queryByText('QR Code & Flyer Generator')).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('shows QR Code tab content by default', () => {
|
||||
renderDialog();
|
||||
expect(screen.getByText('Dot Style')).toBeInTheDocument();
|
||||
expect(screen.getByText('Download PNG')).toBeInTheDocument();
|
||||
expect(screen.getByText('Download SVG')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders all QR dot style options on QR tab', () => {
|
||||
renderDialog();
|
||||
expect(screen.getAllByText('Square').length).toBeGreaterThanOrEqual(1);
|
||||
expect(screen.getByText('Rounded')).toBeInTheDocument();
|
||||
expect(screen.getByText('Dots')).toBeInTheDocument();
|
||||
expect(screen.getByText('Classy')).toBeInTheDocument();
|
||||
expect(screen.getByText('Classy Rounded')).toBeInTheDocument();
|
||||
expect(screen.getAllByText('Extra Rounded').length).toBeGreaterThanOrEqual(1);
|
||||
});
|
||||
|
||||
it('renders corner frame and corner dot style sections', () => {
|
||||
renderDialog();
|
||||
expect(screen.getByText('Corner Frame')).toBeInTheDocument();
|
||||
expect(screen.getByText('Corner Dot')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders center logo options', () => {
|
||||
renderDialog();
|
||||
expect(screen.getByText('Center Logo')).toBeInTheDocument();
|
||||
expect(screen.getByText('None')).toBeInTheDocument();
|
||||
expect(screen.getByText('NK Logo')).toBeInTheDocument();
|
||||
expect(screen.getByText('Emoji')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('saves QR style prefs to localStorage on change', async () => {
|
||||
jest.useFakeTimers();
|
||||
renderDialog();
|
||||
fireEvent.click(screen.getByText('Rounded'));
|
||||
act(() => { jest.runAllTimers(); });
|
||||
const saved = JSON.parse(localStorage.getItem('nk-qr-style-prefs') || '{}');
|
||||
expect(saved.dotStyle).toBe('rounded');
|
||||
jest.useRealTimers();
|
||||
});
|
||||
|
||||
it('restores QR style prefs from localStorage on open', () => {
|
||||
localStorage.setItem('nk-qr-style-prefs', JSON.stringify({
|
||||
dotStyle: 'dots',
|
||||
cornerSquareStyle: 'dot',
|
||||
cornerDotStyle: 'dot',
|
||||
fgColor: '#ff0000',
|
||||
bgColor: '#00ff00',
|
||||
logo: 'nomad',
|
||||
logoEmoji: '🎤',
|
||||
}));
|
||||
renderDialog();
|
||||
const fgInput = screen.getByDisplayValue('#ff0000');
|
||||
expect(fgInput).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('switches to Flyer tab when clicked', async () => {
|
||||
const user = userEvent.setup();
|
||||
renderDialog();
|
||||
await user.click(screen.getByText('Printable Flyer'));
|
||||
expect(screen.getByText('Download PDF')).toBeInTheDocument();
|
||||
expect(screen.getByText('Download HTML')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders flyer controls on Flyer tab', async () => {
|
||||
const user = userEvent.setup();
|
||||
renderDialog();
|
||||
await user.click(screen.getByText('Printable Flyer'));
|
||||
expect(screen.getByText('Colors')).toBeInTheDocument();
|
||||
expect(screen.getByText('Sections')).toBeInTheDocument();
|
||||
expect(screen.getByText('Print Layout')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('shows flyer per-page options on Flyer tab', async () => {
|
||||
const user = userEvent.setup();
|
||||
renderDialog();
|
||||
await user.click(screen.getByText('Printable Flyer'));
|
||||
expect(screen.getByText('Flyers Per Page')).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '1' })).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '2' })).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '4' })).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders section visibility toggles on Flyer tab', async () => {
|
||||
const user = userEvent.setup();
|
||||
renderDialog();
|
||||
await user.click(screen.getByText('Printable Flyer'));
|
||||
expect(screen.getByText('Subtitle')).toBeInTheDocument();
|
||||
expect(screen.getByText('How It Works Steps')).toBeInTheDocument();
|
||||
expect(screen.getByText('Divider')).toBeInTheDocument();
|
||||
expect(screen.getByText('Bottom Features')).toBeInTheDocument();
|
||||
expect(screen.getByText('Bottom Tagline')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('shows Edit QR Style link on Flyer tab', async () => {
|
||||
const user = userEvent.setup();
|
||||
renderDialog();
|
||||
await user.click(screen.getByText('Printable Flyer'));
|
||||
expect(screen.getByText('Edit QR Style')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('calls download with PNG extension when Download PNG clicked', async () => {
|
||||
const user = userEvent.setup();
|
||||
renderDialog();
|
||||
await user.click(screen.getByText('Download PNG'));
|
||||
// QR download should be triggered
|
||||
expect(mockDownload).toHaveBeenCalledWith({
|
||||
name: 'referral-qr',
|
||||
extension: 'png',
|
||||
});
|
||||
});
|
||||
|
||||
it('calls download with SVG extension when Download SVG clicked', async () => {
|
||||
const user = userEvent.setup();
|
||||
renderDialog();
|
||||
await user.click(screen.getByText('Download SVG'));
|
||||
expect(mockDownload).toHaveBeenCalledWith({
|
||||
name: 'referral-qr',
|
||||
extension: 'svg',
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,125 @@
|
||||
import {
|
||||
type FlyerConfig,
|
||||
DEFAULT_FLYER_CONFIG,
|
||||
LIGHT_PRESET,
|
||||
DARK_PRESET,
|
||||
BUILT_IN_PRESETS,
|
||||
loadFlyerConfig,
|
||||
saveFlyerConfig,
|
||||
loadCustomPresets,
|
||||
saveCustomPreset,
|
||||
deleteCustomPreset,
|
||||
} from '../flyer-presets';
|
||||
|
||||
beforeEach(() => {
|
||||
localStorage.clear();
|
||||
});
|
||||
|
||||
describe('flyer-presets', () => {
|
||||
describe('DEFAULT_FLYER_CONFIG', () => {
|
||||
it('has all required fields with sensible defaults', () => {
|
||||
expect(DEFAULT_FLYER_CONFIG.bgColor).toBe('#faf8f5');
|
||||
expect(DEFAULT_FLYER_CONFIG.headlineGradient).toEqual(['#c45aff', '#ff7acc', '#ff5a8a']);
|
||||
expect(DEFAULT_FLYER_CONFIG.headlineSubColor).toBe('#1a1a1a');
|
||||
expect(DEFAULT_FLYER_CONFIG.textColor).toBe('#1a1a1a');
|
||||
expect(DEFAULT_FLYER_CONFIG.subtextColor).toBe('#666666');
|
||||
expect(DEFAULT_FLYER_CONFIG.accentColor).toBe('#c45aff');
|
||||
expect(DEFAULT_FLYER_CONFIG.headlineMain).toBeNull();
|
||||
expect(DEFAULT_FLYER_CONFIG.headlineSub).toBeNull();
|
||||
expect(DEFAULT_FLYER_CONFIG.subtitle).toBeNull();
|
||||
expect(DEFAULT_FLYER_CONFIG.ctaLabel).toBeNull();
|
||||
expect(DEFAULT_FLYER_CONFIG.ctaNote).toBeNull();
|
||||
expect(DEFAULT_FLYER_CONFIG.steps).toHaveLength(4);
|
||||
expect(DEFAULT_FLYER_CONFIG.steps[0]).toEqual({ title: null, desc: null });
|
||||
expect(DEFAULT_FLYER_CONFIG.showSubtitle).toBe(true);
|
||||
expect(DEFAULT_FLYER_CONFIG.showSteps).toBe(true);
|
||||
expect(DEFAULT_FLYER_CONFIG.showDivider).toBe(true);
|
||||
expect(DEFAULT_FLYER_CONFIG.showBottomFeatures).toBe(true);
|
||||
expect(DEFAULT_FLYER_CONFIG.showBottomTagline).toBe(true);
|
||||
expect(DEFAULT_FLYER_CONFIG.customLogoUrl).toBeNull();
|
||||
expect(DEFAULT_FLYER_CONFIG.perPage).toBe(1);
|
||||
expect(DEFAULT_FLYER_CONFIG.marginMm).toBe(15);
|
||||
});
|
||||
});
|
||||
|
||||
describe('BUILT_IN_PRESETS', () => {
|
||||
it('has Light and Dark presets', () => {
|
||||
expect(BUILT_IN_PRESETS).toHaveLength(2);
|
||||
expect(BUILT_IN_PRESETS[0].name).toBe('Light');
|
||||
expect(BUILT_IN_PRESETS[1].name).toBe('Dark');
|
||||
});
|
||||
|
||||
it('Light preset matches default config colors', () => {
|
||||
expect(LIGHT_PRESET.bgColor).toBe('#faf8f5');
|
||||
expect(LIGHT_PRESET.textColor).toBe('#1a1a1a');
|
||||
});
|
||||
|
||||
it('Dark preset has dark background and light text', () => {
|
||||
expect(DARK_PRESET.bgColor).toBe('#0c0a1a');
|
||||
expect(DARK_PRESET.textColor).toBe('#ffffff');
|
||||
});
|
||||
});
|
||||
|
||||
describe('loadFlyerConfig / saveFlyerConfig', () => {
|
||||
it('returns default config when nothing saved', () => {
|
||||
const config = loadFlyerConfig();
|
||||
expect(config).toEqual(DEFAULT_FLYER_CONFIG);
|
||||
});
|
||||
|
||||
it('round-trips a config through save and load', () => {
|
||||
const custom: FlyerConfig = {
|
||||
...DEFAULT_FLYER_CONFIG,
|
||||
bgColor: '#ffffff',
|
||||
perPage: 2,
|
||||
marginMm: 5,
|
||||
};
|
||||
saveFlyerConfig(custom);
|
||||
expect(loadFlyerConfig()).toEqual(custom);
|
||||
});
|
||||
|
||||
it('merges partial saved data with defaults', () => {
|
||||
localStorage.setItem('nk-flyer-prefs', JSON.stringify({ bgColor: '#ff0000' }));
|
||||
const config = loadFlyerConfig();
|
||||
expect(config.bgColor).toBe('#ff0000');
|
||||
expect(config.textColor).toBe('#1a1a1a');
|
||||
});
|
||||
});
|
||||
|
||||
describe('custom presets', () => {
|
||||
it('returns empty array when no custom presets saved', () => {
|
||||
expect(loadCustomPresets()).toEqual([]);
|
||||
});
|
||||
|
||||
it('saves and loads a custom preset', () => {
|
||||
const config: FlyerConfig = { ...DEFAULT_FLYER_CONFIG, bgColor: '#ff0000' };
|
||||
saveCustomPreset('My Red Theme', config);
|
||||
const presets = loadCustomPresets();
|
||||
expect(presets).toHaveLength(1);
|
||||
expect(presets[0].name).toBe('My Red Theme');
|
||||
expect(presets[0].config.bgColor).toBe('#ff0000');
|
||||
});
|
||||
|
||||
it('overwrites preset with same name', () => {
|
||||
saveCustomPreset('Theme A', { ...DEFAULT_FLYER_CONFIG, bgColor: '#111111' });
|
||||
saveCustomPreset('Theme A', { ...DEFAULT_FLYER_CONFIG, bgColor: '#222222' });
|
||||
const presets = loadCustomPresets();
|
||||
expect(presets).toHaveLength(1);
|
||||
expect(presets[0].config.bgColor).toBe('#222222');
|
||||
});
|
||||
|
||||
it('deletes a custom preset by name', () => {
|
||||
saveCustomPreset('To Delete', DEFAULT_FLYER_CONFIG);
|
||||
saveCustomPreset('To Keep', DEFAULT_FLYER_CONFIG);
|
||||
deleteCustomPreset('To Delete');
|
||||
const presets = loadCustomPresets();
|
||||
expect(presets).toHaveLength(1);
|
||||
expect(presets[0].name).toBe('To Keep');
|
||||
});
|
||||
|
||||
it('no-ops when deleting non-existent preset', () => {
|
||||
saveCustomPreset('Exists', DEFAULT_FLYER_CONFIG);
|
||||
deleteCustomPreset('Does Not Exist');
|
||||
expect(loadCustomPresets()).toHaveLength(1);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,152 @@
|
||||
export interface FlyerConfig {
|
||||
// Colors
|
||||
bgColor: string;
|
||||
headlineGradient: string[];
|
||||
headlineSubColor: string;
|
||||
textColor: string;
|
||||
subtextColor: string;
|
||||
accentColor: string;
|
||||
|
||||
// Text overrides (null = use default)
|
||||
headlineMain: string | null;
|
||||
headlineSub: string | null;
|
||||
subtitle: string | null;
|
||||
ctaLabel: string | null;
|
||||
ctaNote: string | null;
|
||||
steps: Array<{ title: string | null; desc: string | null }>;
|
||||
|
||||
// Section visibility
|
||||
showSubtitle: boolean;
|
||||
showSteps: boolean;
|
||||
showDivider: boolean;
|
||||
showBottomFeatures: boolean;
|
||||
showBottomTagline: boolean;
|
||||
|
||||
// Custom branding
|
||||
customLogoUrl: string | null;
|
||||
|
||||
// Print layout
|
||||
perPage: 1 | 2 | 4;
|
||||
marginMm: number;
|
||||
}
|
||||
|
||||
export interface NamedPreset {
|
||||
name: string;
|
||||
config: FlyerConfig;
|
||||
}
|
||||
|
||||
const FLYER_CONFIG_KEY = 'nk-flyer-prefs';
|
||||
const CUSTOM_PRESETS_KEY = 'nk-flyer-custom-presets';
|
||||
|
||||
const DEFAULT_STEPS: Array<{ title: string | null; desc: string | null }> = [
|
||||
{ title: null, desc: null },
|
||||
{ title: null, desc: null },
|
||||
{ title: null, desc: null },
|
||||
{ title: null, desc: null },
|
||||
];
|
||||
|
||||
export const LIGHT_PRESET: FlyerConfig = {
|
||||
bgColor: '#faf8f5',
|
||||
headlineGradient: ['#c45aff', '#ff7acc', '#ff5a8a'],
|
||||
headlineSubColor: '#1a1a1a',
|
||||
textColor: '#1a1a1a',
|
||||
subtextColor: '#666666',
|
||||
accentColor: '#c45aff',
|
||||
headlineMain: null,
|
||||
headlineSub: null,
|
||||
subtitle: null,
|
||||
ctaLabel: null,
|
||||
ctaNote: null,
|
||||
steps: [...DEFAULT_STEPS],
|
||||
showSubtitle: true,
|
||||
showSteps: true,
|
||||
showDivider: true,
|
||||
showBottomFeatures: true,
|
||||
showBottomTagline: true,
|
||||
customLogoUrl: null,
|
||||
perPage: 1,
|
||||
marginMm: 15,
|
||||
};
|
||||
|
||||
export const DARK_PRESET: FlyerConfig = {
|
||||
bgColor: '#0c0a1a',
|
||||
headlineGradient: ['#ffd86b', '#ff7acc', '#c45aff'],
|
||||
headlineSubColor: '#ffffff',
|
||||
textColor: '#ffffff',
|
||||
subtextColor: 'rgba(255, 255, 255, 0.6)',
|
||||
accentColor: '#c45aff',
|
||||
headlineMain: null,
|
||||
headlineSub: null,
|
||||
subtitle: null,
|
||||
ctaLabel: null,
|
||||
ctaNote: null,
|
||||
steps: [...DEFAULT_STEPS],
|
||||
showSubtitle: true,
|
||||
showSteps: true,
|
||||
showDivider: true,
|
||||
showBottomFeatures: true,
|
||||
showBottomTagline: true,
|
||||
customLogoUrl: null,
|
||||
perPage: 1,
|
||||
marginMm: 15,
|
||||
};
|
||||
|
||||
export const DEFAULT_FLYER_CONFIG: FlyerConfig = { ...LIGHT_PRESET };
|
||||
|
||||
export const BUILT_IN_PRESETS: NamedPreset[] = [
|
||||
{ name: 'Light', config: LIGHT_PRESET },
|
||||
{ name: 'Dark', config: DARK_PRESET },
|
||||
];
|
||||
|
||||
const isBrowser = typeof window !== 'undefined';
|
||||
|
||||
export function loadFlyerConfig(): FlyerConfig {
|
||||
if (!isBrowser) return { ...DEFAULT_FLYER_CONFIG };
|
||||
try {
|
||||
const saved = localStorage.getItem(FLYER_CONFIG_KEY);
|
||||
if (saved) {
|
||||
return { ...DEFAULT_FLYER_CONFIG, ...JSON.parse(saved) };
|
||||
}
|
||||
} catch {}
|
||||
return { ...DEFAULT_FLYER_CONFIG };
|
||||
}
|
||||
|
||||
export function saveFlyerConfig(config: FlyerConfig): void {
|
||||
if (!isBrowser) return;
|
||||
try {
|
||||
localStorage.setItem(FLYER_CONFIG_KEY, JSON.stringify(config));
|
||||
} catch {}
|
||||
}
|
||||
|
||||
export function loadCustomPresets(): NamedPreset[] {
|
||||
if (!isBrowser) return [];
|
||||
try {
|
||||
const saved = localStorage.getItem(CUSTOM_PRESETS_KEY);
|
||||
if (saved) {
|
||||
return JSON.parse(saved);
|
||||
}
|
||||
} catch {}
|
||||
return [];
|
||||
}
|
||||
|
||||
export function saveCustomPreset(name: string, config: FlyerConfig): void {
|
||||
if (!isBrowser) return;
|
||||
const presets = loadCustomPresets();
|
||||
const idx = presets.findIndex(p => p.name === name);
|
||||
if (idx >= 0) {
|
||||
presets[idx] = { name, config };
|
||||
} else {
|
||||
presets.push({ name, config });
|
||||
}
|
||||
try {
|
||||
localStorage.setItem(CUSTOM_PRESETS_KEY, JSON.stringify(presets));
|
||||
} catch {}
|
||||
}
|
||||
|
||||
export function deleteCustomPreset(name: string): void {
|
||||
if (!isBrowser) return;
|
||||
const presets = loadCustomPresets().filter(p => p.name !== name);
|
||||
try {
|
||||
localStorage.setItem(CUSTOM_PRESETS_KEY, JSON.stringify(presets));
|
||||
} catch {}
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
/**
|
||||
* Tests for auth store's fetchUser() behavior, specifically:
|
||||
* - Abort errors (from page navigation) should NOT clear auth
|
||||
* - Other errors (expired session) SHOULD clear auth
|
||||
* - 401 errors (expired session) SHOULD clear auth
|
||||
* - Network errors (fetch failures) should NOT clear auth
|
||||
*/
|
||||
|
||||
// Mock api module before importing auth
|
||||
@@ -50,18 +51,31 @@ describe('fetchUser', () => {
|
||||
expect(useAuth.getState().isLoading).toBe(false)
|
||||
})
|
||||
|
||||
it('clears auth state when API returns a non-abort error (expired session)', async () => {
|
||||
mockGetCurrentUser.mockRejectedValueOnce(new Error('Unauthorized'))
|
||||
it('clears auth state when API returns 401 (expired session)', async () => {
|
||||
const err = new Error('Unauthorized') as Error & { status: number }
|
||||
err.status = 401
|
||||
mockGetCurrentUser.mockRejectedValueOnce(err)
|
||||
|
||||
const result = await useAuth.getState().fetchUser()
|
||||
|
||||
expect(result).toBe(false)
|
||||
// Auth SHOULD be cleared
|
||||
// Auth SHOULD be cleared on explicit 401
|
||||
expect(clearAccessToken).toHaveBeenCalled()
|
||||
expect(useAuth.getState().user).toBeNull()
|
||||
expect(useAuth.getState().isLoading).toBe(false)
|
||||
})
|
||||
|
||||
it('preserves auth state on network errors (non-401)', async () => {
|
||||
mockGetCurrentUser.mockRejectedValueOnce(new TypeError('Failed to fetch'))
|
||||
|
||||
const result = await useAuth.getState().fetchUser()
|
||||
|
||||
expect(result).toBe(false)
|
||||
// Auth should NOT be cleared on network errors
|
||||
expect(clearAccessToken).not.toHaveBeenCalled()
|
||||
expect(useAuth.getState().isLoading).toBe(false)
|
||||
})
|
||||
|
||||
it('sets user on successful fetch', async () => {
|
||||
mockGetCurrentUser.mockResolvedValueOnce({
|
||||
user: {
|
||||
|
||||
+21
-2
@@ -3548,8 +3548,9 @@ export { ApiError };
|
||||
// Referral API
|
||||
// ============================================================================
|
||||
|
||||
export async function getReferralInterstitial(code: string): Promise<ReferralInterstitial> {
|
||||
const response = await fetch(`${API_BASE_URL}/api/referrals/r/${encodeURIComponent(code)}`);
|
||||
export async function getReferralInterstitial(code: string, noTrack = false): Promise<ReferralInterstitial> {
|
||||
const url = `${API_BASE_URL}/api/referrals/r/${encodeURIComponent(code)}${noTrack ? '?no_track=true' : ''}`;
|
||||
const response = await fetch(url);
|
||||
if (!response.ok) throw new Error('Failed to fetch referral info');
|
||||
return response.json();
|
||||
}
|
||||
@@ -3583,6 +3584,24 @@ export async function startConnectOnboarding(): Promise<{ account_id: string; on
|
||||
return response.json();
|
||||
}
|
||||
|
||||
export async function getConnectDashboardLink(): Promise<{ url: string }> {
|
||||
const response = await fetch(`${API_BASE_URL}/api/referrals/me/connect/dashboard-link`, {
|
||||
method: 'POST',
|
||||
headers: getAuthHeaders(),
|
||||
});
|
||||
if (!response.ok) throw new Error('Failed to get dashboard link');
|
||||
return response.json();
|
||||
}
|
||||
|
||||
export async function getConnectUpdateLink(): Promise<{ url: string }> {
|
||||
const response = await fetch(`${API_BASE_URL}/api/referrals/me/connect/update-link`, {
|
||||
method: 'POST',
|
||||
headers: getAuthHeaders(),
|
||||
});
|
||||
if (!response.ok) throw new Error('Failed to get update link');
|
||||
return response.json();
|
||||
}
|
||||
|
||||
export async function requestVanityUrl(desiredCode: string): Promise<{ ok: boolean; message: string }> {
|
||||
const response = await fetch(`${API_BASE_URL}/api/referrals/me/vanity-request`, {
|
||||
method: 'POST',
|
||||
|
||||
@@ -152,9 +152,14 @@ export const useAuth = create<AuthStore>()(
|
||||
set({ isLoading: false })
|
||||
return false
|
||||
}
|
||||
// Session may have expired
|
||||
clearAccessToken()
|
||||
set({ user: null, isLoading: false })
|
||||
// Only clear token on explicit 401 (session expired/invalid)
|
||||
// Network errors, timeouts, cold-start delays, etc. should not log the user out
|
||||
if (err && typeof err === 'object' && 'status' in err && (err as any).status === 401) {
|
||||
clearAccessToken()
|
||||
set({ user: null, isLoading: false })
|
||||
} else {
|
||||
set({ isLoading: false })
|
||||
}
|
||||
return false
|
||||
}
|
||||
},
|
||||
|
||||
@@ -113,6 +113,14 @@ export interface ReferralPayout {
|
||||
created_at: string;
|
||||
}
|
||||
|
||||
export interface StripeConnectAccount {
|
||||
account_id: string;
|
||||
charges_enabled: boolean;
|
||||
payouts_enabled: boolean;
|
||||
details_submitted: boolean;
|
||||
email: string;
|
||||
}
|
||||
|
||||
export interface ReferralDashboard {
|
||||
link: ReferralLink;
|
||||
pending_balance_cents: number;
|
||||
@@ -121,6 +129,7 @@ export interface ReferralDashboard {
|
||||
recent_earnings: ReferralEarning[];
|
||||
recent_payouts: ReferralPayout[];
|
||||
stripe_connect_configured: boolean;
|
||||
stripe_connect_account: StripeConnectAccount | null;
|
||||
}
|
||||
|
||||
export interface ReferralInterstitial {
|
||||
|
||||
@@ -293,7 +293,9 @@
|
||||
"earnFreeCredit": "اكسب 1 رصيد مجاني",
|
||||
"showTestJobs": "إظهار مهام الاختبار",
|
||||
"signOut": "تسجيل الخروج",
|
||||
"login": "تسجيل الدخول"
|
||||
"login": "تسجيل الدخول",
|
||||
"discountActive": "خصم فعّال",
|
||||
"discountActiveHint": "انقر لعرض شريط الخصم"
|
||||
}
|
||||
},
|
||||
"payment": {
|
||||
@@ -1302,6 +1304,50 @@
|
||||
"flyerThemeLight": "فاتح",
|
||||
"flyerThemeDark": "داكن",
|
||||
"flyerGenerate": "إنشاء نشرة إعلانية",
|
||||
"flyerGenerating": "جاري الإنشاء..."
|
||||
"flyerGenerating": "جاري الإنشاء...",
|
||||
"appliedAtCheckout": "يُطبق تلقائياً عند الدفع",
|
||||
"expires": "ينتهي في {date}",
|
||||
"referredBy": "بإحالة من {name}",
|
||||
"usingCode": "الرمز: {code}",
|
||||
"connectBankLoading": "جاري الإعداد...",
|
||||
"connectDetailsNeeded": "تحتاج Stripe إلى معلومات إضافية لتمكين المدفوعات. انقر على \"تحديث الحساب البنكي\" أدناه لإكمال الإعداد.",
|
||||
"connectRefresh": "يبدو أنك لم تكمل إعداد حسابك البنكي. انقر أدناه للمحاولة مرة أخرى.",
|
||||
"connectStatusActive": "تم تمكين المدفوعات",
|
||||
"connectStatusPending": "الإعداد قيد التقدم",
|
||||
"connectStripeNote": "ستتم إعادة توجيهك إلى موقع Stripe الآمن لإدخال تفاصيل حسابك البنكي. يستغرق هذا عادةً بضع دقائق.",
|
||||
"flyerAccentColor": "لون التمييز",
|
||||
"flyerBranding": "العلامة التجارية",
|
||||
"flyerColors": "الألوان",
|
||||
"flyerDownloadHtml": "تنزيل HTML",
|
||||
"flyerDownloadPdf": "تنزيل PDF",
|
||||
"flyerDownloadPng": "تنزيل PNG",
|
||||
"flyerEditQr": "تعديل نمط QR",
|
||||
"flyerExporting": "جاري التصدير...",
|
||||
"flyerHeadlineGradient": "تدرج العنوان",
|
||||
"flyerHeadlineSubColor": "لون العنوان الفرعي",
|
||||
"flyerMargins": "هوامش الصفحة",
|
||||
"flyerPerPage": "عدد النشرات في الصفحة",
|
||||
"flyerPresetCustom": "مخصص",
|
||||
"flyerPresetName": "اسم الإعداد المسبق",
|
||||
"flyerPresetSave": "حفظ الإعداد المسبق",
|
||||
"flyerPrintLayout": "تخطيط الطباعة",
|
||||
"flyerSections": "الأقسام",
|
||||
"flyerSubtextColor": "النص الفرعي",
|
||||
"flyerTextColor": "النص",
|
||||
"flyerTextOverrides": "تعديلات النص",
|
||||
"flyerToggleDivider": "الفاصل",
|
||||
"flyerToggleFeatures": "الميزات السفلية",
|
||||
"flyerToggleSteps": "خطوات الاستخدام",
|
||||
"flyerToggleSubtitle": "العنوان الفرعي",
|
||||
"flyerToggleTagline": "العبارة الترويجية السفلية",
|
||||
"flyerUploadLogo": "رفع الشعار",
|
||||
"managePayouts": "إدارة المدفوعات",
|
||||
"payoutTitle": "المدفوعات والحساب البنكي",
|
||||
"tabFlyer": "نشرة إعلانية قابلة للطباعة",
|
||||
"tabQrCode": "رمز QR",
|
||||
"toolsTitle": "Generator رمز QR والنشرات الإعلانية",
|
||||
"updateBankAccount": "تحديث الحساب البنكي",
|
||||
"connectFailed": "حدث خطأ ما. يرجى المحاولة مرة أخرى.",
|
||||
"flyerRemoveLogo": "إزالة"
|
||||
}
|
||||
}
|
||||
@@ -293,7 +293,9 @@
|
||||
"earnFreeCredit": "Guanya 1 crèdit gratuït",
|
||||
"showTestJobs": "Mostra els treballs de prova",
|
||||
"signOut": "Tanca sessió",
|
||||
"login": "Inicia sessió"
|
||||
"login": "Inicia sessió",
|
||||
"discountActive": "descompte actiu",
|
||||
"discountActiveHint": "Fes clic per mostrar el bàner de descompte"
|
||||
}
|
||||
},
|
||||
"payment": {
|
||||
@@ -1302,6 +1304,50 @@
|
||||
"flyerThemeLight": "Clar",
|
||||
"flyerThemeDark": "Fosc",
|
||||
"flyerGenerate": "Genera el fullet",
|
||||
"flyerGenerating": "Generant..."
|
||||
"flyerGenerating": "Generant...",
|
||||
"appliedAtCheckout": "S'aplica automàticament en finalitzar la compra",
|
||||
"expires": "Caduca el {date}",
|
||||
"referredBy": "Recomanat per {name}",
|
||||
"usingCode": "Codi: {code}",
|
||||
"connectBankLoading": "Configurant...",
|
||||
"connectDetailsNeeded": "Stripe necessita informació addicional per activar els pagaments. Fes clic a \"Actualitza el compte bancari\" a continuació per completar la configuració.",
|
||||
"connectRefresh": "Sembla que no has acabat de configurar el teu compte bancari. Fes clic a continuació per tornar-ho a provar.",
|
||||
"connectStatusActive": "Pagaments activats",
|
||||
"connectStatusPending": "Configuració en curs",
|
||||
"connectStripeNote": "Se't redirigirà al lloc segur de Stripe per introduir les teves dades bancàries. Això sol trigar un parell de minuts.",
|
||||
"flyerAccentColor": "Color d'accent",
|
||||
"flyerBranding": "Marca",
|
||||
"flyerColors": "Colors",
|
||||
"flyerDownloadHtml": "Descarrega HTML",
|
||||
"flyerDownloadPdf": "Descarrega PDF",
|
||||
"flyerDownloadPng": "Descarrega PNG",
|
||||
"flyerEditQr": "Edita l'estil del QR",
|
||||
"flyerExporting": "Exportant...",
|
||||
"flyerHeadlineGradient": "Degradat del titular",
|
||||
"flyerHeadlineSubColor": "Subtitular",
|
||||
"flyerMargins": "Marges de la pàgina",
|
||||
"flyerPerPage": "Fullets per pàgina",
|
||||
"flyerPresetCustom": "Personalitzat",
|
||||
"flyerPresetName": "Nom del preajust",
|
||||
"flyerPresetSave": "Desa el preajust",
|
||||
"flyerPrintLayout": "Disposició d'impressió",
|
||||
"flyerSections": "Seccions",
|
||||
"flyerSubtextColor": "Subtext",
|
||||
"flyerTextColor": "Text",
|
||||
"flyerTextOverrides": "Substitucions de text",
|
||||
"flyerToggleDivider": "Separador",
|
||||
"flyerToggleFeatures": "Característiques inferiors",
|
||||
"flyerToggleSteps": "Passos de com funciona",
|
||||
"flyerToggleSubtitle": "Subtítol",
|
||||
"flyerToggleTagline": "Eslògan inferior",
|
||||
"flyerUploadLogo": "Puja el logotip",
|
||||
"managePayouts": "Gestiona els pagaments",
|
||||
"payoutTitle": "Pagaments i compte bancari",
|
||||
"tabFlyer": "Fullet imprimible",
|
||||
"tabQrCode": "Codi QR",
|
||||
"toolsTitle": "Generator de codis QR i fullets",
|
||||
"updateBankAccount": "Actualitza el compte bancari",
|
||||
"connectFailed": "Alguna cosa ha anat malament. Torna-ho a provar.",
|
||||
"flyerRemoveLogo": "Elimina"
|
||||
}
|
||||
}
|
||||
@@ -293,7 +293,9 @@
|
||||
"earnFreeCredit": "Získej 1 kredit zdarma",
|
||||
"showTestJobs": "Zobrazit testovací úlohy",
|
||||
"signOut": "Odhlásit se",
|
||||
"login": "Přihlásit se"
|
||||
"login": "Přihlásit se",
|
||||
"discountActive": "sleva aktivní",
|
||||
"discountActiveHint": "Kliknutím zobrazíš banner se slevou"
|
||||
}
|
||||
},
|
||||
"payment": {
|
||||
@@ -1302,6 +1304,50 @@
|
||||
"flyerThemeLight": "Světlý",
|
||||
"flyerThemeDark": "Tmavý",
|
||||
"flyerGenerate": "Vygenerovat leták",
|
||||
"flyerGenerating": "Generování..."
|
||||
"flyerGenerating": "Generování...",
|
||||
"appliedAtCheckout": "Automaticky uplatněno při platbě",
|
||||
"expires": "Platnost do {date}",
|
||||
"referredBy": "Doporučil/a {name}",
|
||||
"usingCode": "Kód: {code}",
|
||||
"connectBankLoading": "Nastavování...",
|
||||
"connectDetailsNeeded": "Stripe potřebuje další informace k povolení výplat. Klikni níže na „Aktualizovat bankovní účet“ a dokonči nastavení.",
|
||||
"connectRefresh": "Vypadá to, že nemáš dokončené nastavení svého bankovního účtu. Klikni níže a zkus to znovu.",
|
||||
"connectStatusActive": "Výplaty povoleny",
|
||||
"connectStatusPending": "Probíhá nastavení",
|
||||
"connectStripeNote": "Přesměrujeme tě na zabezpečenou stránku Stripe, kde zadáš své bankovní údaje. Obvykle to trvá jen pár minut.",
|
||||
"flyerAccentColor": "Akcentní barva",
|
||||
"flyerBranding": "Branding",
|
||||
"flyerColors": "Barvy",
|
||||
"flyerDownloadHtml": "Stáhnout HTML",
|
||||
"flyerDownloadPdf": "Stáhnout PDF",
|
||||
"flyerDownloadPng": "Stáhnout PNG",
|
||||
"flyerEditQr": "Upravit styl QR",
|
||||
"flyerExporting": "Probíhá export...",
|
||||
"flyerHeadlineGradient": "Přechod nadpisu",
|
||||
"flyerHeadlineSubColor": "Podnadpis",
|
||||
"flyerMargins": "Okraje stránky",
|
||||
"flyerPerPage": "Letáků na stránku",
|
||||
"flyerPresetCustom": "Vlastní",
|
||||
"flyerPresetName": "Název předvolby",
|
||||
"flyerPresetSave": "Uložit předvolbu",
|
||||
"flyerPrintLayout": "Rozvržení tisku",
|
||||
"flyerSections": "Sekce",
|
||||
"flyerSubtextColor": "Podtext",
|
||||
"flyerTextColor": "Text",
|
||||
"flyerTextOverrides": "Vlastní texty",
|
||||
"flyerToggleDivider": "Oddělovač",
|
||||
"flyerToggleFeatures": "Funkce v dolní části",
|
||||
"flyerToggleSteps": "Kroky „Jak to funguje“",
|
||||
"flyerToggleSubtitle": "Podtitul",
|
||||
"flyerToggleTagline": "Spodní slogan",
|
||||
"flyerUploadLogo": "Nahrát logo",
|
||||
"managePayouts": "Spravovat výplaty",
|
||||
"payoutTitle": "Výplaty a bankovní účet",
|
||||
"tabFlyer": "Leták k tisku",
|
||||
"tabQrCode": "QR kód",
|
||||
"toolsTitle": "Generator QR kódů a letáků",
|
||||
"updateBankAccount": "Aktualizovat bankovní účet",
|
||||
"connectFailed": "Něco se pokazilo. Zkus to prosím znovu.",
|
||||
"flyerRemoveLogo": "Odstranit"
|
||||
}
|
||||
}
|
||||
@@ -293,7 +293,9 @@
|
||||
"earnFreeCredit": "Tjen 1 gratis credit",
|
||||
"showTestJobs": "Vis testjob",
|
||||
"signOut": "Log ud",
|
||||
"login": "Log ind"
|
||||
"login": "Log ind",
|
||||
"discountActive": "rabat aktiv",
|
||||
"discountActiveHint": "Klik for at vise rabatbanneret"
|
||||
}
|
||||
},
|
||||
"payment": {
|
||||
@@ -1302,6 +1304,50 @@
|
||||
"flyerThemeLight": "Lyst",
|
||||
"flyerThemeDark": "Mørkt",
|
||||
"flyerGenerate": "Generer flyer",
|
||||
"flyerGenerating": "Genererer..."
|
||||
"flyerGenerating": "Genererer...",
|
||||
"appliedAtCheckout": "Anvendes automatisk ved kassen",
|
||||
"expires": "Udløber {date}",
|
||||
"referredBy": "Henvist af {name}",
|
||||
"usingCode": "Kode: {code}",
|
||||
"connectBankLoading": "Gør klar...",
|
||||
"connectDetailsNeeded": "Stripe har brug for yderligere oplysninger for at aktivere udbetalinger. Klik på \"Opdater bankkonto\" nedenfor for at fuldføre opsætningen.",
|
||||
"connectRefresh": "Det ser ud til, at du ikke blev færdig med at opsætte din bankkonto. Klik nedenfor for at prøve igen.",
|
||||
"connectStatusActive": "Udbetalinger aktiveret",
|
||||
"connectStatusPending": "Opsætning i gang",
|
||||
"connectStripeNote": "Du vil blive viderestillet til Stripes sikre side for at indtaste dine bankoplysninger. Det tager normalt et par minutter.",
|
||||
"flyerAccentColor": "Accentfarve",
|
||||
"flyerBranding": "Branding",
|
||||
"flyerColors": "Farver",
|
||||
"flyerDownloadHtml": "Download HTML",
|
||||
"flyerDownloadPdf": "Download PDF",
|
||||
"flyerDownloadPng": "Download PNG",
|
||||
"flyerEditQr": "Rediger QR-stil",
|
||||
"flyerExporting": "Eksporterer...",
|
||||
"flyerHeadlineGradient": "Overskriftsgradient",
|
||||
"flyerHeadlineSubColor": "Underoverskrift",
|
||||
"flyerMargins": "Sidemargener",
|
||||
"flyerPerPage": "Flyers pr. side",
|
||||
"flyerPresetCustom": "Brugerdefineret",
|
||||
"flyerPresetName": "Navn på forudindstilling",
|
||||
"flyerPresetSave": "Gem forudindstilling",
|
||||
"flyerPrintLayout": "Udskriftslayout",
|
||||
"flyerSections": "Sektioner",
|
||||
"flyerSubtextColor": "Undertekst",
|
||||
"flyerTextColor": "Tekst",
|
||||
"flyerTextOverrides": "Tilpasning af tekst",
|
||||
"flyerToggleDivider": "Skillelinje",
|
||||
"flyerToggleFeatures": "Funktioner i bunden",
|
||||
"flyerToggleSteps": "Trin til 'Sådan fungerer det'",
|
||||
"flyerToggleSubtitle": "Undertitel",
|
||||
"flyerToggleTagline": "Slogan i bunden",
|
||||
"flyerUploadLogo": "Upload logo",
|
||||
"managePayouts": "Administrer udbetalinger",
|
||||
"payoutTitle": "Udbetalinger & bankkonto",
|
||||
"tabFlyer": "Udskriftsvenlig flyer",
|
||||
"tabQrCode": "QR-kode",
|
||||
"toolsTitle": "QR-kode & Flyer Generator",
|
||||
"updateBankAccount": "Opdater bankkonto",
|
||||
"connectFailed": "Noget gik galt. Prøv venligst igen.",
|
||||
"flyerRemoveLogo": "Fjern"
|
||||
}
|
||||
}
|
||||
@@ -293,7 +293,9 @@
|
||||
"earnFreeCredit": "1 kostenloses Guthaben verdienen",
|
||||
"showTestJobs": "Testaufträge anzeigen",
|
||||
"signOut": "Abmelden",
|
||||
"login": "Anmelden"
|
||||
"login": "Anmelden",
|
||||
"discountActive": "Rabatt aktiv",
|
||||
"discountActiveHint": "Klicke, um das Rabatt-Banner anzuzeigen"
|
||||
}
|
||||
},
|
||||
"payment": {
|
||||
@@ -1302,6 +1304,50 @@
|
||||
"flyerThemeLight": "Hell",
|
||||
"flyerThemeDark": "Dunkel",
|
||||
"flyerGenerate": "Flyer generieren",
|
||||
"flyerGenerating": "Generiere..."
|
||||
"flyerGenerating": "Generiere...",
|
||||
"appliedAtCheckout": "Wird an der Kasse automatisch angewendet",
|
||||
"expires": "Läuft am {date} ab",
|
||||
"referredBy": "Empfohlen von {name}",
|
||||
"usingCode": "Code: {code}",
|
||||
"connectBankLoading": "Wird eingerichtet...",
|
||||
"connectDetailsNeeded": "Stripe benötigt zusätzliche Informationen, um Auszahlungen zu aktivieren. Klicke unten auf \"Bankkonto aktualisieren\", um die Einrichtung abzuschließen.",
|
||||
"connectRefresh": "Es sieht so aus, als hättest du die Einrichtung deines Bankkontos nicht abgeschlossen. Klicke unten, um es erneut zu versuchen.",
|
||||
"connectStatusActive": "Auszahlungen aktiviert",
|
||||
"connectStatusPending": "Einrichtung läuft",
|
||||
"connectStripeNote": "Du wirst zur sicheren Website von Stripe weitergeleitet, um deine Bankdaten einzugeben. Dies dauert normalerweise ein paar Minuten.",
|
||||
"flyerAccentColor": "Akzentfarbe",
|
||||
"flyerBranding": "Branding",
|
||||
"flyerColors": "Farben",
|
||||
"flyerDownloadHtml": "HTML herunterladen",
|
||||
"flyerDownloadPdf": "PDF herunterladen",
|
||||
"flyerDownloadPng": "PNG herunterladen",
|
||||
"flyerEditQr": "QR-Stil bearbeiten",
|
||||
"flyerExporting": "Wird exportiert...",
|
||||
"flyerHeadlineGradient": "Überschrift-Farbverlauf",
|
||||
"flyerHeadlineSubColor": "Unterüberschrift",
|
||||
"flyerMargins": "Seitenränder",
|
||||
"flyerPerPage": "Flyer pro Seite",
|
||||
"flyerPresetCustom": "Benutzerdefiniert",
|
||||
"flyerPresetName": "Name der Voreinstellung",
|
||||
"flyerPresetSave": "Voreinstellung speichern",
|
||||
"flyerPrintLayout": "Drucklayout",
|
||||
"flyerSections": "Abschnitte",
|
||||
"flyerSubtextColor": "Untertext",
|
||||
"flyerTextColor": "Text",
|
||||
"flyerTextOverrides": "Eigene Texte",
|
||||
"flyerToggleDivider": "Trennlinie",
|
||||
"flyerToggleFeatures": "Funktionen unten",
|
||||
"flyerToggleSteps": "Schritte 'So funktioniert's'",
|
||||
"flyerToggleSubtitle": "Untertitel",
|
||||
"flyerToggleTagline": "Slogan unten",
|
||||
"flyerUploadLogo": "Logo hochladen",
|
||||
"managePayouts": "Auszahlungen verwalten",
|
||||
"payoutTitle": "Auszahlungen & Bankkonto",
|
||||
"tabFlyer": "Druckbarer Flyer",
|
||||
"tabQrCode": "QR-Code",
|
||||
"toolsTitle": "QR-Code- & Flyer-Generator",
|
||||
"updateBankAccount": "Bankkonto aktualisieren",
|
||||
"connectFailed": "Etwas ist schiefgelaufen. Bitte versuche es erneut.",
|
||||
"flyerRemoveLogo": "Entfernen"
|
||||
}
|
||||
}
|
||||
@@ -293,7 +293,9 @@
|
||||
"earnFreeCredit": "Κέρδισε 1 Δωρεάν Μονάδα",
|
||||
"showTestJobs": "Εμφάνιση Δοκιμαστικών Εργασιών",
|
||||
"signOut": "Αποσύνδεση",
|
||||
"login": "Σύνδεση"
|
||||
"login": "Σύνδεση",
|
||||
"discountActive": "ενεργή έκπτωση",
|
||||
"discountActiveHint": "Κάνε κλικ για εμφάνιση του banner έκπτωσης"
|
||||
}
|
||||
},
|
||||
"payment": {
|
||||
@@ -1302,6 +1304,50 @@
|
||||
"flyerThemeLight": "Φωτεινό",
|
||||
"flyerThemeDark": "Σκοτεινό",
|
||||
"flyerGenerate": "Δημιουργία Φυλλαδίου",
|
||||
"flyerGenerating": "Δημιουργία..."
|
||||
"flyerGenerating": "Δημιουργία...",
|
||||
"appliedAtCheckout": "Εφαρμόζεται αυτόματα κατά την ολοκλήρωση της αγοράς",
|
||||
"expires": "Λήγει στις {date}",
|
||||
"referredBy": "Σύσταση από {name}",
|
||||
"usingCode": "Κωδικός: {code}",
|
||||
"connectBankLoading": "Ρύθμιση...",
|
||||
"connectDetailsNeeded": "Η Stripe χρειάζεται πρόσθετες πληροφορίες για να ενεργοποιήσει τις πληρωμές. Κάνε κλικ στο \"Ενημέρωση Τραπεζικού Λογαριασμού\" παρακάτω για να ολοκληρώσεις τη ρύθμιση.",
|
||||
"connectRefresh": "Φαίνεται ότι δεν ολοκλήρωσες τη ρύθμιση του τραπεζικού σου λογαριασμού. Κάνε κλικ παρακάτω για να δοκιμάσεις ξανά.",
|
||||
"connectStatusActive": "Οι πληρωμές ενεργοποιήθηκαν",
|
||||
"connectStatusPending": "Η ρύθμιση είναι σε εξέλιξη",
|
||||
"connectStripeNote": "Θα ανακατευθυνθείς στον ασφαλή ιστότοπο της Stripe για να εισαγάγεις τα τραπεζικά σου στοιχεία. Αυτό συνήθως διαρκεί μερικά λεπτά.",
|
||||
"flyerAccentColor": "Έμφαση",
|
||||
"flyerBranding": "Επωνυμία",
|
||||
"flyerColors": "Χρώματα",
|
||||
"flyerDownloadHtml": "Λήψη HTML",
|
||||
"flyerDownloadPdf": "Λήψη PDF",
|
||||
"flyerDownloadPng": "Λήψη PNG",
|
||||
"flyerEditQr": "Επεξεργασία Στυλ QR",
|
||||
"flyerExporting": "Εξαγωγή...",
|
||||
"flyerHeadlineGradient": "Ντεγκραντέ Επικεφαλίδας",
|
||||
"flyerHeadlineSubColor": "Δευτερεύουσα Επικεφαλίδα",
|
||||
"flyerMargins": "Περιθώρια Σελίδας",
|
||||
"flyerPerPage": "Φυλλάδια Ανά Σελίδα",
|
||||
"flyerPresetCustom": "Προσαρμοσμένο",
|
||||
"flyerPresetName": "Όνομα προεπιλογής",
|
||||
"flyerPresetSave": "Αποθήκευση Προεπιλογής",
|
||||
"flyerPrintLayout": "Διάταξη Εκτύπωσης",
|
||||
"flyerSections": "Ενότητες",
|
||||
"flyerSubtextColor": "Δευτερεύον κείμενο",
|
||||
"flyerTextColor": "Κείμενο",
|
||||
"flyerTextOverrides": "Παρακάμψεις Κειμένου",
|
||||
"flyerToggleDivider": "Διαχωριστικό",
|
||||
"flyerToggleFeatures": "Χαρακτηριστικά στο κάτω μέρος",
|
||||
"flyerToggleSteps": "Βήματα «Πώς λειτουργεί»",
|
||||
"flyerToggleSubtitle": "Υπότιτλος",
|
||||
"flyerToggleTagline": "Σλόγκαν στο κάτω μέρος",
|
||||
"flyerUploadLogo": "Μεταφόρτωση Λογότυπου",
|
||||
"managePayouts": "Διαχείριση Πληρωμών",
|
||||
"payoutTitle": "Πληρωμές & Τραπεζικός Λογαριασμός",
|
||||
"tabFlyer": "Εκτυπώσιμο Φυλλάδιο",
|
||||
"tabQrCode": "Κωδικός QR",
|
||||
"toolsTitle": "Generator Κωδικού QR & Φυλλαδίου",
|
||||
"updateBankAccount": "Ενημέρωση Τραπεζικού Λογαριασμού",
|
||||
"connectFailed": "Κάτι πήγε στραβά. Παρακαλώ δοκίμασε ξανά.",
|
||||
"flyerRemoveLogo": "Αφαίρεση"
|
||||
}
|
||||
}
|
||||
@@ -293,6 +293,7 @@
|
||||
"earnFreeCredit": "Earn 1 Free Credit",
|
||||
"showTestJobs": "Show Test Jobs",
|
||||
"discountActive": "discount active",
|
||||
"discountActiveHint": "Click to show discount banner",
|
||||
"signOut": "Sign Out",
|
||||
"login": "Login"
|
||||
}
|
||||
@@ -1265,15 +1266,29 @@
|
||||
"recentPayouts": "Recent Payouts",
|
||||
"noEarnings": "No earnings yet. Share your link to start earning!",
|
||||
"noPayouts": "No payouts yet.",
|
||||
"payoutTitle": "Payouts & Bank Account",
|
||||
"connectBank": "Connect Bank Account",
|
||||
"connectBankLoading": "Setting up...",
|
||||
"connectDescription": "Connect your bank account via Stripe to receive referral payouts when your balance reaches $20.",
|
||||
"connectComplete": "Bank account connected!",
|
||||
"connectStripeNote": "You'll be redirected to Stripe's secure site to enter your bank details. This usually takes a couple of minutes.",
|
||||
"connectFailed": "Something went wrong. Please try again.",
|
||||
"connectComplete": "Stripe Connect setup complete! Your bank account is now linked for payouts.",
|
||||
"connectRefresh": "It looks like you didn't finish setting up your bank account. Click below to try again.",
|
||||
"connectStatusActive": "Payouts enabled",
|
||||
"connectStatusPending": "Setup in progress",
|
||||
"connectDetailsNeeded": "Stripe needs additional information to enable payouts. Click \"Update Bank Account\" below to complete setup.",
|
||||
"managePayouts": "Manage Payouts",
|
||||
"updateBankAccount": "Update Bank Account",
|
||||
"payoutThreshold": "Payouts are automatically sent when your balance reaches $20.",
|
||||
"interstitialTitle": "You've been referred!",
|
||||
"interstitialReferred": "Referred by {name}",
|
||||
"interstitialDiscount": "Enjoy {percent}% off all credit purchases for {days} days",
|
||||
"interstitialCta": "Get Started",
|
||||
"discountBadge": "{percent}% referral discount",
|
||||
"referredBy": "Referred by {name}",
|
||||
"usingCode": "Code: {code}",
|
||||
"appliedAtCheckout": "Applied automatically at checkout",
|
||||
"expires": "Expires {date}",
|
||||
"discountActive": "Referral discount active — {percent}% off for {days} more days",
|
||||
"cancel": "Cancel",
|
||||
"editProfile": "Edit display name & message",
|
||||
@@ -1303,6 +1318,36 @@
|
||||
"flyerThemeLight": "Light",
|
||||
"flyerThemeDark": "Dark",
|
||||
"flyerGenerate": "Generate Flyer",
|
||||
"flyerGenerating": "Generating..."
|
||||
"flyerGenerating": "Generating...",
|
||||
"toolsTitle": "QR Code & Flyer Generator",
|
||||
"tabQrCode": "QR Code",
|
||||
"tabFlyer": "Printable Flyer",
|
||||
"flyerPresetCustom": "Custom",
|
||||
"flyerPresetName": "Preset name",
|
||||
"flyerPresetSave": "Save Preset",
|
||||
"flyerColors": "Colors",
|
||||
"flyerHeadlineGradient": "Headline Gradient",
|
||||
"flyerHeadlineSubColor": "Headline Sub",
|
||||
"flyerTextColor": "Text",
|
||||
"flyerSubtextColor": "Subtext",
|
||||
"flyerAccentColor": "Accent",
|
||||
"flyerTextOverrides": "Text Overrides",
|
||||
"flyerSections": "Sections",
|
||||
"flyerToggleSubtitle": "Subtitle",
|
||||
"flyerToggleSteps": "How It Works Steps",
|
||||
"flyerToggleDivider": "Divider",
|
||||
"flyerToggleFeatures": "Bottom Features",
|
||||
"flyerToggleTagline": "Bottom Tagline",
|
||||
"flyerBranding": "Branding",
|
||||
"flyerUploadLogo": "Upload Logo",
|
||||
"flyerRemoveLogo": "Remove",
|
||||
"flyerPrintLayout": "Print Layout",
|
||||
"flyerPerPage": "Flyers Per Page",
|
||||
"flyerMargins": "Page Margins",
|
||||
"flyerEditQr": "Edit QR Style",
|
||||
"flyerDownloadPdf": "Download PDF",
|
||||
"flyerDownloadHtml": "Download HTML",
|
||||
"flyerDownloadPng": "Download PNG",
|
||||
"flyerExporting": "Exporting..."
|
||||
}
|
||||
}
|
||||
@@ -293,7 +293,9 @@
|
||||
"earnFreeCredit": "Gana 1 crédito gratis",
|
||||
"showTestJobs": "Mostrar trabajos de prueba",
|
||||
"signOut": "Cerrar sesión",
|
||||
"login": "Iniciar sesión"
|
||||
"login": "Iniciar sesión",
|
||||
"discountActive": "descuento activo",
|
||||
"discountActiveHint": "Haz clic para mostrar el banner de descuento"
|
||||
}
|
||||
},
|
||||
"payment": {
|
||||
@@ -1302,6 +1304,50 @@
|
||||
"flyerThemeLight": "Claro",
|
||||
"flyerThemeDark": "Oscuro",
|
||||
"flyerGenerate": "Generar folleto",
|
||||
"flyerGenerating": "Generando..."
|
||||
"flyerGenerating": "Generando...",
|
||||
"appliedAtCheckout": "Aplicado automáticamente al finalizar la compra",
|
||||
"expires": "Expira {date}",
|
||||
"referredBy": "Referido por {name}",
|
||||
"usingCode": "Código: {code}",
|
||||
"connectBankLoading": "Configurando...",
|
||||
"connectDetailsNeeded": "Stripe necesita información adicional para habilitar los pagos. Haz clic en \"Actualizar cuenta bancaria\" a continuación para completar la configuración.",
|
||||
"connectRefresh": "Parece que no terminaste de configurar tu cuenta bancaria. Haz clic abajo para intentarlo de nuevo.",
|
||||
"connectStatusActive": "Pagos habilitados",
|
||||
"connectStatusPending": "Configuración en curso",
|
||||
"connectStripeNote": "Serás redirigido al sitio seguro de Stripe para ingresar tus datos bancarios. Esto generalmente toma un par de minutos.",
|
||||
"flyerAccentColor": "Acento",
|
||||
"flyerBranding": "Marca",
|
||||
"flyerColors": "Colores",
|
||||
"flyerDownloadHtml": "Descargar HTML",
|
||||
"flyerDownloadPdf": "Descargar PDF",
|
||||
"flyerDownloadPng": "Descargar PNG",
|
||||
"flyerEditQr": "Editar estilo del QR",
|
||||
"flyerExporting": "Exportando...",
|
||||
"flyerHeadlineGradient": "Degradado del titular",
|
||||
"flyerHeadlineSubColor": "Subtítulo del titular",
|
||||
"flyerMargins": "Márgenes de página",
|
||||
"flyerPerPage": "Folletos por página",
|
||||
"flyerPresetCustom": "Personalizado",
|
||||
"flyerPresetName": "Nombre del preset",
|
||||
"flyerPresetSave": "Guardar preset",
|
||||
"flyerPrintLayout": "Diseño de impresión",
|
||||
"flyerSections": "Secciones",
|
||||
"flyerSubtextColor": "Subtexto",
|
||||
"flyerTextColor": "Texto",
|
||||
"flyerTextOverrides": "Modificaciones de texto",
|
||||
"flyerToggleDivider": "Separador",
|
||||
"flyerToggleFeatures": "Características inferiores",
|
||||
"flyerToggleSteps": "Pasos de 'Cómo funciona'",
|
||||
"flyerToggleSubtitle": "Subtítulo",
|
||||
"flyerToggleTagline": "Eslogan inferior",
|
||||
"flyerUploadLogo": "Subir logo",
|
||||
"managePayouts": "Gestionar pagos",
|
||||
"payoutTitle": "Pagos y cuenta bancaria",
|
||||
"tabFlyer": "Folleto imprimible",
|
||||
"tabQrCode": "Código QR",
|
||||
"toolsTitle": "Generator de código QR y folletos",
|
||||
"updateBankAccount": "Actualizar cuenta bancaria",
|
||||
"connectFailed": "Algo salió mal. Por favor, inténtalo de nuevo.",
|
||||
"flyerRemoveLogo": "Quitar"
|
||||
}
|
||||
}
|
||||
@@ -293,7 +293,9 @@
|
||||
"earnFreeCredit": "Ansaitse 1 ilmainen krediitti",
|
||||
"showTestJobs": "Näytä testityöt",
|
||||
"signOut": "Kirjaudu ulos",
|
||||
"login": "Kirjaudu"
|
||||
"login": "Kirjaudu",
|
||||
"discountActive": "alennus aktiivinen",
|
||||
"discountActiveHint": "Klikkaa näyttääksesi alennusbannerin"
|
||||
}
|
||||
},
|
||||
"payment": {
|
||||
@@ -1302,6 +1304,50 @@
|
||||
"flyerThemeLight": "Vaalea",
|
||||
"flyerThemeDark": "Tumma",
|
||||
"flyerGenerate": "Luo mainoslehtinen",
|
||||
"flyerGenerating": "Luodaan..."
|
||||
"flyerGenerating": "Luodaan...",
|
||||
"appliedAtCheckout": "Lisätään automaattisesti kassalla",
|
||||
"expires": "Vanhenee {date}",
|
||||
"referredBy": "Suosittelija: {name}",
|
||||
"usingCode": "Koodi: {code}",
|
||||
"connectBankLoading": "Määritetään...",
|
||||
"connectDetailsNeeded": "Stripe tarvitsee lisätietoja tilitysten aktivoimiseksi. Klikkaa alta \"Päivitä pankkitili\" viimeistelläksesi asetukset.",
|
||||
"connectRefresh": "Näyttää siltä, että pankkitilisi asetukset jäivät kesken. Klikkaa alta yrittääksesi uudelleen.",
|
||||
"connectStatusActive": "Tilitykset käytössä",
|
||||
"connectStatusPending": "Asetukset kesken",
|
||||
"connectStripeNote": "Sinut ohjataan Stripen turvalliselle sivustolle syöttämään pankkitietosi. Tämä kestää yleensä pari minuuttia.",
|
||||
"flyerAccentColor": "Korostusväri",
|
||||
"flyerBranding": "Brändäys",
|
||||
"flyerColors": "Värit",
|
||||
"flyerDownloadHtml": "Lataa HTML",
|
||||
"flyerDownloadPdf": "Lataa PDF",
|
||||
"flyerDownloadPng": "Lataa PNG",
|
||||
"flyerEditQr": "Muokkaa QR-tyyliä",
|
||||
"flyerExporting": "Viedään...",
|
||||
"flyerHeadlineGradient": "Otsikon liukuväri",
|
||||
"flyerHeadlineSubColor": "Alaotsikon väri",
|
||||
"flyerMargins": "Sivun marginaalit",
|
||||
"flyerPerPage": "Esitteitä sivulla",
|
||||
"flyerPresetCustom": "Mukautettu",
|
||||
"flyerPresetName": "Esiasetuksen nimi",
|
||||
"flyerPresetSave": "Tallenna esiasetus",
|
||||
"flyerPrintLayout": "Tulostusasettelu",
|
||||
"flyerSections": "Osiot",
|
||||
"flyerSubtextColor": "Alatekstin väri",
|
||||
"flyerTextColor": "Tekstin väri",
|
||||
"flyerTextOverrides": "Mukautetut tekstit",
|
||||
"flyerToggleDivider": "Erotin",
|
||||
"flyerToggleFeatures": "Alaosan ominaisuudet",
|
||||
"flyerToggleSteps": "Näin se toimii -vaiheet",
|
||||
"flyerToggleSubtitle": "Alaotsikko",
|
||||
"flyerToggleTagline": "Alaosan iskulause",
|
||||
"flyerUploadLogo": "Lataa logo",
|
||||
"managePayouts": "Hallinnoi tilityksiä",
|
||||
"payoutTitle": "Tilitykset ja pankkitili",
|
||||
"tabFlyer": "Tulostettava esite",
|
||||
"tabQrCode": "QR-koodi",
|
||||
"toolsTitle": "QR-koodi- ja esite-Generator",
|
||||
"updateBankAccount": "Päivitä pankkitili",
|
||||
"connectFailed": "Jotain meni pieleen. Yritä uudelleen.",
|
||||
"flyerRemoveLogo": "Poista"
|
||||
}
|
||||
}
|
||||
@@ -293,7 +293,9 @@
|
||||
"earnFreeCredit": "Gagner 1 crédit gratuit",
|
||||
"showTestJobs": "Afficher les projets de test",
|
||||
"signOut": "Se déconnecter",
|
||||
"login": "Connexion"
|
||||
"login": "Connexion",
|
||||
"discountActive": "réduction active",
|
||||
"discountActiveHint": "Clique pour afficher la bannière de réduction"
|
||||
}
|
||||
},
|
||||
"payment": {
|
||||
@@ -1302,6 +1304,50 @@
|
||||
"flyerThemeLight": "Clair",
|
||||
"flyerThemeDark": "Sombre",
|
||||
"flyerGenerate": "Générer un Flyer",
|
||||
"flyerGenerating": "Génération..."
|
||||
"flyerGenerating": "Génération...",
|
||||
"appliedAtCheckout": "Appliqué automatiquement lors du paiement",
|
||||
"expires": "Expire le {date}",
|
||||
"referredBy": "Parrainé par {name}",
|
||||
"usingCode": "Code : {code}",
|
||||
"connectBankLoading": "Configuration en cours...",
|
||||
"connectDetailsNeeded": "Stripe a besoin d'informations supplémentaires pour activer les versements. Clique sur \"Mettre à jour le compte bancaire\" ci-dessous pour terminer la configuration.",
|
||||
"connectRefresh": "Il semble que tu n'aies pas terminé la configuration de ton compte bancaire. Clique ci-dessous pour réessayer.",
|
||||
"connectStatusActive": "Versements activés",
|
||||
"connectStatusPending": "Configuration en cours",
|
||||
"connectStripeNote": "Tu vas être redirigé vers le site sécurisé de Stripe pour entrer tes coordonnées bancaires. Cela prend généralement quelques minutes.",
|
||||
"flyerAccentColor": "Couleur d'accentuation",
|
||||
"flyerBranding": "Image de marque",
|
||||
"flyerColors": "Couleurs",
|
||||
"flyerDownloadHtml": "Télécharger HTML",
|
||||
"flyerDownloadPdf": "Télécharger PDF",
|
||||
"flyerDownloadPng": "Télécharger PNG",
|
||||
"flyerEditQr": "Modifier le style du QR",
|
||||
"flyerExporting": "Exportation en cours...",
|
||||
"flyerHeadlineGradient": "Dégradé du titre",
|
||||
"flyerHeadlineSubColor": "Couleur du sous-titre",
|
||||
"flyerMargins": "Marges de la page",
|
||||
"flyerPerPage": "Flyers par page",
|
||||
"flyerPresetCustom": "Personnalisé",
|
||||
"flyerPresetName": "Nom du préréglage",
|
||||
"flyerPresetSave": "Enregistrer le préréglage",
|
||||
"flyerPrintLayout": "Mise en page d'impression",
|
||||
"flyerSections": "Sections",
|
||||
"flyerSubtextColor": "Sous-texte",
|
||||
"flyerTextColor": "Texte",
|
||||
"flyerTextOverrides": "Textes personnalisés",
|
||||
"flyerToggleDivider": "Séparateur",
|
||||
"flyerToggleFeatures": "Fonctionnalités (bas)",
|
||||
"flyerToggleSteps": "Étapes de fonctionnement",
|
||||
"flyerToggleSubtitle": "Sous-titre",
|
||||
"flyerToggleTagline": "Slogan (bas)",
|
||||
"flyerUploadLogo": "Importer un logo",
|
||||
"managePayouts": "Gérer les versements",
|
||||
"payoutTitle": "Versements et compte bancaire",
|
||||
"tabFlyer": "Flyer imprimable",
|
||||
"tabQrCode": "Code QR",
|
||||
"toolsTitle": "Code QR & Flyer Generator",
|
||||
"updateBankAccount": "Mettre à jour le compte bancaire",
|
||||
"connectFailed": "Quelque chose s'est mal passé. Réessaie.",
|
||||
"flyerRemoveLogo": "Retirer"
|
||||
}
|
||||
}
|
||||
@@ -293,7 +293,9 @@
|
||||
"earnFreeCredit": "הרווח קרדיט 1 חינם",
|
||||
"showTestJobs": "הצג עבודות בדיקה",
|
||||
"signOut": "התנתק",
|
||||
"login": "התחבר"
|
||||
"login": "התחבר",
|
||||
"discountActive": "הנחה פעילה",
|
||||
"discountActiveHint": "לחצו להצגת באנר ההנחה"
|
||||
}
|
||||
},
|
||||
"payment": {
|
||||
@@ -1302,6 +1304,50 @@
|
||||
"flyerThemeLight": "בהיר",
|
||||
"flyerThemeDark": "כהה",
|
||||
"flyerGenerate": "צור פלייר",
|
||||
"flyerGenerating": "יוצר..."
|
||||
"flyerGenerating": "יוצר...",
|
||||
"appliedAtCheckout": "מופעל אוטומטית בקופה",
|
||||
"expires": "בתוקף עד {date}",
|
||||
"referredBy": "הפניה מאת {name}",
|
||||
"usingCode": "קוד: {code}",
|
||||
"connectBankLoading": "מגדיר...",
|
||||
"connectDetailsNeeded": "Stripe זקוק למידע נוסף כדי לאפשר תשלומים. לחצו על \"עדכון חשבון בנק\" למטה כדי להשלים את ההגדרה.",
|
||||
"connectRefresh": "נראה שלא סיימתם להגדיר את חשבון הבנק שלכם. לחצו למטה כדי לנסות שוב.",
|
||||
"connectStatusActive": "תשלומים מופעלים",
|
||||
"connectStatusPending": "הגדרה בתהליך",
|
||||
"connectStripeNote": "תועברו לאתר המאובטח של Stripe כדי להזין את פרטי הבנק שלכם. זה בדרך כלל לוקח כמה דקות.",
|
||||
"flyerAccentColor": "צבע הדגשה",
|
||||
"flyerBranding": "מיתוג",
|
||||
"flyerColors": "צבעים",
|
||||
"flyerDownloadHtml": "הורדת HTML",
|
||||
"flyerDownloadPdf": "הורדת PDF",
|
||||
"flyerDownloadPng": "הורדת PNG",
|
||||
"flyerEditQr": "עריכת סגנון QR",
|
||||
"flyerExporting": "מייצא...",
|
||||
"flyerHeadlineGradient": "גרדיאנט כותרת",
|
||||
"flyerHeadlineSubColor": "צבע כותרת משנה",
|
||||
"flyerMargins": "שולי עמוד",
|
||||
"flyerPerPage": "פליירים לעמוד",
|
||||
"flyerPresetCustom": "מותאם אישית",
|
||||
"flyerPresetName": "שם תבנית",
|
||||
"flyerPresetSave": "שמירת תבנית",
|
||||
"flyerPrintLayout": "פריסת הדפסה",
|
||||
"flyerSections": "מקטעים",
|
||||
"flyerSubtextColor": "טקסט משנה",
|
||||
"flyerTextColor": "טקסט",
|
||||
"flyerTextOverrides": "התאמות טקסט",
|
||||
"flyerToggleDivider": "קו מפריד",
|
||||
"flyerToggleFeatures": "תכונות תחתונות",
|
||||
"flyerToggleSteps": "שלבי 'איך זה עובד'",
|
||||
"flyerToggleSubtitle": "כותרת משנה",
|
||||
"flyerToggleTagline": "סלוגן תחתון",
|
||||
"flyerUploadLogo": "העלאת לוגו",
|
||||
"managePayouts": "ניהול תשלומים",
|
||||
"payoutTitle": "תשלומים וחשבון בנק",
|
||||
"tabFlyer": "פלייר להדפסה",
|
||||
"tabQrCode": "קוד QR",
|
||||
"toolsTitle": "Generator קודי QR ופליירים",
|
||||
"updateBankAccount": "עדכון חשבון בנק",
|
||||
"connectFailed": "משהו השתבש. אנא נסה שוב.",
|
||||
"flyerRemoveLogo": "הסרה"
|
||||
}
|
||||
}
|
||||
@@ -293,7 +293,9 @@
|
||||
"earnFreeCredit": "1 मुफ़्त क्रेडिट कमाओ",
|
||||
"showTestJobs": "टेस्ट जॉब्स दिखाओ",
|
||||
"signOut": "साइन आउट करो",
|
||||
"login": "लॉगिन करो"
|
||||
"login": "लॉगिन करो",
|
||||
"discountActive": "डिस्काउंट सक्रिय",
|
||||
"discountActiveHint": "डिस्काउंट बैनर देखने के लिए क्लिक करो"
|
||||
}
|
||||
},
|
||||
"payment": {
|
||||
@@ -1302,6 +1304,50 @@
|
||||
"flyerThemeLight": "लाइट",
|
||||
"flyerThemeDark": "डार्क",
|
||||
"flyerGenerate": "फ़्लायर जनरेट करो",
|
||||
"flyerGenerating": "जनरेट हो रहा है..."
|
||||
"flyerGenerating": "जनरेट हो रहा है...",
|
||||
"appliedAtCheckout": "चेकआउट पर अपने आप लागू",
|
||||
"expires": "{date} को समाप्त",
|
||||
"referredBy": "{name} द्वारा रेफर किया गया",
|
||||
"usingCode": "कोड: {code}",
|
||||
"connectBankLoading": "सेटअप हो रहा है...",
|
||||
"connectDetailsNeeded": "पेआउट चालू करने के लिए Stripe को कुछ और जानकारी चाहिए। सेटअप पूरा करने के लिए नीचे \"बैंक खाता अपडेट करो\" पर क्लिक करो।",
|
||||
"connectRefresh": "लगता है तुमने अपना बैंक खाता सेटअप पूरा नहीं किया। फिर से कोशिश करने के लिए नीचे क्लिक करो।",
|
||||
"connectStatusActive": "पेआउट चालू हैं",
|
||||
"connectStatusPending": "सेटअप चल रहा है",
|
||||
"connectStripeNote": "तुम्हें अपने बैंक की जानकारी डालने के लिए Stripe की सुरक्षित साइट पर भेजा जाएगा। इसमें आमतौर पर कुछ मिनट लगते हैं।",
|
||||
"flyerAccentColor": "एक्सेंट",
|
||||
"flyerBranding": "ब्रांडिंग",
|
||||
"flyerColors": "रंग",
|
||||
"flyerDownloadHtml": "HTML डाउनलोड करो",
|
||||
"flyerDownloadPdf": "PDF डाउनलोड करो",
|
||||
"flyerDownloadPng": "PNG डाउनलोड करो",
|
||||
"flyerEditQr": "QR स्टाइल एडिट करो",
|
||||
"flyerExporting": "एक्सपोर्ट हो रहा है...",
|
||||
"flyerHeadlineGradient": "हेडलाइन ग्रेडिएंट",
|
||||
"flyerHeadlineSubColor": "हेडलाइन सब",
|
||||
"flyerMargins": "पेज मार्जिन",
|
||||
"flyerPerPage": "प्रति पेज फ्लायर",
|
||||
"flyerPresetCustom": "कस्टम",
|
||||
"flyerPresetName": "प्रीसेट का नाम",
|
||||
"flyerPresetSave": "प्रीसेट सेव करो",
|
||||
"flyerPrintLayout": "प्रिंट लेआउट",
|
||||
"flyerSections": "सेक्शन",
|
||||
"flyerSubtextColor": "सबटेक्स्ट",
|
||||
"flyerTextColor": "टेक्स्ट",
|
||||
"flyerTextOverrides": "टेक्स्ट ओवरराइड",
|
||||
"flyerToggleDivider": "डिवाइडर",
|
||||
"flyerToggleFeatures": "निचले फीचर्स",
|
||||
"flyerToggleSteps": "यह कैसे काम करता है - स्टेप्स",
|
||||
"flyerToggleSubtitle": "सबटाइटल",
|
||||
"flyerToggleTagline": "निचली टैगलाइन",
|
||||
"flyerUploadLogo": "लोगो अपलोड करो",
|
||||
"managePayouts": "पेआउट मैनेज करो",
|
||||
"payoutTitle": "पेआउट और बैंक खाता",
|
||||
"tabFlyer": "प्रिंट करने योग्य फ्लायर",
|
||||
"tabQrCode": "QR कोड",
|
||||
"toolsTitle": "QR कोड और फ्लायर Generator",
|
||||
"updateBankAccount": "बैंक खाता अपडेट करो",
|
||||
"connectFailed": "कुछ गलत हो गया। कृपया फिर से कोशिश करो।",
|
||||
"flyerRemoveLogo": "हटाओ"
|
||||
}
|
||||
}
|
||||
@@ -293,7 +293,9 @@
|
||||
"earnFreeCredit": "Zaradi 1 besplatan kredit",
|
||||
"showTestJobs": "Prikaži testne poslove",
|
||||
"signOut": "Odjavi se",
|
||||
"login": "Prijava"
|
||||
"login": "Prijava",
|
||||
"discountActive": "popust aktivan",
|
||||
"discountActiveHint": "Klikni za prikaz bannera s popustom"
|
||||
}
|
||||
},
|
||||
"payment": {
|
||||
@@ -1302,6 +1304,50 @@
|
||||
"flyerThemeLight": "Svijetlo",
|
||||
"flyerThemeDark": "Tamno",
|
||||
"flyerGenerate": "Generiraj letak",
|
||||
"flyerGenerating": "Generiranje..."
|
||||
"flyerGenerating": "Generiranje...",
|
||||
"appliedAtCheckout": "Primjenjuje se automatski pri plaćanju",
|
||||
"expires": "Ističe {date}",
|
||||
"referredBy": "Preporučio/la {name}",
|
||||
"usingCode": "Kod: {code}",
|
||||
"connectBankLoading": "Postavljanje...",
|
||||
"connectDetailsNeeded": "Stripe treba dodatne informacije kako bi omogućio isplate. Klikni \"Ažuriraj bankovni račun\" u nastavku za dovršetak postavljanja.",
|
||||
"connectRefresh": "Čini se da postavljanje tvog bankovnog računa nije dovršeno. Klikni u nastavku i pokušaj ponovno.",
|
||||
"connectStatusActive": "Isplate omogućene",
|
||||
"connectStatusPending": "Postavljanje u tijeku",
|
||||
"connectStripeNote": "Preusmjerit ćemo te na sigurnu Stripe stranicu za unos bankovnih podataka. To obično traje nekoliko minuta.",
|
||||
"flyerAccentColor": "Boja naglaska",
|
||||
"flyerBranding": "Brendiranje",
|
||||
"flyerColors": "Boje",
|
||||
"flyerDownloadHtml": "Preuzmi HTML",
|
||||
"flyerDownloadPdf": "Preuzmi PDF",
|
||||
"flyerDownloadPng": "Preuzmi PNG",
|
||||
"flyerEditQr": "Uredi stil QR koda",
|
||||
"flyerExporting": "Izvoz...",
|
||||
"flyerHeadlineGradient": "Gradijent naslova",
|
||||
"flyerHeadlineSubColor": "Boja podnaslova",
|
||||
"flyerMargins": "Margine stranice",
|
||||
"flyerPerPage": "Letaka po stranici",
|
||||
"flyerPresetCustom": "Prilagođeno",
|
||||
"flyerPresetName": "Naziv predloška",
|
||||
"flyerPresetSave": "Spremi predložak",
|
||||
"flyerPrintLayout": "Izgled za ispis",
|
||||
"flyerSections": "Sekcije",
|
||||
"flyerSubtextColor": "Podtekst",
|
||||
"flyerTextColor": "Tekst",
|
||||
"flyerTextOverrides": "Izmjene teksta",
|
||||
"flyerToggleDivider": "Razdjelnik",
|
||||
"flyerToggleFeatures": "Značajke na dnu",
|
||||
"flyerToggleSteps": "Koraci za korištenje",
|
||||
"flyerToggleSubtitle": "Podnaslov",
|
||||
"flyerToggleTagline": "Slogan na dnu",
|
||||
"flyerUploadLogo": "Učitaj logotip",
|
||||
"managePayouts": "Upravljaj isplatama",
|
||||
"payoutTitle": "Isplate i bankovni račun",
|
||||
"tabFlyer": "Letak za ispis",
|
||||
"tabQrCode": "QR kod",
|
||||
"toolsTitle": "Generator QR koda i letaka",
|
||||
"updateBankAccount": "Ažuriraj bankovni račun",
|
||||
"connectFailed": "Nešto je pošlo po zlu. Pokušaj ponovno.",
|
||||
"flyerRemoveLogo": "Ukloni"
|
||||
}
|
||||
}
|
||||
@@ -293,7 +293,9 @@
|
||||
"earnFreeCredit": "Szerezz 1 ingyenes kreditet",
|
||||
"showTestJobs": "Teszt projektek mutatása",
|
||||
"signOut": "Kijelentkezés",
|
||||
"login": "Bejelentkezés"
|
||||
"login": "Bejelentkezés",
|
||||
"discountActive": "kedvezmény aktív",
|
||||
"discountActiveHint": "Kattints a kedvezmény bannerének megjelenítéséhez"
|
||||
}
|
||||
},
|
||||
"payment": {
|
||||
@@ -1302,6 +1304,50 @@
|
||||
"flyerThemeLight": "Világos",
|
||||
"flyerThemeDark": "Sötét",
|
||||
"flyerGenerate": "Szórólap generálása",
|
||||
"flyerGenerating": "Generálás..."
|
||||
"flyerGenerating": "Generálás...",
|
||||
"appliedAtCheckout": "Automatikusan érvényesítve a fizetésnél",
|
||||
"expires": "Lejár: {date}",
|
||||
"referredBy": "Ajánlotta: {name}",
|
||||
"usingCode": "Kód: {code}",
|
||||
"connectBankLoading": "Beállítás folyamatban...",
|
||||
"connectDetailsNeeded": "A Stripe-nak további információkra van szüksége a kifizetések engedélyezéséhez. Kattints az alábbi \"Bankszámla frissítése\" gombra a beállítás befejezéséhez.",
|
||||
"connectRefresh": "Úgy tűnik, nem fejezted be a bankszámlád beállítását. Kattints az alábbi gombra az újrapróbálkozáshoz.",
|
||||
"connectStatusActive": "Kifizetések engedélyezve",
|
||||
"connectStatusPending": "Beállítás folyamatban",
|
||||
"connectStripeNote": "Átirányítunk a Stripe biztonságos oldalára, ahol megadhatod a banki adataidat. Ez általában csak néhány percet vesz igénybe.",
|
||||
"flyerAccentColor": "Kiemelő szín",
|
||||
"flyerBranding": "Arculat",
|
||||
"flyerColors": "Színek",
|
||||
"flyerDownloadHtml": "HTML letöltése",
|
||||
"flyerDownloadPdf": "PDF letöltése",
|
||||
"flyerDownloadPng": "PNG letöltése",
|
||||
"flyerEditQr": "QR stílus szerkesztése",
|
||||
"flyerExporting": "Exportálás...",
|
||||
"flyerHeadlineGradient": "Címsor színátmenete",
|
||||
"flyerHeadlineSubColor": "Alcím színe",
|
||||
"flyerMargins": "Oldalmargók",
|
||||
"flyerPerPage": "Szórólap oldalanként",
|
||||
"flyerPresetCustom": "Egyéni",
|
||||
"flyerPresetName": "Előbeállítás neve",
|
||||
"flyerPresetSave": "Előbeállítás mentése",
|
||||
"flyerPrintLayout": "Nyomtatási elrendezés",
|
||||
"flyerSections": "Szakaszok",
|
||||
"flyerSubtextColor": "Kiegészítő szöveg",
|
||||
"flyerTextColor": "Szöveg",
|
||||
"flyerTextOverrides": "Egyéni szövegek",
|
||||
"flyerToggleDivider": "Elválasztó",
|
||||
"flyerToggleFeatures": "Alsó funkciók",
|
||||
"flyerToggleSteps": "Működés lépései",
|
||||
"flyerToggleSubtitle": "Alcím",
|
||||
"flyerToggleTagline": "Alsó szlogen",
|
||||
"flyerUploadLogo": "Logó feltöltése",
|
||||
"managePayouts": "Kifizetések kezelése",
|
||||
"payoutTitle": "Kifizetések és bankszámla",
|
||||
"tabFlyer": "Nyomtatható szórólap",
|
||||
"tabQrCode": "QR-kód",
|
||||
"toolsTitle": "QR-kód és szórólap Generator",
|
||||
"updateBankAccount": "Bankszámla frissítése",
|
||||
"connectFailed": "Valami hiba történt. Kérlek, próbáld újra.",
|
||||
"flyerRemoveLogo": "Eltávolítás"
|
||||
}
|
||||
}
|
||||
@@ -293,7 +293,9 @@
|
||||
"earnFreeCredit": "Dapatkan 1 Kredit Gratis",
|
||||
"showTestJobs": "Tampilkan Proyek Uji",
|
||||
"signOut": "Keluar",
|
||||
"login": "Masuk"
|
||||
"login": "Masuk",
|
||||
"discountActive": "diskon aktif",
|
||||
"discountActiveHint": "Klik untuk menampilkan banner diskon"
|
||||
}
|
||||
},
|
||||
"payment": {
|
||||
@@ -1302,6 +1304,50 @@
|
||||
"flyerThemeLight": "Terang",
|
||||
"flyerThemeDark": "Gelap",
|
||||
"flyerGenerate": "Buat Flyer",
|
||||
"flyerGenerating": "Membuat..."
|
||||
"flyerGenerating": "Membuat...",
|
||||
"appliedAtCheckout": "Diterapkan otomatis saat checkout",
|
||||
"expires": "Kedaluwarsa {date}",
|
||||
"referredBy": "Referensi dari {name}",
|
||||
"usingCode": "Kode: {code}",
|
||||
"connectBankLoading": "Sedang menyiapkan...",
|
||||
"connectDetailsNeeded": "Stripe memerlukan informasi tambahan untuk mengaktifkan pencairan dana. Klik \"Perbarui Rekening Bank\" di bawah untuk menyelesaikan penyiapan.",
|
||||
"connectRefresh": "Sepertinya Anda belum selesai menyiapkan rekening bank Anda. Klik di bawah untuk mencoba lagi.",
|
||||
"connectStatusActive": "Pencairan dana diaktifkan",
|
||||
"connectStatusPending": "Penyiapan sedang berlangsung",
|
||||
"connectStripeNote": "Anda akan diarahkan ke situs aman Stripe untuk memasukkan detail bank Anda. Ini biasanya memakan waktu beberapa menit.",
|
||||
"flyerAccentColor": "Aksen",
|
||||
"flyerBranding": "Branding",
|
||||
"flyerColors": "Warna",
|
||||
"flyerDownloadHtml": "Unduh HTML",
|
||||
"flyerDownloadPdf": "Unduh PDF",
|
||||
"flyerDownloadPng": "Unduh PNG",
|
||||
"flyerEditQr": "Edit Gaya QR",
|
||||
"flyerExporting": "Mengekspor...",
|
||||
"flyerHeadlineGradient": "Gradien Judul",
|
||||
"flyerHeadlineSubColor": "Subjudul",
|
||||
"flyerMargins": "Margin Halaman",
|
||||
"flyerPerPage": "Brosur Per Halaman",
|
||||
"flyerPresetCustom": "Kustom",
|
||||
"flyerPresetName": "Nama Preset",
|
||||
"flyerPresetSave": "Simpan Preset",
|
||||
"flyerPrintLayout": "Tata Letak Cetak",
|
||||
"flyerSections": "Bagian",
|
||||
"flyerSubtextColor": "Subteks",
|
||||
"flyerTextColor": "Teks",
|
||||
"flyerTextOverrides": "Penggantian Teks",
|
||||
"flyerToggleDivider": "Pemisah",
|
||||
"flyerToggleFeatures": "Fitur Bagian Bawah",
|
||||
"flyerToggleSteps": "Langkah Cara Kerja",
|
||||
"flyerToggleSubtitle": "Subjudul",
|
||||
"flyerToggleTagline": "Slogan Bagian Bawah",
|
||||
"flyerUploadLogo": "Unggah Logo",
|
||||
"managePayouts": "Kelola Pencairan Dana",
|
||||
"payoutTitle": "Pencairan Dana & Rekening Bank",
|
||||
"tabFlyer": "Brosur Cetak",
|
||||
"tabQrCode": "Kode QR",
|
||||
"toolsTitle": "Generator Kode QR & Brosur",
|
||||
"updateBankAccount": "Perbarui Rekening Bank",
|
||||
"connectFailed": "Terjadi kesalahan. Silakan coba lagi.",
|
||||
"flyerRemoveLogo": "Hapus"
|
||||
}
|
||||
}
|
||||
@@ -293,7 +293,9 @@
|
||||
"earnFreeCredit": "Guadagna 1 credito gratuito",
|
||||
"showTestJobs": "Mostra lavori di test",
|
||||
"signOut": "Esci",
|
||||
"login": "Accedi"
|
||||
"login": "Accedi",
|
||||
"discountActive": "sconto attivo",
|
||||
"discountActiveHint": "Clicca per mostrare il banner dello sconto"
|
||||
}
|
||||
},
|
||||
"payment": {
|
||||
@@ -1302,6 +1304,50 @@
|
||||
"flyerThemeLight": "Chiaro",
|
||||
"flyerThemeDark": "Scuro",
|
||||
"flyerGenerate": "Genera volantino",
|
||||
"flyerGenerating": "Generazione..."
|
||||
"flyerGenerating": "Generazione...",
|
||||
"appliedAtCheckout": "Applicato automaticamente al checkout",
|
||||
"expires": "Scade {date}",
|
||||
"referredBy": "Invitato da {name}",
|
||||
"usingCode": "Codice: {code}",
|
||||
"connectBankLoading": "Configurazione in corso...",
|
||||
"connectDetailsNeeded": "Stripe ha bisogno di ulteriori informazioni per abilitare gli accrediti. Clicca su \"Aggiorna conto bancario\" qui sotto per completare la configurazione.",
|
||||
"connectRefresh": "Sembra che tu non abbia finito di configurare il tuo conto bancario. Clicca qui sotto per riprovare.",
|
||||
"connectStatusActive": "Accrediti abilitati",
|
||||
"connectStatusPending": "Configurazione in corso",
|
||||
"connectStripeNote": "Verrai reindirizzato al sito sicuro di Stripe per inserire i tuoi dati bancari. Di solito ci vogliono un paio di minuti.",
|
||||
"flyerAccentColor": "Accento",
|
||||
"flyerBranding": "Branding",
|
||||
"flyerColors": "Colori",
|
||||
"flyerDownloadHtml": "Scarica HTML",
|
||||
"flyerDownloadPdf": "Scarica PDF",
|
||||
"flyerDownloadPng": "Scarica PNG",
|
||||
"flyerEditQr": "Modifica stile QR",
|
||||
"flyerExporting": "Esportazione in corso...",
|
||||
"flyerHeadlineGradient": "Sfumatura titolo",
|
||||
"flyerHeadlineSubColor": "Sottotitolo",
|
||||
"flyerMargins": "Margini pagina",
|
||||
"flyerPerPage": "Volantini per pagina",
|
||||
"flyerPresetCustom": "Personalizzato",
|
||||
"flyerPresetName": "Nome preset",
|
||||
"flyerPresetSave": "Salva preset",
|
||||
"flyerPrintLayout": "Layout di stampa",
|
||||
"flyerSections": "Sezioni",
|
||||
"flyerSubtextColor": "Sottotesto",
|
||||
"flyerTextColor": "Testo",
|
||||
"flyerTextOverrides": "Sostituzioni testo",
|
||||
"flyerToggleDivider": "Separatore",
|
||||
"flyerToggleFeatures": "Funzionalità in basso",
|
||||
"flyerToggleSteps": "Passaggi 'Come funziona'",
|
||||
"flyerToggleSubtitle": "Sottotitolo",
|
||||
"flyerToggleTagline": "Slogan in basso",
|
||||
"flyerUploadLogo": "Carica logo",
|
||||
"managePayouts": "Gestisci accrediti",
|
||||
"payoutTitle": "Accrediti e conto bancario",
|
||||
"tabFlyer": "Volantino stampabile",
|
||||
"tabQrCode": "Codice QR",
|
||||
"toolsTitle": "Generator di codici QR e volantini",
|
||||
"updateBankAccount": "Aggiorna conto bancario",
|
||||
"connectFailed": "Qualcosa è andato storto. Riprova.",
|
||||
"flyerRemoveLogo": "Rimuovi"
|
||||
}
|
||||
}
|
||||
@@ -293,7 +293,9 @@
|
||||
"earnFreeCredit": "1無料クレジットを獲得",
|
||||
"showTestJobs": "テストジョブを表示",
|
||||
"signOut": "サインアウト",
|
||||
"login": "ログイン"
|
||||
"login": "ログイン",
|
||||
"discountActive": "割引適用中",
|
||||
"discountActiveHint": "クリックして割引バナーを表示"
|
||||
}
|
||||
},
|
||||
"payment": {
|
||||
@@ -1302,6 +1304,50 @@
|
||||
"flyerThemeLight": "ライト",
|
||||
"flyerThemeDark": "ダーク",
|
||||
"flyerGenerate": "フライヤーを生成",
|
||||
"flyerGenerating": "生成中..."
|
||||
"flyerGenerating": "生成中...",
|
||||
"appliedAtCheckout": "チェックアウト時に自動的に適用されます",
|
||||
"expires": "有効期限: {date}",
|
||||
"referredBy": "{name}さんからの紹介",
|
||||
"usingCode": "コード: {code}",
|
||||
"connectBankLoading": "設定中...",
|
||||
"connectDetailsNeeded": "入金を有効にするには、Stripeに追加情報を登録する必要があります。下の「銀行口座を更新」をクリックして設定を完了してください。",
|
||||
"connectRefresh": "銀行口座の設定が完了していないようです。下をクリックしてもう一度お試しください。",
|
||||
"connectStatusActive": "入金有効",
|
||||
"connectStatusPending": "設定中",
|
||||
"connectStripeNote": "銀行口座情報を入力するため、Stripeの安全なサイトに移動します。通常、数分で完了します。",
|
||||
"flyerAccentColor": "アクセント",
|
||||
"flyerBranding": "ブランディング",
|
||||
"flyerColors": "カラー",
|
||||
"flyerDownloadHtml": "HTMLをダウンロード",
|
||||
"flyerDownloadPdf": "PDFをダウンロード",
|
||||
"flyerDownloadPng": "PNGをダウンロード",
|
||||
"flyerEditQr": "QRスタイルを編集",
|
||||
"flyerExporting": "エクスポート中...",
|
||||
"flyerHeadlineGradient": "見出しのグラデーション",
|
||||
"flyerHeadlineSubColor": "見出しのサブカラー",
|
||||
"flyerMargins": "ページの余白",
|
||||
"flyerPerPage": "1ページあたりのチラシ枚数",
|
||||
"flyerPresetCustom": "カスタム",
|
||||
"flyerPresetName": "プリセット名",
|
||||
"flyerPresetSave": "プリセットを保存",
|
||||
"flyerPrintLayout": "印刷レイアウト",
|
||||
"flyerSections": "セクション",
|
||||
"flyerSubtextColor": "サブテキスト",
|
||||
"flyerTextColor": "テキスト",
|
||||
"flyerTextOverrides": "テキストの変更",
|
||||
"flyerToggleDivider": "区切り線",
|
||||
"flyerToggleFeatures": "下部の機能",
|
||||
"flyerToggleSteps": "使い方のステップ",
|
||||
"flyerToggleSubtitle": "サブタイトル",
|
||||
"flyerToggleTagline": "下部のキャッチコピー",
|
||||
"flyerUploadLogo": "ロゴをアップロード",
|
||||
"managePayouts": "入金の管理",
|
||||
"payoutTitle": "入金と銀行口座",
|
||||
"tabFlyer": "印刷用チラシ",
|
||||
"tabQrCode": "QRコード",
|
||||
"toolsTitle": "QRコード&チラシ Generator",
|
||||
"updateBankAccount": "銀行口座を更新",
|
||||
"connectFailed": "問題が発生しました。もう一度お試しください。",
|
||||
"flyerRemoveLogo": "削除"
|
||||
}
|
||||
}
|
||||
@@ -293,7 +293,9 @@
|
||||
"earnFreeCredit": "무료 크레딧 1개 받기",
|
||||
"showTestJobs": "테스트 작업 표시",
|
||||
"signOut": "로그아웃",
|
||||
"login": "로그인"
|
||||
"login": "로그인",
|
||||
"discountActive": "할인 적용 중",
|
||||
"discountActiveHint": "할인 배너를 보려면 클릭하세요"
|
||||
}
|
||||
},
|
||||
"payment": {
|
||||
@@ -1302,6 +1304,50 @@
|
||||
"flyerThemeLight": "라이트",
|
||||
"flyerThemeDark": "다크",
|
||||
"flyerGenerate": "전단지 생성",
|
||||
"flyerGenerating": "생성 중..."
|
||||
"flyerGenerating": "생성 중...",
|
||||
"appliedAtCheckout": "결제 시 자동으로 적용됩니다",
|
||||
"expires": "{date} 만료",
|
||||
"referredBy": "{name}님의 추천",
|
||||
"usingCode": "코드: {code}",
|
||||
"connectBankLoading": "설정 중...",
|
||||
"connectDetailsNeeded": "지급을 활성화하려면 Stripe에 추가 정보가 필요합니다. 설정을 완료하려면 아래의 \"은행 계좌 업데이트\"를 클릭해 주세요.",
|
||||
"connectRefresh": "은행 계좌 설정을 완료하지 않으신 것 같습니다. 다시 시도하려면 아래를 클릭해 주세요.",
|
||||
"connectStatusActive": "지급 활성화됨",
|
||||
"connectStatusPending": "설정 진행 중",
|
||||
"connectStripeNote": "은행 정보를 안전하게 입력할 수 있도록 Stripe 사이트로 이동합니다. 보통 몇 분 정도 소요됩니다.",
|
||||
"flyerAccentColor": "포인트 색상",
|
||||
"flyerBranding": "브랜딩",
|
||||
"flyerColors": "색상",
|
||||
"flyerDownloadHtml": "HTML 다운로드",
|
||||
"flyerDownloadPdf": "PDF 다운로드",
|
||||
"flyerDownloadPng": "PNG 다운로드",
|
||||
"flyerEditQr": "QR 스타일 편집",
|
||||
"flyerExporting": "내보내는 중...",
|
||||
"flyerHeadlineGradient": "헤드라인 그라데이션",
|
||||
"flyerHeadlineSubColor": "헤드라인 서브 색상",
|
||||
"flyerMargins": "페이지 여백",
|
||||
"flyerPerPage": "페이지당 전단지 수",
|
||||
"flyerPresetCustom": "사용자 지정",
|
||||
"flyerPresetName": "프리셋 이름",
|
||||
"flyerPresetSave": "프리셋 저장",
|
||||
"flyerPrintLayout": "인쇄 레이아웃",
|
||||
"flyerSections": "섹션",
|
||||
"flyerSubtextColor": "서브텍스트 색상",
|
||||
"flyerTextColor": "텍스트 색상",
|
||||
"flyerTextOverrides": "텍스트 변경",
|
||||
"flyerToggleDivider": "구분선",
|
||||
"flyerToggleFeatures": "하단 기능",
|
||||
"flyerToggleSteps": "이용 방법 단계",
|
||||
"flyerToggleSubtitle": "부제목",
|
||||
"flyerToggleTagline": "하단 태그라인",
|
||||
"flyerUploadLogo": "로고 업로드",
|
||||
"managePayouts": "지급 관리",
|
||||
"payoutTitle": "지급 및 은행 계좌",
|
||||
"tabFlyer": "인쇄용 전단지",
|
||||
"tabQrCode": "QR 코드",
|
||||
"toolsTitle": "QR 코드 및 전단지 Generator",
|
||||
"updateBankAccount": "은행 계좌 업데이트",
|
||||
"connectFailed": "문제가 발생했습니다. 다시 시도해 주세요.",
|
||||
"flyerRemoveLogo": "제거"
|
||||
}
|
||||
}
|
||||
@@ -293,7 +293,9 @@
|
||||
"earnFreeCredit": "Dapatkan 1 Kredit Percuma",
|
||||
"showTestJobs": "Tunjukkan Kerja Ujian",
|
||||
"signOut": "Log Keluar",
|
||||
"login": "Log Masuk"
|
||||
"login": "Log Masuk",
|
||||
"discountActive": "diskaun aktif",
|
||||
"discountActiveHint": "Klik untuk papar sepanduk diskaun"
|
||||
}
|
||||
},
|
||||
"payment": {
|
||||
@@ -1302,6 +1304,50 @@
|
||||
"flyerThemeLight": "Terang",
|
||||
"flyerThemeDark": "Gelap",
|
||||
"flyerGenerate": "Jana Risalah",
|
||||
"flyerGenerating": "Menjana..."
|
||||
"flyerGenerating": "Menjana...",
|
||||
"appliedAtCheckout": "Digunakan secara automatik semasa pembayaran",
|
||||
"expires": "Tamat tempoh {date}",
|
||||
"referredBy": "Dirujuk oleh {name}",
|
||||
"usingCode": "Kod: {code}",
|
||||
"connectBankLoading": "Sedang menyediakan...",
|
||||
"connectDetailsNeeded": "Stripe memerlukan maklumat tambahan untuk mengaktifkan pembayaran. Klik \"Kemas Kini Akaun Bank\" di bawah untuk melengkapkan persediaan.",
|
||||
"connectRefresh": "Nampaknya anda tidak selesai menyediakan akaun bank anda. Klik di bawah untuk cuba lagi.",
|
||||
"connectStatusActive": "Pembayaran diaktifkan",
|
||||
"connectStatusPending": "Persediaan sedang dijalankan",
|
||||
"connectStripeNote": "Anda akan dialihkan ke laman web selamat Stripe untuk memasukkan butiran bank anda. Ini biasanya mengambil masa beberapa minit.",
|
||||
"flyerAccentColor": "Aksen",
|
||||
"flyerBranding": "Penjenamaan",
|
||||
"flyerColors": "Warna",
|
||||
"flyerDownloadHtml": "Muat Turun HTML",
|
||||
"flyerDownloadPdf": "Muat Turun PDF",
|
||||
"flyerDownloadPng": "Muat Turun PNG",
|
||||
"flyerEditQr": "Edit Gaya QR",
|
||||
"flyerExporting": "Mengeksport...",
|
||||
"flyerHeadlineGradient": "Kecerunan Tajuk",
|
||||
"flyerHeadlineSubColor": "Subtajuk",
|
||||
"flyerMargins": "Margin Halaman",
|
||||
"flyerPerPage": "Risalah Setiap Halaman",
|
||||
"flyerPresetCustom": "Tersuai",
|
||||
"flyerPresetName": "Nama pratetap",
|
||||
"flyerPresetSave": "Simpan Pratetap",
|
||||
"flyerPrintLayout": "Susun Atur Cetakan",
|
||||
"flyerSections": "Bahagian",
|
||||
"flyerSubtextColor": "Subteks",
|
||||
"flyerTextColor": "Teks",
|
||||
"flyerTextOverrides": "Gantian Teks",
|
||||
"flyerToggleDivider": "Pembahagi",
|
||||
"flyerToggleFeatures": "Ciri-ciri Bawah",
|
||||
"flyerToggleSteps": "Langkah-langkah Cara Ia Berfungsi",
|
||||
"flyerToggleSubtitle": "Subtajuk",
|
||||
"flyerToggleTagline": "Slogan Bawah",
|
||||
"flyerUploadLogo": "Muat Naik Logo",
|
||||
"managePayouts": "Urus Pembayaran",
|
||||
"payoutTitle": "Pembayaran & Akaun Bank",
|
||||
"tabFlyer": "Risalah Boleh Dicetak",
|
||||
"tabQrCode": "Kod QR",
|
||||
"toolsTitle": "Generator Kod QR & Risalah",
|
||||
"updateBankAccount": "Kemas Kini Akaun Bank",
|
||||
"connectFailed": "Sesuatu yang tidak kena berlaku. Sila cuba lagi.",
|
||||
"flyerRemoveLogo": "Alih keluar"
|
||||
}
|
||||
}
|
||||
@@ -293,7 +293,9 @@
|
||||
"earnFreeCredit": "Tjen 1 gratis kreditt",
|
||||
"showTestJobs": "Vis testjobber",
|
||||
"signOut": "Logg ut",
|
||||
"login": "Logg inn"
|
||||
"login": "Logg inn",
|
||||
"discountActive": "rabatt aktiv",
|
||||
"discountActiveHint": "Klikk for å vise rabattbanner"
|
||||
}
|
||||
},
|
||||
"payment": {
|
||||
@@ -1302,6 +1304,50 @@
|
||||
"flyerThemeLight": "Lys",
|
||||
"flyerThemeDark": "Mørk",
|
||||
"flyerGenerate": "Generer flyer",
|
||||
"flyerGenerating": "Genererer..."
|
||||
"flyerGenerating": "Genererer...",
|
||||
"appliedAtCheckout": "Legges til automatisk i kassen",
|
||||
"expires": "Utløper {date}",
|
||||
"referredBy": "Vervet av {name}",
|
||||
"usingCode": "Kode: {code}",
|
||||
"connectBankLoading": "Setter opp...",
|
||||
"connectDetailsNeeded": "Stripe trenger mer informasjon for å aktivere utbetalinger. Klikk på \"Oppdater bankkonto\" nedenfor for å fullføre oppsettet.",
|
||||
"connectRefresh": "Det ser ut til at du ikke ble ferdig med å sette opp bankkontoen din. Klikk nedenfor for å prøve igjen.",
|
||||
"connectStatusActive": "Utbetalinger aktivert",
|
||||
"connectStatusPending": "Oppsett pågår",
|
||||
"connectStripeNote": "Du vil bli omdirigert til Stripes sikre nettsted for å legge inn bankdetaljene dine. Dette tar vanligvis et par minutter.",
|
||||
"flyerAccentColor": "Aksent",
|
||||
"flyerBranding": "Profilering",
|
||||
"flyerColors": "Farger",
|
||||
"flyerDownloadHtml": "Last ned HTML",
|
||||
"flyerDownloadPdf": "Last ned PDF",
|
||||
"flyerDownloadPng": "Last ned PNG",
|
||||
"flyerEditQr": "Rediger QR-stil",
|
||||
"flyerExporting": "Eksporterer...",
|
||||
"flyerHeadlineGradient": "Overskriftsgradient",
|
||||
"flyerHeadlineSubColor": "Underoverskrift",
|
||||
"flyerMargins": "Sidemarginer",
|
||||
"flyerPerPage": "Flyere per side",
|
||||
"flyerPresetCustom": "Tilpasset",
|
||||
"flyerPresetName": "Navn på forhåndsinnstilling",
|
||||
"flyerPresetSave": "Lagre forhåndsinnstilling",
|
||||
"flyerPrintLayout": "Utskriftsoppsett",
|
||||
"flyerSections": "Seksjoner",
|
||||
"flyerSubtextColor": "Undertekst",
|
||||
"flyerTextColor": "Tekst",
|
||||
"flyerTextOverrides": "Tekstoverstyringer",
|
||||
"flyerToggleDivider": "Skillelinje",
|
||||
"flyerToggleFeatures": "Funksjoner nederst",
|
||||
"flyerToggleSteps": "Slik fungerer det-trinn",
|
||||
"flyerToggleSubtitle": "Undertittel",
|
||||
"flyerToggleTagline": "Slagord nederst",
|
||||
"flyerUploadLogo": "Last opp logo",
|
||||
"managePayouts": "Administrer utbetalinger",
|
||||
"payoutTitle": "Utbetalinger og bankkonto",
|
||||
"tabFlyer": "Utskriftsvennlig flyer",
|
||||
"tabQrCode": "QR-kode",
|
||||
"toolsTitle": "Generator for QR-kode og flyer",
|
||||
"updateBankAccount": "Oppdater bankkonto",
|
||||
"connectFailed": "Noe gikk galt. Vennligst prøv igjen.",
|
||||
"flyerRemoveLogo": "Fjern"
|
||||
}
|
||||
}
|
||||
@@ -293,7 +293,9 @@
|
||||
"earnFreeCredit": "Verdien 1 gratis credit",
|
||||
"showTestJobs": "Toon testtaken",
|
||||
"signOut": "Uitloggen",
|
||||
"login": "Inloggen"
|
||||
"login": "Inloggen",
|
||||
"discountActive": "korting actief",
|
||||
"discountActiveHint": "Klik om de kortingsbanner te tonen"
|
||||
}
|
||||
},
|
||||
"payment": {
|
||||
@@ -1302,6 +1304,50 @@
|
||||
"flyerThemeLight": "Licht",
|
||||
"flyerThemeDark": "Donker",
|
||||
"flyerGenerate": "Genereer flyer",
|
||||
"flyerGenerating": "Genereren..."
|
||||
"flyerGenerating": "Genereren...",
|
||||
"appliedAtCheckout": "Wordt automatisch toegepast bij het afrekenen",
|
||||
"expires": "Verloopt op {date}",
|
||||
"referredBy": "Doorverwezen door {name}",
|
||||
"usingCode": "Code: {code}",
|
||||
"connectBankLoading": "Bezig met instellen...",
|
||||
"connectDetailsNeeded": "Stripe heeft aanvullende informatie nodig om uitbetalingen in te schakelen. Klik hieronder op \"Bankrekening bijwerken\" om het instellen te voltooien.",
|
||||
"connectRefresh": "Het lijkt erop dat je het instellen van je bankrekening niet hebt voltooid. Klik hieronder om het opnieuw te proberen.",
|
||||
"connectStatusActive": "Uitbetalingen ingeschakeld",
|
||||
"connectStatusPending": "Bezig met instellen",
|
||||
"connectStripeNote": "Je wordt doorgestuurd naar de beveiligde site van Stripe om je bankgegevens in te voeren. Dit duurt meestal een paar minuten.",
|
||||
"flyerAccentColor": "Accent",
|
||||
"flyerBranding": "Branding",
|
||||
"flyerColors": "Kleuren",
|
||||
"flyerDownloadHtml": "HTML downloaden",
|
||||
"flyerDownloadPdf": "PDF downloaden",
|
||||
"flyerDownloadPng": "PNG downloaden",
|
||||
"flyerEditQr": "QR-stijl bewerken",
|
||||
"flyerExporting": "Bezig met exporteren...",
|
||||
"flyerHeadlineGradient": "Kleurverloop koptekst",
|
||||
"flyerHeadlineSubColor": "Subkoptekst",
|
||||
"flyerMargins": "Paginamarges",
|
||||
"flyerPerPage": "Flyers per pagina",
|
||||
"flyerPresetCustom": "Aangepast",
|
||||
"flyerPresetName": "Preset-naam",
|
||||
"flyerPresetSave": "Preset opslaan",
|
||||
"flyerPrintLayout": "Afdruklay-out",
|
||||
"flyerSections": "Secties",
|
||||
"flyerSubtextColor": "Subtekst",
|
||||
"flyerTextColor": "Tekst",
|
||||
"flyerTextOverrides": "Tekstaanpassingen",
|
||||
"flyerToggleDivider": "Scheidingslijn",
|
||||
"flyerToggleFeatures": "Functies onderaan",
|
||||
"flyerToggleSteps": "Stappen 'Hoe het werkt'",
|
||||
"flyerToggleSubtitle": "Ondertitel",
|
||||
"flyerToggleTagline": "Slogan onderaan",
|
||||
"flyerUploadLogo": "Logo uploaden",
|
||||
"managePayouts": "Uitbetalingen beheren",
|
||||
"payoutTitle": "Uitbetalingen & bankrekening",
|
||||
"tabFlyer": "Afdrukbare flyer",
|
||||
"tabQrCode": "QR-code",
|
||||
"toolsTitle": "QR-code & Flyer Generator",
|
||||
"updateBankAccount": "Bankrekening bijwerken",
|
||||
"connectFailed": "Er is iets misgegaan. Probeer het opnieuw.",
|
||||
"flyerRemoveLogo": "Verwijderen"
|
||||
}
|
||||
}
|
||||
@@ -293,7 +293,9 @@
|
||||
"earnFreeCredit": "Zdobądź 1 darmowy kredyt",
|
||||
"showTestJobs": "Pokaż zadania testowe",
|
||||
"signOut": "Wyloguj się",
|
||||
"login": "Zaloguj się"
|
||||
"login": "Zaloguj się",
|
||||
"discountActive": "zniżka aktywna",
|
||||
"discountActiveHint": "Kliknij, aby wyświetlić baner ze zniżką"
|
||||
}
|
||||
},
|
||||
"payment": {
|
||||
@@ -1302,6 +1304,50 @@
|
||||
"flyerThemeLight": "Jasny",
|
||||
"flyerThemeDark": "Ciemny",
|
||||
"flyerGenerate": "Wygeneruj ulotkę",
|
||||
"flyerGenerating": "Generowanie..."
|
||||
"flyerGenerating": "Generowanie...",
|
||||
"appliedAtCheckout": "Zastosowano automatycznie przy płatności",
|
||||
"expires": "Wygasa {date}",
|
||||
"referredBy": "Z polecenia {name}",
|
||||
"usingCode": "Kod: {code}",
|
||||
"connectBankLoading": "Konfigurowanie...",
|
||||
"connectDetailsNeeded": "Stripe potrzebuje dodatkowych informacji, aby włączyć wypłaty. Kliknij \"Zaktualizuj konto bankowe\" poniżej, aby dokończyć konfigurację.",
|
||||
"connectRefresh": "Wygląda na to, że nie udało Ci się dokończyć konfiguracji konta bankowego. Kliknij poniżej, aby spróbować ponownie.",
|
||||
"connectStatusActive": "Wypłaty włączone",
|
||||
"connectStatusPending": "Konfiguracja w toku",
|
||||
"connectStripeNote": "Przekierujemy Cię na bezpieczną stronę Stripe, gdzie podasz swoje dane bankowe. Zazwyczaj zajmuje to kilka minut.",
|
||||
"flyerAccentColor": "Akcent",
|
||||
"flyerBranding": "Branding",
|
||||
"flyerColors": "Kolory",
|
||||
"flyerDownloadHtml": "Pobierz HTML",
|
||||
"flyerDownloadPdf": "Pobierz PDF",
|
||||
"flyerDownloadPng": "Pobierz PNG",
|
||||
"flyerEditQr": "Edytuj styl QR",
|
||||
"flyerExporting": "Eksportowanie...",
|
||||
"flyerHeadlineGradient": "Gradient nagłówka",
|
||||
"flyerHeadlineSubColor": "Podnagłówek",
|
||||
"flyerMargins": "Marginesy strony",
|
||||
"flyerPerPage": "Ulotek na stronę",
|
||||
"flyerPresetCustom": "Niestandardowe",
|
||||
"flyerPresetName": "Nazwa ustawienia",
|
||||
"flyerPresetSave": "Zapisz ustawienie",
|
||||
"flyerPrintLayout": "Układ wydruku",
|
||||
"flyerSections": "Sekcje",
|
||||
"flyerSubtextColor": "Tekst dodatkowy",
|
||||
"flyerTextColor": "Tekst",
|
||||
"flyerTextOverrides": "Nadpisywanie tekstu",
|
||||
"flyerToggleDivider": "Separator",
|
||||
"flyerToggleFeatures": "Dolne funkcje",
|
||||
"flyerToggleSteps": "Kroki „Jak to działa”",
|
||||
"flyerToggleSubtitle": "Podtytuł",
|
||||
"flyerToggleTagline": "Dolny slogan",
|
||||
"flyerUploadLogo": "Prześlij logo",
|
||||
"managePayouts": "Zarządzaj wypłatami",
|
||||
"payoutTitle": "Wypłaty i konto bankowe",
|
||||
"tabFlyer": "Ulotka do druku",
|
||||
"tabQrCode": "Kod QR",
|
||||
"toolsTitle": "Generator kodów QR i ulotek",
|
||||
"updateBankAccount": "Zaktualizuj konto bankowe",
|
||||
"connectFailed": "Coś poszło nie tak. Spróbuj ponownie.",
|
||||
"flyerRemoveLogo": "Usuń"
|
||||
}
|
||||
}
|
||||
@@ -293,7 +293,9 @@
|
||||
"earnFreeCredit": "Ganhar 1 Crédito Grátis",
|
||||
"showTestJobs": "Mostrar Trabalhos de Teste",
|
||||
"signOut": "Sair",
|
||||
"login": "Entrar"
|
||||
"login": "Entrar",
|
||||
"discountActive": "desconto ativo",
|
||||
"discountActiveHint": "Clique para mostrar o banner de desconto"
|
||||
}
|
||||
},
|
||||
"payment": {
|
||||
@@ -1302,6 +1304,50 @@
|
||||
"flyerThemeLight": "Claro",
|
||||
"flyerThemeDark": "Escuro",
|
||||
"flyerGenerate": "Gerar Panfleto",
|
||||
"flyerGenerating": "Gerando..."
|
||||
"flyerGenerating": "Gerando...",
|
||||
"appliedAtCheckout": "Aplicado automaticamente no checkout",
|
||||
"expires": "Expira em {date}",
|
||||
"referredBy": "Indicado por {name}",
|
||||
"usingCode": "Código: {code}",
|
||||
"connectBankLoading": "Configurando...",
|
||||
"connectDetailsNeeded": "O Stripe precisa de informações adicionais para habilitar os repasses. Clique em \"Atualizar conta bancária\" abaixo para concluir a configuração.",
|
||||
"connectRefresh": "Parece que você não terminou de configurar sua conta bancária. Clique abaixo para tentar novamente.",
|
||||
"connectStatusActive": "Repasses habilitados",
|
||||
"connectStatusPending": "Configuração em andamento",
|
||||
"connectStripeNote": "Você será redirecionado para o site seguro do Stripe para inserir seus dados bancários. Isso geralmente leva alguns minutos.",
|
||||
"flyerAccentColor": "Destaque",
|
||||
"flyerBranding": "Marca",
|
||||
"flyerColors": "Cores",
|
||||
"flyerDownloadHtml": "Baixar HTML",
|
||||
"flyerDownloadPdf": "Baixar PDF",
|
||||
"flyerDownloadPng": "Baixar PNG",
|
||||
"flyerEditQr": "Editar estilo do QR",
|
||||
"flyerExporting": "Exportando...",
|
||||
"flyerHeadlineGradient": "Gradiente do título",
|
||||
"flyerHeadlineSubColor": "Cor do subtítulo",
|
||||
"flyerMargins": "Margens da página",
|
||||
"flyerPerPage": "Panfletos por página",
|
||||
"flyerPresetCustom": "Personalizado",
|
||||
"flyerPresetName": "Nome da predefinição",
|
||||
"flyerPresetSave": "Salvar predefinição",
|
||||
"flyerPrintLayout": "Layout de impressão",
|
||||
"flyerSections": "Seções",
|
||||
"flyerSubtextColor": "Subtexto",
|
||||
"flyerTextColor": "Texto",
|
||||
"flyerTextOverrides": "Substituições de texto",
|
||||
"flyerToggleDivider": "Divisória",
|
||||
"flyerToggleFeatures": "Recursos inferiores",
|
||||
"flyerToggleSteps": "Etapas de 'Como funciona'",
|
||||
"flyerToggleSubtitle": "Subtítulo",
|
||||
"flyerToggleTagline": "Slogan inferior",
|
||||
"flyerUploadLogo": "Enviar logotipo",
|
||||
"managePayouts": "Gerenciar repasses",
|
||||
"payoutTitle": "Repasses e conta bancária",
|
||||
"tabFlyer": "Panfleto imprimível",
|
||||
"tabQrCode": "QR Code",
|
||||
"toolsTitle": "Generator de QR Code e Panfleto",
|
||||
"updateBankAccount": "Atualizar conta bancária",
|
||||
"connectFailed": "Algo deu errado. Tente novamente.",
|
||||
"flyerRemoveLogo": "Remover"
|
||||
}
|
||||
}
|
||||
@@ -293,7 +293,9 @@
|
||||
"earnFreeCredit": "Câștigă 1 credit gratuit",
|
||||
"showTestJobs": "Arată joburile de test",
|
||||
"signOut": "Deconectează-te",
|
||||
"login": "Autentificare"
|
||||
"login": "Autentificare",
|
||||
"discountActive": "reducere activă",
|
||||
"discountActiveHint": "Dă click pentru a afișa bannerul de reducere"
|
||||
}
|
||||
},
|
||||
"payment": {
|
||||
@@ -1302,6 +1304,50 @@
|
||||
"flyerThemeLight": "Luminos",
|
||||
"flyerThemeDark": "Întunecat",
|
||||
"flyerGenerate": "Generează pliant",
|
||||
"flyerGenerating": "Se generează..."
|
||||
"flyerGenerating": "Se generează...",
|
||||
"appliedAtCheckout": "Aplicat automat la finalizarea comenzii",
|
||||
"expires": "Expiră la {date}",
|
||||
"referredBy": "Recomandat de {name}",
|
||||
"usingCode": "Cod: {code}",
|
||||
"connectBankLoading": "Se configurează...",
|
||||
"connectDetailsNeeded": "Stripe are nevoie de informații suplimentare pentru a activa plățile. Fă clic pe \"Actualizează contul bancar\" mai jos pentru a finaliza configurarea.",
|
||||
"connectRefresh": "Se pare că nu ai terminat de configurat contul bancar. Fă clic mai jos pentru a încerca din nou.",
|
||||
"connectStatusActive": "Plăți activate",
|
||||
"connectStatusPending": "Configurare în curs",
|
||||
"connectStripeNote": "Vei fi redirecționat către site-ul securizat Stripe pentru a introduce detaliile bancare. Acest lucru durează de obicei câteva minute.",
|
||||
"flyerAccentColor": "Accent",
|
||||
"flyerBranding": "Branding",
|
||||
"flyerColors": "Culori",
|
||||
"flyerDownloadHtml": "Descarcă HTML",
|
||||
"flyerDownloadPdf": "Descarcă PDF",
|
||||
"flyerDownloadPng": "Descarcă PNG",
|
||||
"flyerEditQr": "Editează stilul QR",
|
||||
"flyerExporting": "Se exportă...",
|
||||
"flyerHeadlineGradient": "Gradient titlu",
|
||||
"flyerHeadlineSubColor": "Subtitlu",
|
||||
"flyerMargins": "Margini pagină",
|
||||
"flyerPerPage": "Flyere pe pagină",
|
||||
"flyerPresetCustom": "Personalizat",
|
||||
"flyerPresetName": "Nume presetare",
|
||||
"flyerPresetSave": "Salvează presetarea",
|
||||
"flyerPrintLayout": "Aspect imprimare",
|
||||
"flyerSections": "Secțiuni",
|
||||
"flyerSubtextColor": "Subtext",
|
||||
"flyerTextColor": "Text",
|
||||
"flyerTextOverrides": "Suprascrieri de text",
|
||||
"flyerToggleDivider": "Separator",
|
||||
"flyerToggleFeatures": "Funcții în partea de jos",
|
||||
"flyerToggleSteps": "Pașii „Cum funcționează”",
|
||||
"flyerToggleSubtitle": "Subtitlu",
|
||||
"flyerToggleTagline": "Slogan în partea de jos",
|
||||
"flyerUploadLogo": "Încarcă logo",
|
||||
"managePayouts": "Gestionează plățile",
|
||||
"payoutTitle": "Plăți și cont bancar",
|
||||
"tabFlyer": "Flyer imprimabil",
|
||||
"tabQrCode": "Cod QR",
|
||||
"toolsTitle": "Generator de coduri QR și flyere",
|
||||
"updateBankAccount": "Actualizează contul bancar",
|
||||
"connectFailed": "Ceva nu a mers bine. Te rog să încerci din nou.",
|
||||
"flyerRemoveLogo": "Elimină"
|
||||
}
|
||||
}
|
||||
@@ -293,7 +293,9 @@
|
||||
"earnFreeCredit": "Заработай 1 бесплатный кредит",
|
||||
"showTestJobs": "Показать тестовые задачи",
|
||||
"signOut": "Выйти",
|
||||
"login": "Войти"
|
||||
"login": "Войти",
|
||||
"discountActive": "скидка активна",
|
||||
"discountActiveHint": "Нажми, чтобы показать баннер со скидкой"
|
||||
}
|
||||
},
|
||||
"payment": {
|
||||
@@ -1302,6 +1304,50 @@
|
||||
"flyerThemeLight": "Светлая",
|
||||
"flyerThemeDark": "Темная",
|
||||
"flyerGenerate": "Сгенерировать флаер",
|
||||
"flyerGenerating": "Генерация..."
|
||||
"flyerGenerating": "Генерация...",
|
||||
"appliedAtCheckout": "Применяется автоматически при оплате",
|
||||
"expires": "Действует до {date}",
|
||||
"referredBy": "Пригласил(а) {name}",
|
||||
"usingCode": "Код: {code}",
|
||||
"connectBankLoading": "Настройка...",
|
||||
"connectDetailsNeeded": "Для Stripe нужна дополнительная информация, чтобы включить выплаты. Нажми \"Обновить банковский счет\" ниже, чтобы завершить настройку.",
|
||||
"connectRefresh": "Похоже, настройка банковского счета не завершена. Нажми ниже, чтобы попробовать снова.",
|
||||
"connectStatusActive": "Выплаты включены",
|
||||
"connectStatusPending": "Настройка в процессе",
|
||||
"connectStripeNote": "Тебя перенаправят на безопасный сайт Stripe для ввода банковских реквизитов. Обычно это занимает пару минут.",
|
||||
"flyerAccentColor": "Акцент",
|
||||
"flyerBranding": "Брендинг",
|
||||
"flyerColors": "Цвета",
|
||||
"flyerDownloadHtml": "Скачать HTML",
|
||||
"flyerDownloadPdf": "Скачать PDF",
|
||||
"flyerDownloadPng": "Скачать PNG",
|
||||
"flyerEditQr": "Изменить стиль QR",
|
||||
"flyerExporting": "Экспорт...",
|
||||
"flyerHeadlineGradient": "Градиент заголовка",
|
||||
"flyerHeadlineSubColor": "Подзаголовок",
|
||||
"flyerMargins": "Поля страницы",
|
||||
"flyerPerPage": "Флаеров на странице",
|
||||
"flyerPresetCustom": "Пользовательский",
|
||||
"flyerPresetName": "Название пресета",
|
||||
"flyerPresetSave": "Сохранить пресет",
|
||||
"flyerPrintLayout": "Макет для печати",
|
||||
"flyerSections": "Разделы",
|
||||
"flyerSubtextColor": "Дополнительный текст",
|
||||
"flyerTextColor": "Текст",
|
||||
"flyerTextOverrides": "Замена текста",
|
||||
"flyerToggleDivider": "Разделитель",
|
||||
"flyerToggleFeatures": "Функции внизу",
|
||||
"flyerToggleSteps": "Шаги \"Как это работает\"",
|
||||
"flyerToggleSubtitle": "Подзаголовок",
|
||||
"flyerToggleTagline": "Нижний слоган",
|
||||
"flyerUploadLogo": "Загрузить логотип",
|
||||
"managePayouts": "Управление выплатами",
|
||||
"payoutTitle": "Выплаты и банковский счет",
|
||||
"tabFlyer": "Флаер для печати",
|
||||
"tabQrCode": "QR-код",
|
||||
"toolsTitle": "Generator QR-кодов и флаеров",
|
||||
"updateBankAccount": "Обновить банковский счет",
|
||||
"connectFailed": "Что-то пошло не так. Пожалуйста, попробуй еще раз.",
|
||||
"flyerRemoveLogo": "Удалить"
|
||||
}
|
||||
}
|
||||
@@ -293,7 +293,9 @@
|
||||
"earnFreeCredit": "Získaj 1 kredit zadarmo",
|
||||
"showTestJobs": "Zobraziť testovacie úlohy",
|
||||
"signOut": "Odhlásiť sa",
|
||||
"login": "Prihlásiť sa"
|
||||
"login": "Prihlásiť sa",
|
||||
"discountActive": "zľava aktívna",
|
||||
"discountActiveHint": "Kliknutím zobrazíš zľavový banner"
|
||||
}
|
||||
},
|
||||
"payment": {
|
||||
@@ -1302,6 +1304,50 @@
|
||||
"flyerThemeLight": "Svetlá",
|
||||
"flyerThemeDark": "Tmavá",
|
||||
"flyerGenerate": "Vygenerovať leták",
|
||||
"flyerGenerating": "Generuje sa..."
|
||||
"flyerGenerating": "Generuje sa...",
|
||||
"appliedAtCheckout": "Automaticky uplatnené pri platbe",
|
||||
"expires": "Platnosť do {date}",
|
||||
"referredBy": "Odporučil/a {name}",
|
||||
"usingCode": "Kód: {code}",
|
||||
"connectBankLoading": "Nastavuje sa...",
|
||||
"connectDetailsNeeded": "Stripe potrebuje ďalšie informácie na povolenie výplat. Pre dokončenie nastavenia klikni nižšie na „Aktualizovať bankový účet“.",
|
||||
"connectRefresh": "Zdá sa, že si nedokončil nastavenie svojho bankového účtu. Klikni nižšie a skús to znova.",
|
||||
"connectStatusActive": "Výplaty povolené",
|
||||
"connectStatusPending": "Prebieha nastavenie",
|
||||
"connectStripeNote": "Budeš presmerovaný na zabezpečenú stránku Stripe, kde zadáš svoje bankové údaje. Zvyčajne to trvá len pár minút.",
|
||||
"flyerAccentColor": "Akcent",
|
||||
"flyerBranding": "Branding",
|
||||
"flyerColors": "Farby",
|
||||
"flyerDownloadHtml": "Stiahnuť HTML",
|
||||
"flyerDownloadPdf": "Stiahnuť PDF",
|
||||
"flyerDownloadPng": "Stiahnuť PNG",
|
||||
"flyerEditQr": "Upraviť štýl QR",
|
||||
"flyerExporting": "Exportuje sa...",
|
||||
"flyerHeadlineGradient": "Prechod nadpisu",
|
||||
"flyerHeadlineSubColor": "Podnadpis",
|
||||
"flyerMargins": "Okraje strany",
|
||||
"flyerPerPage": "Letákov na stranu",
|
||||
"flyerPresetCustom": "Vlastné",
|
||||
"flyerPresetName": "Názov predvoľby",
|
||||
"flyerPresetSave": "Uložiť predvoľbu",
|
||||
"flyerPrintLayout": "Rozloženie tlače",
|
||||
"flyerSections": "Sekcie",
|
||||
"flyerSubtextColor": "Podtext",
|
||||
"flyerTextColor": "Text",
|
||||
"flyerTextOverrides": "Prepísanie textu",
|
||||
"flyerToggleDivider": "Oddeľovač",
|
||||
"flyerToggleFeatures": "Spodné funkcie",
|
||||
"flyerToggleSteps": "Kroky „Ako to funguje“",
|
||||
"flyerToggleSubtitle": "Podnadpis",
|
||||
"flyerToggleTagline": "Spodný slogan",
|
||||
"flyerUploadLogo": "Nahrať logo",
|
||||
"managePayouts": "Spravovať výplaty",
|
||||
"payoutTitle": "Výplaty a bankový účet",
|
||||
"tabFlyer": "Leták na tlač",
|
||||
"tabQrCode": "QR kód",
|
||||
"toolsTitle": "Generator QR kódov a letákov",
|
||||
"updateBankAccount": "Aktualizovať bankový účet",
|
||||
"connectFailed": "Niečo sa pokazilo. Skús to znova.",
|
||||
"flyerRemoveLogo": "Odstrániť"
|
||||
}
|
||||
}
|
||||
@@ -293,7 +293,9 @@
|
||||
"earnFreeCredit": "Tjäna 1 gratis kredit",
|
||||
"showTestJobs": "Visa testjobb",
|
||||
"signOut": "Logga ut",
|
||||
"login": "Logga in"
|
||||
"login": "Logga in",
|
||||
"discountActive": "rabatt aktiv",
|
||||
"discountActiveHint": "Klicka för att visa rabattbannern"
|
||||
}
|
||||
},
|
||||
"payment": {
|
||||
@@ -1302,6 +1304,50 @@
|
||||
"flyerThemeLight": "Ljust",
|
||||
"flyerThemeDark": "Mörkt",
|
||||
"flyerGenerate": "Generera flyer",
|
||||
"flyerGenerating": "Genererar..."
|
||||
"flyerGenerating": "Genererar...",
|
||||
"appliedAtCheckout": "Tillämpas automatiskt i kassan",
|
||||
"expires": "Går ut {date}",
|
||||
"referredBy": "Tipsad av {name}",
|
||||
"usingCode": "Kod: {code}",
|
||||
"connectBankLoading": "Konfigurerar...",
|
||||
"connectDetailsNeeded": "Stripe behöver ytterligare information för att aktivera utbetalningar. Klicka på \"Uppdatera bankkonto\" nedan för att slutföra konfigurationen.",
|
||||
"connectRefresh": "Det verkar som att du inte blev klar med konfigurationen av ditt bankkonto. Klicka nedan för att försöka igen.",
|
||||
"connectStatusActive": "Utbetalningar aktiverade",
|
||||
"connectStatusPending": "Konfiguration pågår",
|
||||
"connectStripeNote": "Du kommer att omdirigeras till Stripes säkra webbplats för att ange dina bankuppgifter. Detta tar vanligtvis ett par minuter.",
|
||||
"flyerAccentColor": "Accent",
|
||||
"flyerBranding": "Profilering",
|
||||
"flyerColors": "Färger",
|
||||
"flyerDownloadHtml": "Ladda ner HTML",
|
||||
"flyerDownloadPdf": "Ladda ner PDF",
|
||||
"flyerDownloadPng": "Ladda ner PNG",
|
||||
"flyerEditQr": "Redigera QR-stil",
|
||||
"flyerExporting": "Exporterar...",
|
||||
"flyerHeadlineGradient": "Rubrikövertoning",
|
||||
"flyerHeadlineSubColor": "Underrubrik",
|
||||
"flyerMargins": "Sidmarginaler",
|
||||
"flyerPerPage": "Flyers per sida",
|
||||
"flyerPresetCustom": "Anpassad",
|
||||
"flyerPresetName": "Namn på förinställning",
|
||||
"flyerPresetSave": "Spara förinställning",
|
||||
"flyerPrintLayout": "Utskriftslayout",
|
||||
"flyerSections": "Sektioner",
|
||||
"flyerSubtextColor": "Undertext",
|
||||
"flyerTextColor": "Text",
|
||||
"flyerTextOverrides": "Anpassad text",
|
||||
"flyerToggleDivider": "Avdelare",
|
||||
"flyerToggleFeatures": "Funktioner längst ner",
|
||||
"flyerToggleSteps": "Steg för \"Så här fungerar det\"",
|
||||
"flyerToggleSubtitle": "Underrubrik",
|
||||
"flyerToggleTagline": "Slogan längst ner",
|
||||
"flyerUploadLogo": "Ladda upp logotyp",
|
||||
"managePayouts": "Hantera utbetalningar",
|
||||
"payoutTitle": "Utbetalningar & bankkonto",
|
||||
"tabFlyer": "Utskriftsvänlig flyer",
|
||||
"tabQrCode": "QR-kod",
|
||||
"toolsTitle": "QR-kod & Flyer Generator",
|
||||
"updateBankAccount": "Uppdatera bankkonto",
|
||||
"connectFailed": "Något gick fel. Försök igen.",
|
||||
"flyerRemoveLogo": "Ta bort"
|
||||
}
|
||||
}
|
||||
@@ -293,7 +293,9 @@
|
||||
"earnFreeCredit": "รับฟรี 1 เครดิต",
|
||||
"showTestJobs": "แสดงงานทดสอบ",
|
||||
"signOut": "ออกจากระบบ",
|
||||
"login": "เข้าสู่ระบบ"
|
||||
"login": "เข้าสู่ระบบ",
|
||||
"discountActive": "ส่วนลดที่ใช้งานอยู่",
|
||||
"discountActiveHint": "คลิกเพื่อแสดงแบนเนอร์ส่วนลด"
|
||||
}
|
||||
},
|
||||
"payment": {
|
||||
@@ -1302,6 +1304,50 @@
|
||||
"flyerThemeLight": "สว่าง",
|
||||
"flyerThemeDark": "มืด",
|
||||
"flyerGenerate": "สร้างใบปลิว",
|
||||
"flyerGenerating": "กำลังสร้าง..."
|
||||
"flyerGenerating": "กำลังสร้าง...",
|
||||
"appliedAtCheckout": "ใช้งานอัตโนมัติเมื่อชำระเงิน",
|
||||
"expires": "หมดอายุ {date}",
|
||||
"referredBy": "แนะนำโดย {name}",
|
||||
"usingCode": "รหัส: {code}",
|
||||
"connectBankLoading": "กำลังตั้งค่า...",
|
||||
"connectDetailsNeeded": "Stripe ต้องการข้อมูลเพิ่มเติมเพื่อเปิดใช้งานการรับเงิน คลิก \"อัปเดตบัญชีธนาคาร\" ด้านล่างเพื่อตั้งค่าให้เสร็จสมบูรณ์",
|
||||
"connectRefresh": "ดูเหมือนว่าคุณยังตั้งค่าบัญชีธนาคารไม่เสร็จสมบูรณ์ คลิกด้านล่างเพื่อลองอีกครั้ง",
|
||||
"connectStatusActive": "เปิดใช้งานการรับเงินแล้ว",
|
||||
"connectStatusPending": "กำลังดำเนินการตั้งค่า",
|
||||
"connectStripeNote": "คุณจะถูกเปลี่ยนหน้าไปยังเว็บไซต์ที่ปลอดภัยของ Stripe เพื่อกรอกข้อมูลธนาคารของคุณ ซึ่งมักจะใช้เวลาเพียงไม่กี่นาที",
|
||||
"flyerAccentColor": "สีเน้น",
|
||||
"flyerBranding": "แบรนด์",
|
||||
"flyerColors": "สี",
|
||||
"flyerDownloadHtml": "ดาวน์โหลด HTML",
|
||||
"flyerDownloadPdf": "ดาวน์โหลด PDF",
|
||||
"flyerDownloadPng": "ดาวน์โหลด PNG",
|
||||
"flyerEditQr": "แก้ไขสไตล์ QR",
|
||||
"flyerExporting": "กำลังส่งออก...",
|
||||
"flyerHeadlineGradient": "การไล่สีหัวข้อ",
|
||||
"flyerHeadlineSubColor": "สีหัวข้อรอง",
|
||||
"flyerMargins": "ระยะขอบหน้ากระดาษ",
|
||||
"flyerPerPage": "จำนวนใบปลิวต่อหน้า",
|
||||
"flyerPresetCustom": "กำหนดเอง",
|
||||
"flyerPresetName": "ชื่อพรีเซ็ต",
|
||||
"flyerPresetSave": "บันทึกพรีเซ็ต",
|
||||
"flyerPrintLayout": "เค้าโครงสำหรับพิมพ์",
|
||||
"flyerSections": "ส่วนต่างๆ",
|
||||
"flyerSubtextColor": "ข้อความรอง",
|
||||
"flyerTextColor": "ข้อความ",
|
||||
"flyerTextOverrides": "กำหนดข้อความเอง",
|
||||
"flyerToggleDivider": "เส้นคั่น",
|
||||
"flyerToggleFeatures": "ฟีเจอร์ด้านล่าง",
|
||||
"flyerToggleSteps": "ขั้นตอนการทำงาน",
|
||||
"flyerToggleSubtitle": "คำบรรยาย",
|
||||
"flyerToggleTagline": "สโลแกนด้านล่าง",
|
||||
"flyerUploadLogo": "อัปโหลดโลโก้",
|
||||
"managePayouts": "จัดการการรับเงิน",
|
||||
"payoutTitle": "การรับเงินและบัญชีธนาคาร",
|
||||
"tabFlyer": "ใบปลิวสำหรับพิมพ์",
|
||||
"tabQrCode": "QR Code",
|
||||
"toolsTitle": "QR Code & Flyer Generator",
|
||||
"updateBankAccount": "อัปเดตบัญชีธนาคาร",
|
||||
"connectFailed": "เกิดข้อผิดพลาดบางอย่าง โปรดลองอีกครั้ง",
|
||||
"flyerRemoveLogo": "นำออก"
|
||||
}
|
||||
}
|
||||
@@ -293,7 +293,9 @@
|
||||
"earnFreeCredit": "Kumita ng 1 Libreng Credit",
|
||||
"showTestJobs": "Ipakita ang mga Test Job",
|
||||
"signOut": "Mag-sign Out",
|
||||
"login": "Mag-login"
|
||||
"login": "Mag-login",
|
||||
"discountActive": "aktibo ang discount",
|
||||
"discountActiveHint": "I-click para ipakita ang discount banner"
|
||||
}
|
||||
},
|
||||
"payment": {
|
||||
@@ -1302,6 +1304,50 @@
|
||||
"flyerThemeLight": "Light",
|
||||
"flyerThemeDark": "Dark",
|
||||
"flyerGenerate": "Gumawa ng Flyer",
|
||||
"flyerGenerating": "Ginagawa..."
|
||||
"flyerGenerating": "Ginagawa...",
|
||||
"appliedAtCheckout": "Awtomatikong ia-apply sa checkout",
|
||||
"expires": "Mag-e-expire sa {date}",
|
||||
"referredBy": "Ni-refer ni {name}",
|
||||
"usingCode": "Code: {code}",
|
||||
"connectBankLoading": "Inihahanda...",
|
||||
"connectDetailsNeeded": "Kailangan ng Stripe ng karagdagang impormasyon para paganahin ang mga payout. I-click ang \"I-update ang Bank Account\" sa ibaba para makumpleto ang setup.",
|
||||
"connectRefresh": "Mukhang hindi mo natapos i-set up ang iyong bank account. I-click sa ibaba para subukang muli.",
|
||||
"connectStatusActive": "Aktibo ang mga payout",
|
||||
"connectStatusPending": "Kasalukuyang sini-set up",
|
||||
"connectStripeNote": "Ire-redirect ka sa secure na site ng Stripe para ilagay ang mga detalye ng iyong bangko. Karaniwang tumatagal ito ng ilang minuto.",
|
||||
"flyerAccentColor": "Accent",
|
||||
"flyerBranding": "Branding",
|
||||
"flyerColors": "Mga Kulay",
|
||||
"flyerDownloadHtml": "I-download ang HTML",
|
||||
"flyerDownloadPdf": "I-download ang PDF",
|
||||
"flyerDownloadPng": "I-download ang PNG",
|
||||
"flyerEditQr": "I-edit ang Estilo ng QR",
|
||||
"flyerExporting": "Ini-export...",
|
||||
"flyerHeadlineGradient": "Gradient ng Headline",
|
||||
"flyerHeadlineSubColor": "Sub-color ng Headline",
|
||||
"flyerMargins": "Mga Margin ng Pahina",
|
||||
"flyerPerPage": "Mga Flyer Bawat Pahina",
|
||||
"flyerPresetCustom": "Custom",
|
||||
"flyerPresetName": "Pangalan ng preset",
|
||||
"flyerPresetSave": "I-save ang Preset",
|
||||
"flyerPrintLayout": "Layout ng Print",
|
||||
"flyerSections": "Mga Seksyon",
|
||||
"flyerSubtextColor": "Subtext",
|
||||
"flyerTextColor": "Teksto",
|
||||
"flyerTextOverrides": "Mga Text Override",
|
||||
"flyerToggleDivider": "Divider",
|
||||
"flyerToggleFeatures": "Mga Feature sa Ibaba",
|
||||
"flyerToggleSteps": "Mga Hakbang Kung Paano Ito Gumagana",
|
||||
"flyerToggleSubtitle": "Subtitle",
|
||||
"flyerToggleTagline": "Tagline sa Ibaba",
|
||||
"flyerUploadLogo": "I-upload ang Logo",
|
||||
"managePayouts": "Pamahalaan ang mga Payout",
|
||||
"payoutTitle": "Mga Payout at Bank Account",
|
||||
"tabFlyer": "Napi-print na Flyer",
|
||||
"tabQrCode": "QR Code",
|
||||
"toolsTitle": "QR Code at Flyer Generator",
|
||||
"updateBankAccount": "I-update ang Bank Account",
|
||||
"connectFailed": "May nangyaring mali. Pakisubukan muli.",
|
||||
"flyerRemoveLogo": "Alisin"
|
||||
}
|
||||
}
|
||||
@@ -293,7 +293,9 @@
|
||||
"earnFreeCredit": "1 Ücretsiz Kredi Kazan",
|
||||
"showTestJobs": "Test İşlerini Göster",
|
||||
"signOut": "Çıkış Yap",
|
||||
"login": "Giriş"
|
||||
"login": "Giriş",
|
||||
"discountActive": "indirim aktif",
|
||||
"discountActiveHint": "İndirim afişini göstermek için tıkla"
|
||||
}
|
||||
},
|
||||
"payment": {
|
||||
@@ -1302,6 +1304,50 @@
|
||||
"flyerThemeLight": "Açık",
|
||||
"flyerThemeDark": "Koyu",
|
||||
"flyerGenerate": "El İlanı Oluştur",
|
||||
"flyerGenerating": "Oluşturuluyor..."
|
||||
"flyerGenerating": "Oluşturuluyor...",
|
||||
"appliedAtCheckout": "Ödeme sırasında otomatik olarak uygulanır",
|
||||
"expires": "{date} tarihinde sona eriyor",
|
||||
"referredBy": "Öneren: {name}",
|
||||
"usingCode": "Kod: {code}",
|
||||
"connectBankLoading": "Ayarlanıyor...",
|
||||
"connectDetailsNeeded": "Stripe'ın ödemeleri etkinleştirmek için ek bilgilere ihtiyacı var. Kurulumu tamamlamak için aşağıdaki \"Banka Hesabını Güncelle\"ye tıkla.",
|
||||
"connectRefresh": "Görünüşe göre banka hesabının kurulumunu tamamlamadın. Tekrar denemek için aşağıya tıkla.",
|
||||
"connectStatusActive": "Ödemeler etkinleştirildi",
|
||||
"connectStatusPending": "Kurulum devam ediyor",
|
||||
"connectStripeNote": "Banka bilgilerini girmek için Stripe'ın güvenli sitesine yönlendirileceksin. Bu genellikle birkaç dakika sürer.",
|
||||
"flyerAccentColor": "Vurgu",
|
||||
"flyerBranding": "Markalama",
|
||||
"flyerColors": "Renkler",
|
||||
"flyerDownloadHtml": "HTML İndir",
|
||||
"flyerDownloadPdf": "PDF İndir",
|
||||
"flyerDownloadPng": "PNG İndir",
|
||||
"flyerEditQr": "QR Stilini Düzenle",
|
||||
"flyerExporting": "Dışa aktarılıyor...",
|
||||
"flyerHeadlineGradient": "Başlık Degradesi",
|
||||
"flyerHeadlineSubColor": "Alt Başlık",
|
||||
"flyerMargins": "Sayfa Kenar Boşlukları",
|
||||
"flyerPerPage": "Sayfa Başına El İlanı",
|
||||
"flyerPresetCustom": "Özel",
|
||||
"flyerPresetName": "Ön ayar adı",
|
||||
"flyerPresetSave": "Ön Ayarı Kaydet",
|
||||
"flyerPrintLayout": "Yazdırma Düzeni",
|
||||
"flyerSections": "Bölümler",
|
||||
"flyerSubtextColor": "Alt Metin",
|
||||
"flyerTextColor": "Metin",
|
||||
"flyerTextOverrides": "Metin Değişiklikleri",
|
||||
"flyerToggleDivider": "Ayırıcı",
|
||||
"flyerToggleFeatures": "Alt Özellikler",
|
||||
"flyerToggleSteps": "Nasıl Çalışır Adımları",
|
||||
"flyerToggleSubtitle": "Alt Başlık",
|
||||
"flyerToggleTagline": "Alt Slogan",
|
||||
"flyerUploadLogo": "Logo Yükle",
|
||||
"managePayouts": "Ödemeleri Yönet",
|
||||
"payoutTitle": "Ödemeler ve Banka Hesabı",
|
||||
"tabFlyer": "Yazdırılabilir El İlanı",
|
||||
"tabQrCode": "QR Kodu",
|
||||
"toolsTitle": "QR Kodu ve El İlanı Generator",
|
||||
"updateBankAccount": "Banka Hesabını Güncelle",
|
||||
"connectFailed": "Bir şeyler ters gitti. Lütfen tekrar dene.",
|
||||
"flyerRemoveLogo": "Kaldır"
|
||||
}
|
||||
}
|
||||
@@ -293,7 +293,9 @@
|
||||
"earnFreeCredit": "Отримати 1 безкоштовний кредит",
|
||||
"showTestJobs": "Показати тестові завдання",
|
||||
"signOut": "Вийти",
|
||||
"login": "Увійти"
|
||||
"login": "Увійти",
|
||||
"discountActive": "знижка активна",
|
||||
"discountActiveHint": "Натисни, щоб показати банер зі знижкою"
|
||||
}
|
||||
},
|
||||
"payment": {
|
||||
@@ -1302,6 +1304,50 @@
|
||||
"flyerThemeLight": "Світла",
|
||||
"flyerThemeDark": "Темна",
|
||||
"flyerGenerate": "Згенерувати флаєр",
|
||||
"flyerGenerating": "Генерація..."
|
||||
"flyerGenerating": "Генерація...",
|
||||
"appliedAtCheckout": "Застосовується автоматично під час оплати",
|
||||
"expires": "Діє до {date}",
|
||||
"referredBy": "За рекомендацією {name}",
|
||||
"usingCode": "Код: {code}",
|
||||
"connectBankLoading": "Налаштування...",
|
||||
"connectDetailsNeeded": "Для увімкнення виплат Stripe потрібна додаткова інформація. Натисни \"Оновити банківський рахунок\" нижче, щоб завершити налаштування.",
|
||||
"connectRefresh": "Схоже, налаштування банківського рахунку не завершено. Натисни нижче, щоб спробувати ще раз.",
|
||||
"connectStatusActive": "Виплати увімкнено",
|
||||
"connectStatusPending": "Налаштування в процесі",
|
||||
"connectStripeNote": "Тебе буде перенаправлено на безпечний сайт Stripe для введення банківських реквізитів. Зазвичай це займає кілька хвилин.",
|
||||
"flyerAccentColor": "Акцент",
|
||||
"flyerBranding": "Брендинг",
|
||||
"flyerColors": "Кольори",
|
||||
"flyerDownloadHtml": "Завантажити HTML",
|
||||
"flyerDownloadPdf": "Завантажити PDF",
|
||||
"flyerDownloadPng": "Завантажити PNG",
|
||||
"flyerEditQr": "Редагувати стиль QR",
|
||||
"flyerExporting": "Експорт...",
|
||||
"flyerHeadlineGradient": "Градієнт заголовка",
|
||||
"flyerHeadlineSubColor": "Підзаголовок",
|
||||
"flyerMargins": "Поля сторінки",
|
||||
"flyerPerPage": "Флаєрів на сторінку",
|
||||
"flyerPresetCustom": "Власний",
|
||||
"flyerPresetName": "Назва пресету",
|
||||
"flyerPresetSave": "Зберегти пресет",
|
||||
"flyerPrintLayout": "Макет для друку",
|
||||
"flyerSections": "Розділи",
|
||||
"flyerSubtextColor": "Додатковий текст",
|
||||
"flyerTextColor": "Текст",
|
||||
"flyerTextOverrides": "Заміна тексту",
|
||||
"flyerToggleDivider": "Розділювач",
|
||||
"flyerToggleFeatures": "Функції внизу",
|
||||
"flyerToggleSteps": "Кроки \"Як це працює\"",
|
||||
"flyerToggleSubtitle": "Підзаголовок",
|
||||
"flyerToggleTagline": "Нижній слоган",
|
||||
"flyerUploadLogo": "Завантажити логотип",
|
||||
"managePayouts": "Керування виплатами",
|
||||
"payoutTitle": "Виплати та банківський рахунок",
|
||||
"tabFlyer": "Флаєр для друку",
|
||||
"tabQrCode": "QR-код",
|
||||
"toolsTitle": "Generator QR-кодів та флаєрів",
|
||||
"updateBankAccount": "Оновити банківський рахунок",
|
||||
"connectFailed": "Щось пішло не так. Будь ласка, спробуй ще раз.",
|
||||
"flyerRemoveLogo": "Видалити"
|
||||
}
|
||||
}
|
||||
@@ -293,7 +293,9 @@
|
||||
"earnFreeCredit": "Kiếm 1 credit miễn phí",
|
||||
"showTestJobs": "Hiển thị công việc thử nghiệm",
|
||||
"signOut": "Đăng xuất",
|
||||
"login": "Đăng nhập"
|
||||
"login": "Đăng nhập",
|
||||
"discountActive": "đang áp dụng giảm giá",
|
||||
"discountActiveHint": "Nhấp để hiển thị banner giảm giá"
|
||||
}
|
||||
},
|
||||
"payment": {
|
||||
@@ -1302,6 +1304,50 @@
|
||||
"flyerThemeLight": "Sáng",
|
||||
"flyerThemeDark": "Tối",
|
||||
"flyerGenerate": "Tạo tờ rơi",
|
||||
"flyerGenerating": "Đang tạo..."
|
||||
"flyerGenerating": "Đang tạo...",
|
||||
"appliedAtCheckout": "Tự động áp dụng khi thanh toán",
|
||||
"expires": "Hết hạn {date}",
|
||||
"referredBy": "Được giới thiệu bởi {name}",
|
||||
"usingCode": "Mã: {code}",
|
||||
"connectBankLoading": "Đang thiết lập...",
|
||||
"connectDetailsNeeded": "Stripe cần thêm thông tin để bật tính năng nhận thanh toán. Nhấp vào \"Cập nhật tài khoản ngân hàng\" bên dưới để hoàn tất thiết lập.",
|
||||
"connectRefresh": "Có vẻ như bạn chưa hoàn tất việc thiết lập tài khoản ngân hàng của mình. Nhấp vào bên dưới để thử lại.",
|
||||
"connectStatusActive": "Đã bật nhận thanh toán",
|
||||
"connectStatusPending": "Đang thiết lập",
|
||||
"connectStripeNote": "Bạn sẽ được chuyển hướng đến trang web an toàn của Stripe để nhập thông tin ngân hàng của mình. Quá trình này thường mất vài phút.",
|
||||
"flyerAccentColor": "Màu nhấn",
|
||||
"flyerBranding": "Thương hiệu",
|
||||
"flyerColors": "Màu sắc",
|
||||
"flyerDownloadHtml": "Tải xuống HTML",
|
||||
"flyerDownloadPdf": "Tải xuống PDF",
|
||||
"flyerDownloadPng": "Tải xuống PNG",
|
||||
"flyerEditQr": "Chỉnh sửa kiểu QR",
|
||||
"flyerExporting": "Đang xuất...",
|
||||
"flyerHeadlineGradient": "Màu gradient tiêu đề",
|
||||
"flyerHeadlineSubColor": "Màu tiêu đề phụ",
|
||||
"flyerMargins": "Lề trang",
|
||||
"flyerPerPage": "Số tờ rơi mỗi trang",
|
||||
"flyerPresetCustom": "Tùy chỉnh",
|
||||
"flyerPresetName": "Tên thiết lập sẵn",
|
||||
"flyerPresetSave": "Lưu thiết lập sẵn",
|
||||
"flyerPrintLayout": "Bố cục in",
|
||||
"flyerSections": "Các phần",
|
||||
"flyerSubtextColor": "Văn bản phụ",
|
||||
"flyerTextColor": "Văn bản",
|
||||
"flyerTextOverrides": "Tùy chỉnh văn bản",
|
||||
"flyerToggleDivider": "Đường phân cách",
|
||||
"flyerToggleFeatures": "Tính năng bên dưới",
|
||||
"flyerToggleSteps": "Các bước thực hiện",
|
||||
"flyerToggleSubtitle": "Tiêu đề phụ",
|
||||
"flyerToggleTagline": "Khẩu hiệu bên dưới",
|
||||
"flyerUploadLogo": "Tải logo lên",
|
||||
"managePayouts": "Quản lý nhận thanh toán",
|
||||
"payoutTitle": "Nhận thanh toán & Tài khoản ngân hàng",
|
||||
"tabFlyer": "Tờ rơi để in",
|
||||
"tabQrCode": "Mã QR",
|
||||
"toolsTitle": "Generator Mã QR & Tờ rơi",
|
||||
"updateBankAccount": "Cập nhật tài khoản ngân hàng",
|
||||
"connectFailed": "Đã xảy ra lỗi. Vui lòng thử lại.",
|
||||
"flyerRemoveLogo": "Xóa"
|
||||
}
|
||||
}
|
||||
@@ -293,7 +293,9 @@
|
||||
"earnFreeCredit": "赚取 1 个免费积分",
|
||||
"showTestJobs": "显示测试任务",
|
||||
"signOut": "登出",
|
||||
"login": "登录"
|
||||
"login": "登录",
|
||||
"discountActive": "折扣已生效",
|
||||
"discountActiveHint": "点击显示折扣横幅"
|
||||
}
|
||||
},
|
||||
"payment": {
|
||||
@@ -1302,6 +1304,50 @@
|
||||
"flyerThemeLight": "浅色",
|
||||
"flyerThemeDark": "深色",
|
||||
"flyerGenerate": "生成传单",
|
||||
"flyerGenerating": "生成中..."
|
||||
"flyerGenerating": "生成中...",
|
||||
"appliedAtCheckout": "结账时自动应用",
|
||||
"expires": "有效期至 {date}",
|
||||
"referredBy": "由 {name} 推荐",
|
||||
"usingCode": "优惠码:{code}",
|
||||
"connectBankLoading": "设置中...",
|
||||
"connectDetailsNeeded": "Stripe 需要更多信息才能启用提现。请点击下方的“更新银行账户”以完成设置。",
|
||||
"connectRefresh": "看来您尚未完成银行账户的设置。请点击下方重试。",
|
||||
"connectStatusActive": "提现已启用",
|
||||
"connectStatusPending": "设置进行中",
|
||||
"connectStripeNote": "您将被重定向到 Stripe 的安全网站以输入您的银行信息。这通常需要几分钟时间。",
|
||||
"flyerAccentColor": "强调色",
|
||||
"flyerBranding": "品牌",
|
||||
"flyerColors": "颜色",
|
||||
"flyerDownloadHtml": "下载 HTML",
|
||||
"flyerDownloadPdf": "下载 PDF",
|
||||
"flyerDownloadPng": "下载 PNG",
|
||||
"flyerEditQr": "编辑二维码样式",
|
||||
"flyerExporting": "导出中...",
|
||||
"flyerHeadlineGradient": "标题渐变色",
|
||||
"flyerHeadlineSubColor": "副标题颜色",
|
||||
"flyerMargins": "页面边距",
|
||||
"flyerPerPage": "每页传单数",
|
||||
"flyerPresetCustom": "自定义",
|
||||
"flyerPresetName": "预设名称",
|
||||
"flyerPresetSave": "保存预设",
|
||||
"flyerPrintLayout": "打印布局",
|
||||
"flyerSections": "版块",
|
||||
"flyerSubtextColor": "次要文本",
|
||||
"flyerTextColor": "文本",
|
||||
"flyerTextOverrides": "自定义文本",
|
||||
"flyerToggleDivider": "分隔线",
|
||||
"flyerToggleFeatures": "底部功能",
|
||||
"flyerToggleSteps": "使用步骤",
|
||||
"flyerToggleSubtitle": "副标题",
|
||||
"flyerToggleTagline": "底部标语",
|
||||
"flyerUploadLogo": "上传 Logo",
|
||||
"managePayouts": "管理提现",
|
||||
"payoutTitle": "提现与银行账户",
|
||||
"tabFlyer": "可打印传单",
|
||||
"tabQrCode": "二维码",
|
||||
"toolsTitle": "二维码与传单 Generator",
|
||||
"updateBankAccount": "更新银行账户",
|
||||
"connectFailed": "出了点问题,请重试。",
|
||||
"flyerRemoveLogo": "移除"
|
||||
}
|
||||
}
|
||||
Generated
+216
-3
@@ -45,8 +45,10 @@
|
||||
"cmdk": "1.0.4",
|
||||
"date-fns": "4.1.0",
|
||||
"embla-carousel-react": "8.5.1",
|
||||
"html2canvas": "^1.4.1",
|
||||
"immer": "latest",
|
||||
"input-otp": "1.4.1",
|
||||
"jspdf": "^4.2.1",
|
||||
"lucide-react": "^0.454.0",
|
||||
"next": "16.0.7",
|
||||
"next-intl": "^4.9.0",
|
||||
@@ -571,9 +573,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/runtime": {
|
||||
"version": "7.28.4",
|
||||
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.4.tgz",
|
||||
"integrity": "sha512-Q/N6JNWvIvPnLDvjlE1OUBLPQHH6l3CltCEsHIujp45zQUSSh8K+gHnaEX45yAT1nyngnINhvWtzN+Nb9D8RAQ==",
|
||||
"version": "7.29.2",
|
||||
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.2.tgz",
|
||||
"integrity": "sha512-JiDShH45zKHWyGe4ZNVRrCjBz8Nh9TMmZG1kh4QTK8hCBTWBi8Da+i7s1fJw7/lYpM4ccepSNfqzZ/QvABBi5g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
@@ -4696,6 +4698,19 @@
|
||||
"undici-types": "~6.21.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/pako": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/pako/-/pako-2.0.4.tgz",
|
||||
"integrity": "sha512-VWDCbrLeVXJM9fihYodcLiIv0ku+AlOa/TQ1SvYOaBuyrSKgEcro95LJyIsJ4vSo6BXIxOKxiJAat04CmST9Fw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/raf": {
|
||||
"version": "3.4.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/raf/-/raf-3.4.3.tgz",
|
||||
"integrity": "sha512-c4YAvMedbPZ5tEyxzQdMoOhhJ4RD3rngZIdwC2/qDN3d7JpEhB6fiBRKVY1lg5B7Wk+uPBjn5f39j1/2MY1oOw==",
|
||||
"license": "MIT",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/@types/react": {
|
||||
"version": "19.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.7.tgz",
|
||||
@@ -4730,6 +4745,13 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/trusted-types": {
|
||||
"version": "2.0.7",
|
||||
"resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz",
|
||||
"integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==",
|
||||
"license": "MIT",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/@types/yargs": {
|
||||
"version": "17.0.35",
|
||||
"resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.35.tgz",
|
||||
@@ -5879,6 +5901,15 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/base64-arraybuffer": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz",
|
||||
"integrity": "sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6.0"
|
||||
}
|
||||
},
|
||||
"node_modules/baseline-browser-mapping": {
|
||||
"version": "2.9.4",
|
||||
"resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.9.4.tgz",
|
||||
@@ -6052,6 +6083,26 @@
|
||||
],
|
||||
"license": "CC-BY-4.0"
|
||||
},
|
||||
"node_modules/canvg": {
|
||||
"version": "3.0.11",
|
||||
"resolved": "https://registry.npmjs.org/canvg/-/canvg-3.0.11.tgz",
|
||||
"integrity": "sha512-5ON+q7jCTgMp9cjpu4Jo6XbvfYwSB2Ow3kzHKfIyJfaCAOHLbdKPQqGKgfED/R5B+3TFFfe8pegYA+b423SRyA==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.5",
|
||||
"@types/raf": "^3.4.0",
|
||||
"core-js": "^3.8.3",
|
||||
"raf": "^3.4.1",
|
||||
"regenerator-runtime": "^0.13.7",
|
||||
"rgbcolor": "^1.0.1",
|
||||
"stackblur-canvas": "^2.0.0",
|
||||
"svg-pathdata": "^6.0.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/chalk": {
|
||||
"version": "4.1.2",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
|
||||
@@ -6266,6 +6317,18 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/core-js": {
|
||||
"version": "3.49.0",
|
||||
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.49.0.tgz",
|
||||
"integrity": "sha512-es1U2+YTtzpwkxVLwAFdSpaIMyQaq0PBgm3YD1W3Qpsn1NAmO3KSgZfu+oGSWVu6NvLHoHCV/aYcsE5wiB7ALg==",
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/core-js"
|
||||
}
|
||||
},
|
||||
"node_modules/create-jest": {
|
||||
"version": "29.7.0",
|
||||
"resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz",
|
||||
@@ -6310,6 +6373,15 @@
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/css-line-break": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/css-line-break/-/css-line-break-2.1.0.tgz",
|
||||
"integrity": "sha512-FHcKFCZcAha3LwfVBhCQbW2nCNbkZXn7KVUJcsT5/P8YmfsVja0FMPJr0B903j/E69HUphKiV9iQArX8SDYA4w==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"utrie": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/css.escape": {
|
||||
"version": "1.5.1",
|
||||
"resolved": "https://registry.npmjs.org/css.escape/-/css.escape-1.5.1.tgz",
|
||||
@@ -6770,6 +6842,16 @@
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/dompurify": {
|
||||
"version": "3.3.3",
|
||||
"resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.3.3.tgz",
|
||||
"integrity": "sha512-Oj6pzI2+RqBfFG+qOaOLbFXLQ90ARpcGG6UePL82bJLtdsa6CYJD7nmiU8MW9nQNOtCHV3lZ/Bzq1X0QYbBZCA==",
|
||||
"license": "(MPL-2.0 OR Apache-2.0)",
|
||||
"optional": true,
|
||||
"optionalDependencies": {
|
||||
"@types/trusted-types": "^2.0.7"
|
||||
}
|
||||
},
|
||||
"node_modules/dunder-proto": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
|
||||
@@ -7718,6 +7800,17 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/fast-png": {
|
||||
"version": "6.4.0",
|
||||
"resolved": "https://registry.npmjs.org/fast-png/-/fast-png-6.4.0.tgz",
|
||||
"integrity": "sha512-kAqZq1TlgBjZcLr5mcN6NP5Rv4V2f22z00c3g8vRrwkcqjerx7BEhPbOnWCPqaHUl2XWQBJQvOT/FQhdMT7X/Q==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/pako": "^2.0.3",
|
||||
"iobuffer": "^5.3.2",
|
||||
"pako": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/fastq": {
|
||||
"version": "1.20.1",
|
||||
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.1.tgz",
|
||||
@@ -7738,6 +7831,12 @@
|
||||
"bser": "2.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/fflate": {
|
||||
"version": "0.8.2",
|
||||
"resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz",
|
||||
"integrity": "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/file-entry-cache": {
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz",
|
||||
@@ -8239,6 +8338,19 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/html2canvas": {
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/html2canvas/-/html2canvas-1.4.1.tgz",
|
||||
"integrity": "sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"css-line-break": "^2.1.0",
|
||||
"text-segmentation": "^1.0.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/http-proxy-agent": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz",
|
||||
@@ -8457,6 +8569,12 @@
|
||||
"@formatjs/icu-messageformat-parser": "3.5.3"
|
||||
}
|
||||
},
|
||||
"node_modules/iobuffer": {
|
||||
"version": "5.4.0",
|
||||
"resolved": "https://registry.npmjs.org/iobuffer/-/iobuffer-5.4.0.tgz",
|
||||
"integrity": "sha512-DRebOWuqDvxunfkNJAlc3IzWIPD5xVxwUNbHr7xKB8E6aLJxIPfNX3CoMJghcFjpv6RWQsrcJbghtEwSPoJqMA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/is-array-buffer": {
|
||||
"version": "3.0.5",
|
||||
"resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz",
|
||||
@@ -10000,6 +10118,23 @@
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/jspdf": {
|
||||
"version": "4.2.1",
|
||||
"resolved": "https://registry.npmjs.org/jspdf/-/jspdf-4.2.1.tgz",
|
||||
"integrity": "sha512-YyAXyvnmjTbR4bHQRLzex3CuINCDlQnBqoSYyjJwTP2x9jDLuKDzy7aKUl0hgx3uhcl7xzg32agn5vlie6HIlQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.28.6",
|
||||
"fast-png": "^6.2.0",
|
||||
"fflate": "^0.8.1"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"canvg": "^3.0.11",
|
||||
"core-js": "^3.6.0",
|
||||
"dompurify": "^3.3.1",
|
||||
"html2canvas": "^1.0.0-rc.5"
|
||||
}
|
||||
},
|
||||
"node_modules/jsx-ast-utils": {
|
||||
"version": "3.3.5",
|
||||
"resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz",
|
||||
@@ -11096,6 +11231,12 @@
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/pako": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz",
|
||||
"integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==",
|
||||
"license": "(MIT AND Zlib)"
|
||||
},
|
||||
"node_modules/parent-module": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
|
||||
@@ -11178,6 +11319,13 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/performance-now": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
|
||||
"integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==",
|
||||
"license": "MIT",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/picocolors": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
|
||||
@@ -11476,6 +11624,16 @@
|
||||
],
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/raf": {
|
||||
"version": "3.4.1",
|
||||
"resolved": "https://registry.npmjs.org/raf/-/raf-3.4.1.tgz",
|
||||
"integrity": "sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"performance-now": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/react": {
|
||||
"version": "19.2.0",
|
||||
"resolved": "https://registry.npmjs.org/react/-/react-19.2.0.tgz",
|
||||
@@ -11719,6 +11877,13 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/regenerator-runtime": {
|
||||
"version": "0.13.11",
|
||||
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz",
|
||||
"integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==",
|
||||
"license": "MIT",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/regexp.prototype.flags": {
|
||||
"version": "1.5.4",
|
||||
"resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz",
|
||||
@@ -11832,6 +11997,16 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/rgbcolor": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/rgbcolor/-/rgbcolor-1.0.1.tgz",
|
||||
"integrity": "sha512-9aZLIrhRaD97sgVhtJOW6ckOEh6/GnvQtdVNfdZ6s67+3/XwLS9lBcQYzEEhYVeUowN7pRzMLsyGhK2i/xvWbw==",
|
||||
"license": "MIT OR SEE LICENSE IN FEEL-FREE.md",
|
||||
"optional": true,
|
||||
"engines": {
|
||||
"node": ">= 0.8.15"
|
||||
}
|
||||
},
|
||||
"node_modules/run-parallel": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
|
||||
@@ -12257,6 +12432,16 @@
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/stackblur-canvas": {
|
||||
"version": "2.7.0",
|
||||
"resolved": "https://registry.npmjs.org/stackblur-canvas/-/stackblur-canvas-2.7.0.tgz",
|
||||
"integrity": "sha512-yf7OENo23AGJhBriGx0QivY5JP6Y1HbrrDI6WLt6C5auYZXlQrheoY8hD4ibekFKz1HOfE48Ww8kMWMnJD/zcQ==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"engines": {
|
||||
"node": ">=0.1.14"
|
||||
}
|
||||
},
|
||||
"node_modules/stop-iteration-iterator": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz",
|
||||
@@ -12521,6 +12706,16 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/svg-pathdata": {
|
||||
"version": "6.0.3",
|
||||
"resolved": "https://registry.npmjs.org/svg-pathdata/-/svg-pathdata-6.0.3.tgz",
|
||||
"integrity": "sha512-qsjeeq5YjBZ5eMdFuUa4ZosMLxgr5RZ+F+Y1OrDhuOCEInRMA3x74XdBtggJcj9kOeInz0WE+LgCPDkZFlBYJw==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"engines": {
|
||||
"node": ">=12.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/symbol-tree": {
|
||||
"version": "3.2.4",
|
||||
"resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz",
|
||||
@@ -12582,6 +12777,15 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/text-segmentation": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/text-segmentation/-/text-segmentation-1.0.3.tgz",
|
||||
"integrity": "sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"utrie": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/tiny-invariant": {
|
||||
"version": "1.3.3",
|
||||
"resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz",
|
||||
@@ -13127,6 +13331,15 @@
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/utrie": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/utrie/-/utrie-1.0.2.tgz",
|
||||
"integrity": "sha512-1MLa5ouZiOmQzUbjbu9VmjLzn1QLXBhwpUa7kdLUQK+KQ5KA9I1vk5U4YHe/X2Ch7PYnJfWuWT+VbuxbGwljhw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"base64-arraybuffer": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/v8-compile-cache-lib": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz",
|
||||
|
||||
@@ -67,8 +67,10 @@
|
||||
"cmdk": "1.0.4",
|
||||
"date-fns": "4.1.0",
|
||||
"embla-carousel-react": "8.5.1",
|
||||
"html2canvas": "^1.4.1",
|
||||
"immer": "latest",
|
||||
"input-otp": "1.4.1",
|
||||
"jspdf": "^4.2.1",
|
||||
"lucide-react": "^0.454.0",
|
||||
"next": "16.0.7",
|
||||
"next-intl": "^4.9.0",
|
||||
|
||||
@@ -361,6 +361,12 @@ async def translate_locale(
|
||||
delta_keys = None
|
||||
existing_data = None
|
||||
|
||||
# Load existing translation if it exists
|
||||
locale_path = messages_dir / f"{target_locale}.json"
|
||||
if locale_path.exists():
|
||||
with open(locale_path) as f:
|
||||
existing_data = json.load(f)
|
||||
|
||||
if not full_mode and snapshot_data is not None:
|
||||
delta_keys = compute_changed_keys(english_data, snapshot_data)
|
||||
if not delta_keys:
|
||||
@@ -368,18 +374,26 @@ async def translate_locale(
|
||||
print(f"[{target_locale}] No changes detected, skipping. ({len(completed)}/{total})")
|
||||
return True
|
||||
|
||||
# Load existing translation if it exists
|
||||
locale_path = messages_dir / f"{target_locale}.json"
|
||||
if locale_path.exists():
|
||||
with open(locale_path) as f:
|
||||
existing_data = json.load(f)
|
||||
|
||||
if existing_data is not None:
|
||||
# Extract only changed keys from English
|
||||
subset = extract_subset(english_data, delta_keys)
|
||||
json_to_translate = json.dumps(subset, ensure_ascii=False, indent=2)
|
||||
print(f"[{target_locale}] Delta mode: {len(delta_keys)} changed keys (of {count_keys(english_data)} total)")
|
||||
else:
|
||||
print(f"[{target_locale}] No existing translation, doing full translation")
|
||||
elif not full_mode and existing_data is not None:
|
||||
# No snapshot but existing locale file — compute missing keys
|
||||
en_flat = flatten_keys(english_data)
|
||||
existing_flat = flatten_keys(existing_data)
|
||||
missing_keys = set(en_flat.keys()) - set(existing_flat.keys())
|
||||
if not missing_keys:
|
||||
completed.append(target_locale)
|
||||
print(f"[{target_locale}] All {len(en_flat)} keys present, skipping. ({len(completed)}/{total})")
|
||||
return True
|
||||
delta_keys = missing_keys
|
||||
subset = extract_subset(english_data, delta_keys)
|
||||
json_to_translate = json.dumps(subset, ensure_ascii=False, indent=2)
|
||||
print(f"[{target_locale}] Missing keys mode: {len(delta_keys)} missing keys (of {count_keys(english_data)} total)")
|
||||
|
||||
# --- Cache lookup ---
|
||||
cached_translations: dict[str, str] = {} # dot_key -> translated string
|
||||
@@ -560,7 +574,7 @@ async def async_main(args):
|
||||
snapshot_data = json.load(f)
|
||||
print(f"Loaded snapshot for delta comparison ({count_keys(snapshot_data)} keys)")
|
||||
elif not args.full:
|
||||
print("No snapshot found — will do full translation (use --full to force)")
|
||||
print("No snapshot found — will use missing-keys mode (use --full to force full retranslation)")
|
||||
|
||||
# Initialize Vertex AI client
|
||||
client = genai.Client(
|
||||
@@ -577,7 +591,12 @@ async def async_main(args):
|
||||
print(f"Using model: {MODEL}")
|
||||
print(f"Project: {PROJECT}, Location: {LOCATION}")
|
||||
print(f"Locales: {', '.join(locales)} ({len(locales)} total)")
|
||||
print(f"Mode: {'full' if args.full or snapshot_data is None else 'incremental (delta)'}")
|
||||
if args.full:
|
||||
print("Mode: full (forced)")
|
||||
elif snapshot_data is not None:
|
||||
print("Mode: incremental (delta from snapshot)")
|
||||
else:
|
||||
print("Mode: incremental (missing keys — no snapshot)")
|
||||
print(f"Review: {'skip' if args.skip_review else 'enabled'}")
|
||||
print(f"Cache: {'disabled' if args.no_cache else 'enabled'} (bucket: {args.cache_bucket})")
|
||||
if args.dry_run:
|
||||
@@ -598,7 +617,7 @@ async def async_main(args):
|
||||
messages_dir=args.messages_dir,
|
||||
glossary=glossary,
|
||||
skip_review=args.skip_review,
|
||||
full_mode=args.full or snapshot_data is None,
|
||||
full_mode=args.full,
|
||||
snapshot_data=snapshot_data,
|
||||
completed=completed,
|
||||
total=total,
|
||||
@@ -614,8 +633,10 @@ async def async_main(args):
|
||||
succeeded = sum(1 for r in results if r is True)
|
||||
failed = sum(1 for r in results if r is not True)
|
||||
|
||||
# Only save snapshot if all translations succeeded
|
||||
if failed == 0:
|
||||
# Only save snapshot if all translations succeeded and we actually translated
|
||||
if args.dry_run:
|
||||
print(f"\nSnapshot NOT saved (dry run)")
|
||||
elif failed == 0:
|
||||
with open(snapshot_path, "w", encoding="utf-8") as f:
|
||||
json.dump(english_data, f, ensure_ascii=False, indent=2)
|
||||
f.write("\n")
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "karaoke-gen"
|
||||
version = "0.166.1"
|
||||
version = "0.167.0"
|
||||
description = "Generate karaoke videos with synchronized lyrics. Handles the entire process from downloading audio and lyrics to creating the final video with title screens."
|
||||
authors = ["Andrew Beveridge <andrew@beveridge.uk>"]
|
||||
license = "MIT"
|
||||
|
||||
Reference in new issue
Block a user