rebrand to useSend (#210)
This commit is contained in:
@@ -31,14 +31,14 @@ import {
|
||||
SidebarMenuButton,
|
||||
SidebarMenuItem,
|
||||
useSidebar,
|
||||
} from "@unsend/ui/src/sidebar";
|
||||
} from "@usesend/ui/src/sidebar";
|
||||
import Link from "next/link";
|
||||
import { MiniThemeSwitcher, ThemeSwitcher } from "./theme/ThemeSwitcher";
|
||||
import { useSession } from "next-auth/react";
|
||||
import { isSelfHosted } from "~/utils/common";
|
||||
import { usePathname } from "next/navigation";
|
||||
import { Badge } from "@unsend/ui/src/badge";
|
||||
import { Avatar, AvatarFallback, AvatarImage } from "@unsend/ui/src/avatar";
|
||||
import { Badge } from "@usesend/ui/src/badge";
|
||||
import { Avatar, AvatarFallback, AvatarImage } from "@usesend/ui/src/avatar";
|
||||
import {
|
||||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
@@ -47,7 +47,7 @@ import {
|
||||
DropdownMenuLabel,
|
||||
DropdownMenuSeparator,
|
||||
DropdownMenuTrigger,
|
||||
} from "@unsend/ui/src/dropdown-menu";
|
||||
} from "@usesend/ui/src/dropdown-menu";
|
||||
|
||||
// General items
|
||||
const generalItems = [
|
||||
@@ -125,8 +125,8 @@ export function AppSidebar() {
|
||||
<SidebarHeader>
|
||||
<SidebarGroupLabel>
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="text-lg font-semibold text-foreground">
|
||||
Unsend
|
||||
<span className="text-lg font-semibold text-foreground font-mono">
|
||||
useSend
|
||||
</span>
|
||||
<Badge variant="outline">Beta</Badge>
|
||||
</div>
|
||||
@@ -234,7 +234,7 @@ export function AppSidebar() {
|
||||
<SidebarMenu>
|
||||
<SidebarMenuItem>
|
||||
<SidebarMenuButton asChild tooltip="Docs">
|
||||
<Link href="https://docs.unsend.dev" target="_blank">
|
||||
<Link href="https://docs.usesend.com" target="_blank">
|
||||
<BookOpenText />
|
||||
<span>Docs</span>
|
||||
</Link>
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { useTheme } from "@unsend/ui";
|
||||
import { useTheme } from "@usesend/ui";
|
||||
import Image from "next/image";
|
||||
|
||||
export const FullScreenLoading = () => {
|
||||
@@ -6,8 +6,8 @@ export const FullScreenLoading = () => {
|
||||
return (
|
||||
<div className="flex items-center justify-center min-h-screen">
|
||||
<Image
|
||||
src={"/logo-light.png"}
|
||||
alt="Unsend"
|
||||
src={"/logo-squircle.png"}
|
||||
alt="useSend"
|
||||
width={45}
|
||||
height={45}
|
||||
className="mx-auto"
|
||||
|
@@ -2,9 +2,9 @@ import { Plan } from "@prisma/client";
|
||||
import { PLAN_PERKS } from "~/lib/constants/payments";
|
||||
import { CheckCircle2 } from "lucide-react";
|
||||
import { api } from "~/trpc/react";
|
||||
import Spinner from "@unsend/ui/src/spinner";
|
||||
import Spinner from "@usesend/ui/src/spinner";
|
||||
import { useTeam } from "~/providers/team-context";
|
||||
import { Badge } from "@unsend/ui/src/badge";
|
||||
import { Badge } from "@usesend/ui/src/badge";
|
||||
import { format } from "date-fns";
|
||||
|
||||
export const PlanDetails = () => {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { Button } from "@unsend/ui/src/button";
|
||||
import Spinner from "@unsend/ui/src/spinner";
|
||||
import { Button } from "@usesend/ui/src/button";
|
||||
import Spinner from "@usesend/ui/src/spinner";
|
||||
import { api } from "~/trpc/react";
|
||||
|
||||
export const UpgradeButton = () => {
|
||||
|
@@ -6,7 +6,7 @@ import {
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
DialogDescription,
|
||||
} from "@unsend/ui/src/dialog";
|
||||
} from "@usesend/ui/src/dialog";
|
||||
import { CheckCircle2 } from "lucide-react";
|
||||
import { useUpgradeModalStore } from "~/store/upgradeModalStore";
|
||||
import { PLAN_PERKS } from "~/lib/constants/payments";
|
||||
|
@@ -9,19 +9,19 @@ import {
|
||||
FormItem,
|
||||
FormLabel,
|
||||
FormMessage,
|
||||
} from "@unsend/ui/src/form";
|
||||
} from "@usesend/ui/src/form";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { z } from "zod";
|
||||
import { api } from "~/trpc/react";
|
||||
import { Input } from "@unsend/ui/src/input";
|
||||
import { Button } from "@unsend/ui/src/button";
|
||||
import Spinner from "@unsend/ui/src/spinner";
|
||||
import { toast } from "@unsend/ui/src/toaster";
|
||||
import { Input } from "@usesend/ui/src/input";
|
||||
import { Button } from "@usesend/ui/src/button";
|
||||
import Spinner from "@usesend/ui/src/spinner";
|
||||
import { toast } from "@usesend/ui/src/toaster";
|
||||
import { isLocalhost } from "~/utils/client";
|
||||
|
||||
const FormSchema = z.object({
|
||||
region: z.string(),
|
||||
unsendUrl: z.string().url(),
|
||||
usesendUrl: z.string().url(),
|
||||
sendRate: z.coerce.number(),
|
||||
transactionalQuota: z.coerce.number().min(0).max(100),
|
||||
});
|
||||
@@ -56,7 +56,7 @@ export const AddSesSettingsForm: React.FC<SesSettingsProps> = ({
|
||||
resolver: zodResolver(FormSchema),
|
||||
defaultValues: {
|
||||
region: "",
|
||||
unsendUrl: "",
|
||||
usesendUrl: "",
|
||||
sendRate: 1,
|
||||
transactionalQuota: 50,
|
||||
},
|
||||
@@ -65,31 +65,39 @@ export const AddSesSettingsForm: React.FC<SesSettingsProps> = ({
|
||||
function onSubmit(data: z.infer<typeof FormSchema>) {
|
||||
const localhost = isLocalhost();
|
||||
|
||||
if (!data.unsendUrl.startsWith("https://") && !localhost) {
|
||||
form.setError("unsendUrl", {
|
||||
if (!data.usesendUrl.startsWith("https://") && !localhost) {
|
||||
form.setError("usesendUrl", {
|
||||
message: "URL must start with https://",
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (data.unsendUrl.includes("localhost") && !localhost) {
|
||||
form.setError("unsendUrl", {
|
||||
if (data.usesendUrl.includes("localhost") && !localhost) {
|
||||
form.setError("usesendUrl", {
|
||||
message: "URL must be a valid url",
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
addSesSettings.mutate(data, {
|
||||
onSuccess: () => {
|
||||
utils.admin.invalidate();
|
||||
onSuccess?.();
|
||||
addSesSettings.mutate(
|
||||
{
|
||||
region: data.region,
|
||||
usesendUrl: data.usesendUrl,
|
||||
sendRate: data.sendRate,
|
||||
transactionalQuota: data.transactionalQuota,
|
||||
},
|
||||
onError: (e) => {
|
||||
toast.error("Failed to create", {
|
||||
description: e.message,
|
||||
});
|
||||
{
|
||||
onSuccess: () => {
|
||||
utils.admin.invalidate();
|
||||
onSuccess?.();
|
||||
},
|
||||
onError: (e) => {
|
||||
toast.error("Failed to create", {
|
||||
description: e.message,
|
||||
});
|
||||
},
|
||||
},
|
||||
});
|
||||
);
|
||||
}
|
||||
|
||||
const onRegionInputOutOfFocus = async () => {
|
||||
@@ -134,7 +142,7 @@ export const AddSesSettingsForm: React.FC<SesSettingsProps> = ({
|
||||
/>
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="unsendUrl"
|
||||
name="usesendUrl"
|
||||
render={({ field, formState }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Callback URL</FormLabel>
|
||||
@@ -145,7 +153,7 @@ export const AddSesSettingsForm: React.FC<SesSettingsProps> = ({
|
||||
{...field}
|
||||
/>
|
||||
</FormControl>
|
||||
{formState.errors.unsendUrl ? (
|
||||
{formState.errors.usesendUrl ? (
|
||||
<FormMessage />
|
||||
) : (
|
||||
<FormDescription>
|
||||
|
@@ -4,7 +4,7 @@ import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { z } from "zod";
|
||||
|
||||
import { Button } from "@unsend/ui/src/button";
|
||||
import { Button } from "@usesend/ui/src/button";
|
||||
import {
|
||||
Form,
|
||||
FormControl,
|
||||
@@ -12,12 +12,12 @@ import {
|
||||
FormField,
|
||||
FormItem,
|
||||
FormMessage,
|
||||
} from "@unsend/ui/src/form";
|
||||
import { Input } from "@unsend/ui/src/input";
|
||||
import { Spinner } from "@unsend/ui/src/spinner";
|
||||
} from "@usesend/ui/src/form";
|
||||
import { Input } from "@usesend/ui/src/input";
|
||||
import { Spinner } from "@usesend/ui/src/spinner";
|
||||
import { api } from "~/trpc/react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { toast } from "@unsend/ui/src/toaster";
|
||||
import { toast } from "@usesend/ui/src/toaster";
|
||||
import JoinTeam from "./JoinTeam";
|
||||
|
||||
const FormSchema = z.object({
|
||||
|
@@ -1,17 +1,17 @@
|
||||
"use client";
|
||||
|
||||
import { Button } from "@unsend/ui/src/button";
|
||||
import { Spinner } from "@unsend/ui/src/spinner";
|
||||
import { Button } from "@usesend/ui/src/button";
|
||||
import { Spinner } from "@usesend/ui/src/spinner";
|
||||
import { api } from "~/trpc/react";
|
||||
import { useRouter, useSearchParams } from "next/navigation";
|
||||
import { toast } from "@unsend/ui/src/toaster";
|
||||
import { toast } from "@usesend/ui/src/toaster";
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogDescription,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from "@unsend/ui/src/dialog";
|
||||
} from "@usesend/ui/src/dialog";
|
||||
import { useState } from "react";
|
||||
import type { AppRouter } from "~/server/api/root";
|
||||
import type { inferRouterOutputs } from "@trpc/server";
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { cn, useTheme } from "@unsend/ui";
|
||||
import { Button } from "@unsend/ui/src/button";
|
||||
import { cn, useTheme } from "@usesend/ui";
|
||||
import { Button } from "@usesend/ui/src/button";
|
||||
import { Monitor, Sun, Moon, SunMoonIcon } from "lucide-react";
|
||||
|
||||
export const ThemeSwitcher = () => {
|
||||
@@ -17,7 +17,7 @@ export const ThemeSwitcher = () => {
|
||||
size="sm"
|
||||
className={cn(
|
||||
"p-0.5 rounded-[0.20rem] h-5 w-5",
|
||||
theme === "system" ? " bg-muted" : ""
|
||||
theme === "system" ? " bg-muted" : "",
|
||||
)}
|
||||
onClick={() => setTheme("system")}
|
||||
>
|
||||
@@ -28,7 +28,7 @@ export const ThemeSwitcher = () => {
|
||||
size="sm"
|
||||
className={cn(
|
||||
"p-0.5 rounded-[0.20rem] h-5 w-5",
|
||||
theme === "light" ? " bg-muted" : ""
|
||||
theme === "light" ? " bg-muted" : "",
|
||||
)}
|
||||
onClick={() => setTheme("light")}
|
||||
>
|
||||
@@ -39,7 +39,7 @@ export const ThemeSwitcher = () => {
|
||||
size="sm"
|
||||
className={cn(
|
||||
"p-0.5 rounded-[0.20rem] h-5 w-5",
|
||||
theme === "dark" ? "bg-muted" : ""
|
||||
theme === "dark" ? "bg-muted" : "",
|
||||
)}
|
||||
onClick={() => setTheme("dark")}
|
||||
>
|
||||
|
Reference in New Issue
Block a user