From d9dc7b1f302499a015c8f5c87da06db2af7b5bf8 Mon Sep 17 00:00:00 2001 From: rogutkuba Date: Mon, 28 Jul 2025 23:25:55 -0400 Subject: [PATCH 1/2] ui fixes --- .../src/services/billing/Billing.service.ts | 16 +++---- apps/web/src/components/auth/RegisterView.tsx | 12 ++--- apps/web/src/components/auth/SignInView.tsx | 6 +-- .../room/whiteboard/WhiteboardView.tsx | 5 +- .../room/whiteboard/getBookmarkPreview.ts | 5 +- .../components/settings/BillingPlanCard.tsx | 48 +++++++++---------- .../src/components/settings/BillingView.tsx | 14 ++---- apps/web/src/contexts/RoomContext.tsx | 5 +- apps/web/src/query/client.ts | 6 ++- apps/web/src/query/realtime/notes.query.ts | 5 +- apps/web/src/query/room.query.ts | 6 --- 11 files changed, 63 insertions(+), 65 deletions(-) diff --git a/apps/api/src/services/billing/Billing.service.ts b/apps/api/src/services/billing/Billing.service.ts index c4f8dd8..1170382 100644 --- a/apps/api/src/services/billing/Billing.service.ts +++ b/apps/api/src/services/billing/Billing.service.ts @@ -129,7 +129,7 @@ export class BillingService { async getPlans(): Promise< { - group: 'free' | 'starter' | 'pro' | 'scale'; + group: 'free' | 'starter' | 'scale'; monthly: PlanEntity | null; yearly: PlanEntity | null; }[] @@ -145,28 +145,28 @@ export class BillingService { // below needs to be refactored, just easy way for frontend without custom plans const newMap = new Map< - 'free' | 'starter' | 'pro' | 'scale', + 'free' | 'starter' | 'scale', { - group: 'free' | 'starter' | 'pro' | 'scale'; + group: 'free' | 'starter' | 'scale'; monthly: PlanEntity | null; yearly: PlanEntity | null; } >(); allPlans.forEach((plan) => { - const cur = newMap.get(plan.group as 'free' | 'starter' | 'pro' | 'scale') || { + const cur = newMap.get(plan.group as 'free' | 'starter' | 'scale') || { monthly: null, yearly: null, }; if (plan.interval === 'monthly') { - newMap.set(plan.group as 'free' | 'starter' | 'pro' | 'scale', { - group: plan.group as 'free' | 'starter' | 'pro' | 'scale', + newMap.set(plan.group as 'free' | 'starter' | 'scale', { + group: plan.group as 'free' | 'starter' | 'scale', monthly: plan, yearly: cur.yearly, }); } else { - newMap.set(plan.group as 'free' | 'starter' | 'pro' | 'scale', { - group: plan.group as 'free' | 'starter' | 'pro' | 'scale', + newMap.set(plan.group as 'free' | 'starter' | 'scale', { + group: plan.group as 'free' | 'starter' | 'scale', monthly: cur.monthly, yearly: plan, }); diff --git a/apps/web/src/components/auth/RegisterView.tsx b/apps/web/src/components/auth/RegisterView.tsx index 15f7a2e..2033828 100644 --- a/apps/web/src/components/auth/RegisterView.tsx +++ b/apps/web/src/components/auth/RegisterView.tsx @@ -1,10 +1,4 @@ -import { - RiArrowRightLine, - RiGithubFill, - RiGoogleFill, - RiMailCheckLine, - RiUserLine, -} from '@remixicon/react'; +import { RiArrowRightLine, RiGithubFill, RiGoogleFill, RiMailCheckLine } from '@remixicon/react'; import { Link, useSearch } from '@tanstack/react-router'; import { useState } from 'react'; import { Button } from '@/components/ui/button'; @@ -83,8 +77,8 @@ export const RegisterView = () => {
-
- +
+ logo
Create account

Sign up to get started with your account

diff --git a/apps/web/src/components/auth/SignInView.tsx b/apps/web/src/components/auth/SignInView.tsx index f36f05f..06edf99 100644 --- a/apps/web/src/components/auth/SignInView.tsx +++ b/apps/web/src/components/auth/SignInView.tsx @@ -1,4 +1,4 @@ -import { RiArrowRightLine, RiGithubFill, RiGoogleFill, RiMailLine } from '@remixicon/react'; +import { RiArrowRightLine, RiGithubFill, RiGoogleFill } from '@remixicon/react'; import { Link, useNavigate, useSearch } from '@tanstack/react-router'; import { useState } from 'react'; import { Button } from '@/components/ui/button'; @@ -37,8 +37,8 @@ export const SignInView = () => {
-
- +
+ logo
Welcome back

Sign in to your account to continue

diff --git a/apps/web/src/components/room/whiteboard/WhiteboardView.tsx b/apps/web/src/components/room/whiteboard/WhiteboardView.tsx index fdeaced..0569add 100644 --- a/apps/web/src/components/room/whiteboard/WhiteboardView.tsx +++ b/apps/web/src/components/room/whiteboard/WhiteboardView.tsx @@ -9,7 +9,10 @@ import { getBookmarkPreview } from './getBookmarkPreview'; import 'tldraw/tldraw.css'; // Configure the worker URL - this should match your API endpoint -const API_URL = import.meta.env.VITE_API_URL || 'http://localhost:8000'; +const API_URL = import.meta.env.VITE_API_URL; +if (!API_URL) { + throw new Error('VITE_API_URL is not set'); +} export const WhiteboardView = () => { const roomId = useCurrentRoomId(); diff --git a/apps/web/src/components/room/whiteboard/getBookmarkPreview.ts b/apps/web/src/components/room/whiteboard/getBookmarkPreview.ts index 84863a8..0e73670 100644 --- a/apps/web/src/components/room/whiteboard/getBookmarkPreview.ts +++ b/apps/web/src/components/room/whiteboard/getBookmarkPreview.ts @@ -7,7 +7,10 @@ interface UnfurlResponse { title?: string; } -const API_URL = import.meta.env.VITE_API_URL || 'http://localhost:8000'; +const API_URL = import.meta.env.VITE_API_URL; +if (!API_URL) { + throw new Error('VITE_API_URL is not set'); +} // How does our server handle bookmark unfurling? export async function getBookmarkPreview({ diff --git a/apps/web/src/components/settings/BillingPlanCard.tsx b/apps/web/src/components/settings/BillingPlanCard.tsx index fa1be37..f56d1d1 100644 --- a/apps/web/src/components/settings/BillingPlanCard.tsx +++ b/apps/web/src/components/settings/BillingPlanCard.tsx @@ -8,6 +8,7 @@ import { RiHistoryLine, RiLockPasswordLine, RiPaletteLine, + RiStarLine, RiSwap2Line, RiTeamLine, RiTerminalWindowFill, @@ -45,34 +46,24 @@ const LIMIT_MAP = { } >; +// Feature mapping for each plan const PLAN_FEATURE_MAP: Record< - 'free' | 'starter' | 'pro' | 'scale' | 'enterprise', + 'free' | 'starter' | 'scale' | 'enterprise', Array<{ icon: RemixiconComponentType; label: string; subText?: string; }> > = { - free: [], - starter: [ + free: [ { icon: RiHistoryLine, label: 'Interview Playback', subText: `Replay interviews to review every step of a candidate's coding process`, }, - { - icon: RiGlobalLine, - label: 'Advanced Interviews', - subText: 'Multi-file & framework support. (React, Next.js, etc.)', - }, - { - icon: RiBaseStationLine, - label: 'API Access', - subText: 'Access to our API for custom integrations', - }, - { icon: RiCustomerServiceLine, label: 'Basic Support' }, + { icon: RiCustomerServiceLine, label: 'Community Support' }, ], - pro: [ + starter: [ { icon: RiHistoryLine, label: 'Interview Playback', @@ -88,7 +79,10 @@ const PLAN_FEATURE_MAP: Record< label: 'API Access', subText: 'Access to our API for custom integrations', }, - { icon: RiCustomerServiceLine, label: 'Priority Support' }, + { + icon: RiCustomerServiceLine, + label: 'Basic Support', + }, ], scale: [ { @@ -149,7 +143,7 @@ const PLAN_FEATURE_MAP: Record< }, { icon: RiLockPasswordLine, - label: 'SSO Login', + label: 'Single Sign-On (SSO)', }, { icon: RiCustomerServiceLine, @@ -169,7 +163,7 @@ export const BillingPlanCard = ({ isCreatingCheckout = false, isLoading = false, }: { - group: 'free' | 'starter' | 'pro' | 'scale' | 'enterprise'; + group: 'free' | 'starter' | 'scale' | 'enterprise'; monthly: PlanSchema | null; yearly: PlanSchema | null; mode: PlanSchema['interval']; @@ -213,7 +207,7 @@ export const BillingPlanCard = ({ const isCurrentPlan = currentPlanId === plan?.id; // If no plan is available or is free plan, don't render anything - if (!plan || plan.price === 0) { + if (!plan) { return null; } @@ -222,12 +216,15 @@ export const BillingPlanCard = ({ key={plan.id} className={cx( 'relative transition-all duration-200 flex flex-col', - isPopular ? 'ring-2 ring-primary shadow-lg' : '', - isCurrentPlan ? 'ring-1 ring-green-300 bg-green-50/50 border-green-100' : '' + isPopular ? 'ring-2 ring-primary shadow-lg' : '' + // isCurrentPlan ? 'bg-green-500/10 border-green-500/20' : '' )} > {isPopular && ( - Most Popular + + + Most Popular + )} @@ -245,7 +242,7 @@ export const BillingPlanCard = ({ {plan.price > 0 && plan.name !== 'Enterprise' ? ( <> - per {plan.interval} + per {plan.interval === 'monthly' ? 'month' : 'year'} {isYearly && ( @@ -257,7 +254,10 @@ export const BillingPlanCard = ({