Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
c17ab58
new domain flow
ameer2468 Aug 6, 2025
8fe6ef4
Merge branch 'main' into new-domain-flow
ameer2468 Aug 6, 2025
b4d05c6
cleanup
ameer2468 Aug 6, 2025
c0e759c
logging
ameer2468 Aug 6, 2025
b2717cf
cname
ameer2468 Aug 6, 2025
17b059b
Update VerifyStep.tsx
ameer2468 Aug 6, 2025
6f4d412
Update CustomDomainDialog.tsx
ameer2468 Aug 6, 2025
221753c
update data
ameer2468 Aug 6, 2025
51db236
Update VerifyStep.tsx
ameer2468 Aug 6, 2025
660de0f
remove some code
ameer2468 Aug 6, 2025
6d80d17
run some testing
ameer2468 Aug 6, 2025
3770480
Merge branch 'main' into new-domain-flow
ameer2468 Aug 7, 2025
040c95e
update ui
ameer2468 Aug 7, 2025
605a1d1
update UI to show recommended values
ameer2468 Aug 7, 2025
7de6bbc
one table
ameer2468 Aug 7, 2025
76e7266
Update VerifyStep.tsx
ameer2468 Aug 7, 2025
68a8885
update ui
ameer2468 Aug 7, 2025
2468d9d
Update VerifyStep.tsx
ameer2468 Aug 7, 2025
204e926
run more tests
ameer2468 Aug 7, 2025
e2c2b1e
auto close dialog if success
ameer2468 Aug 7, 2025
f2b37b8
conditional rendering of domain
ameer2468 Aug 7, 2025
9df26c8
remove domain if already set
ameer2468 Aug 7, 2025
74fb503
loading state
ameer2468 Aug 7, 2025
a212885
Update CustomDomainDialog.tsx
ameer2468 Aug 7, 2025
99a2c8e
loading
ameer2468 Aug 7, 2025
cee5100
Update CustomDomainDialog.tsx
ameer2468 Aug 7, 2025
9ee1b21
visual tweaks
ameer2468 Aug 7, 2025
6a5b2ee
Update CapSettingsCard.tsx
ameer2468 Aug 7, 2025
052a9d4
remove state
ameer2468 Aug 7, 2025
288d583
Merge branch 'main' into new-domain-flow
ameer2468 Aug 7, 2025
304f3a7
wip
ameer2468 Aug 7, 2025
af026d3
Merge branch 'main' into new-domain-flow
ameer2468 Aug 8, 2025
0957d2e
confetti
ameer2468 Aug 8, 2025
66622ff
more time before closing
ameer2468 Aug 8, 2025
5bc34ab
cleanup
ameer2468 Aug 8, 2025
015cc64
visual tweaks
ameer2468 Aug 8, 2025
e776e19
Update CustomDomainDialog.tsx
ameer2468 Aug 8, 2025
2ed6698
proper loading state
ameer2468 Aug 8, 2025
bd92745
Update VerifyStep.tsx
ameer2468 Aug 8, 2025
230a0e6
Update CustomDomainDialog.tsx
ameer2468 Aug 8, 2025
60e3d6f
cleanup imports
ameer2468 Aug 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion apps/web/actions/organization/update-domain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ export async function updateDomain(domain: string, organizationId: string) {
throw new Error("Unauthorized");
}

//check user subscription to prevent abuse
const isSubscribed = user.stripeSubscriptionStatus === "active";

if (!isSubscribed) {
throw new Error("User is not subscribed");
}

const [organization] = await db()
.select()
.from(organizations)
Expand Down Expand Up @@ -67,6 +74,5 @@ export async function updateDomain(domain: string, organizationId: string) {
if (error instanceof Error) {
throw new Error(error.message);
}
throw new Error("Failed to update domain");
}
}
107 changes: 107 additions & 0 deletions apps/web/app/(org)/dashboard/_components/Confetti.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
"use client";

import type {
GlobalOptions as ConfettiGlobalOptions,
CreateTypes as ConfettiInstance,
Options as ConfettiOptions,
} from "canvas-confetti";
import confetti from "canvas-confetti";
import type { ReactNode } from "react";
import React, {
createContext,
forwardRef,
useCallback,
useEffect,
useImperativeHandle,
useMemo,
useRef,
} from "react";

type Api = {
fire: (options?: ConfettiOptions) => void;
};

type Props = React.ComponentPropsWithRef<"canvas"> & {
options?: ConfettiOptions;
globalOptions?: ConfettiGlobalOptions;
manualstart?: boolean;
children?: ReactNode;
};

export type ConfettiRef = Api | null;

const ConfettiContext = createContext<Api>({} as Api);

// Define component first
const ConfettiComponent = forwardRef<ConfettiRef, Props>((props, ref) => {
const {
options,
globalOptions = { resize: true, useWorker: true },
manualstart = false,
children,
...rest
} = props;
const instanceRef = useRef<ConfettiInstance | null>(null);

const canvasRef = useCallback(
(node: HTMLCanvasElement) => {
if (node !== null) {
if (instanceRef.current) return;
instanceRef.current = confetti.create(node, {
...globalOptions,
resize: true,
});
} else {
if (instanceRef.current) {
instanceRef.current.reset();
instanceRef.current = null;
}
}
},
[globalOptions],
);

const fire = useCallback(
async (opts = {}) => {
try {
await instanceRef.current?.({ ...options, ...opts });
} catch (error) {
console.error("Confetti error:", error);
}
},
[options],
);

const api = useMemo(
() => ({
fire,
}),
[fire],
);

useImperativeHandle(ref, () => api, [api]);

useEffect(() => {
if (!manualstart) {
(async () => {
try {
await fire();
} catch (error) {
console.error("Confetti effect error:", error);
}
})();
}
}, [manualstart, fire]);

return (
<ConfettiContext.Provider value={api}>
<canvas ref={canvasRef} {...rest} />
{children}
</ConfettiContext.Provider>
);
});

ConfettiComponent.displayName = "Confetti";

export const Confetti = ConfettiComponent;

Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const NotificationsSkeleton = ({ count = 5 }: { count?: number }) => {
{Array.from({ length: count }).map((_, i) => (
<NotificationItemSkeleton
key={i}
className={clsx(i !== count - 1 && "border-b")}
className={clsx(i !== count - 1 && "border-b border-gray-3")}
/>
))}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const NotificationTabSettings = [
{
label: "Setting 6",
description: "Set the default random settings",
}
},
]


Expand Down
Loading
Loading