Skip to content

Commit a0c9e13

Browse files
committed
clean up
1 parent d0a5714 commit a0c9e13

File tree

9 files changed

+19
-16
lines changed

9 files changed

+19
-16
lines changed

apps/web/client/public/onlook-preload-script.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/web/client/src/app/auth/callback/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export async function GET(request: Request) {
1212
const supabase = await createClient();
1313
const { error, data } = await supabase.auth.exchangeCodeForSession(code);
1414
if (!error) {
15-
const forwardedHost = request.headers.get('x-forwarded-host'); // original origin before load balancer
1615
const user = await api.user.upsert({
1716
id: data.user.id,
1817
});
@@ -35,6 +34,7 @@ export async function GET(request: Request) {
3534
}
3635
});
3736

37+
const forwardedHost = request.headers.get('x-forwarded-host');
3838
// Redirect to the redirect page which will handle the return URL
3939
if (forwardedHost) {
4040
const forwardedProto = request.headers.get('x-forwarded-proto') || 'https';

apps/web/client/src/app/invitation/[id]/_components/main.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
'use client';
22

33
import { api } from '@/trpc/react';
4-
import { LocalForageKeys, Routes } from '@/utils/constants';
4+
import { Routes } from '@/utils/constants';
55
import { createClient } from '@/utils/supabase/client';
6+
import { getReturnUrlQueryParam } from '@/utils/url';
67
import { Button } from '@onlook/ui/button';
78
import { Icons } from '@onlook/ui/icons';
89
import { Skeleton } from '@onlook/ui/skeleton';
@@ -32,7 +33,7 @@ export function Main({ invitationId }: { invitationId: string }) {
3233
const supabase = createClient();
3334
await supabase.auth.signOut();
3435
const currentUrl = `${pathname}${searchParams.toString() ? `?${searchParams.toString()}` : ''}`;
35-
router.push(`${Routes.LOGIN}?${LocalForageKeys.RETURN_URL}=${currentUrl}`);
36+
router.push(`${Routes.LOGIN}?${getReturnUrlQueryParam(currentUrl)}`);
3637
}
3738

3839
const error = getInvitationError || acceptInvitationError;

apps/web/client/src/app/project/[id]/_components/left-panel/help-dropdown/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useStateManager } from '@/components/store/state';
22
import { transKeys } from '@/i18n/keys';
3-
import { Links } from '@onlook/constants';
3+
import { Links, SUPPORT_EMAIL } from '@onlook/constants';
44
import {
55
DropdownMenu,
66
DropdownMenuContent,
@@ -128,7 +128,7 @@ export const HelpDropdown = observer(() => {
128128
{t(transKeys.help.menu.contactUs.github)}
129129
</DropdownMenuItem>
130130
<DropdownMenuItem
131-
onClick={() => window.open('mailto:[email protected]', '_blank')}
131+
onClick={() => window.open(`mailto:${SUPPORT_EMAIL}`, '_blank')}
132132
>
133133
<Icons.EnvelopeClosed className="w-4 h-4 mr-2" />
134134
{t(transKeys.help.menu.contactUs.email)}

apps/web/client/src/app/project/[id]/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { api } from "@/trpc/server";
22
import { Routes } from "@/utils/constants";
3+
import { SUPPORT_EMAIL } from "@onlook/constants";
34
import { Icons } from "@onlook/ui/icons/index";
45
import Link from "next/link";
56

@@ -13,7 +14,6 @@ export default async function Layout({ params, children }: Readonly<{ params: Pr
1314
}
1415

1516
const NoAccess = () => {
16-
const SUPPORT_EMAIL = '[email protected]';
1717
return (
1818
<main className="flex flex-1 flex-col items-center justify-center h-screen w-screen p-4 text-center">
1919
<div className="space-y-6">

apps/web/client/src/components/store/editor/version/git.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { prepareCommitMessage, sanitizeCommitMessage } from '@/utils/git';
22
import { type GitCommit } from '@onlook/git';
33
import stripAnsi from 'strip-ansi';
44
import type { EditorEngine } from '../engine';
5+
import { SUPPORT_EMAIL } from '@onlook/constants';
56

67
export const ONLOOK_DISPLAY_NAME_NOTE_REF = 'refs/notes/onlook-display-name';
78

@@ -16,7 +17,7 @@ export interface GitCommandResult {
1617
}
1718

1819
export class GitManager {
19-
constructor(private editorEngine: EditorEngine) {}
20+
constructor(private editorEngine: EditorEngine) { }
2021

2122
/**
2223
* Check if git repository is initialized
@@ -63,7 +64,7 @@ export class GitManager {
6364
// Set user.email if not configured
6465
if (!hasEmail) {
6566
const emailConfigResult = await this.runCommand(
66-
'git config user.email "[email protected]"',
67+
`git config user.email "${SUPPORT_EMAIL}"`,
6768
);
6869
if (!emailConfigResult.success) {
6970
console.error('Failed to set git user.email:', emailConfigResult.error);

packages/constants/src/contact.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const SUPPORT_EMAIL = '[email protected]';

packages/constants/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export * from './colors';
2+
export * from './contact';
23
export * from './csb';
34
export * from './dom';
45
export * from './editor';

packages/email/src/invitation.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
1+
import { SUPPORT_EMAIL } from '@onlook/constants';
12
import { render } from '@react-email/components';
23
import { type InviteUserEmailProps, InviteUserEmail } from './templates';
34
import type { SendEmailParams } from './types/send-email';
45

56
export const sendInvitationEmail = async (...params: SendEmailParams<InviteUserEmailProps>) => {
67
const [client, inviteParams, { dryRun = false } = {}] = params;
7-
const { inviteeEmail, invitedByEmail, inviteLink, invitedByName } = inviteParams;
8+
const { inviteeEmail, invitedByEmail, invitedByName } = inviteParams;
89

910
if (dryRun) {
10-
const rendered = await render(
11-
InviteUserEmail({ inviteeEmail, invitedByEmail, inviteLink }),
12-
);
11+
const rendered = await render(InviteUserEmail(inviteParams));
1312
console.log(rendered);
1413
return;
1514
}
1615

1716
return await client.emails.send({
18-
from: 'Onlook <[email protected]>',
17+
from: `Onlook <${SUPPORT_EMAIL}>`,
1918
to: inviteeEmail,
2019
subject: `Join ${invitedByName ?? invitedByEmail} on Onlook`,
2120
react: InviteUserEmail(inviteParams),

0 commit comments

Comments
 (0)