Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
sphinxrave committed Oct 25, 2024
1 parent 9760fec commit eeb306b
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 75 deletions.
33 changes: 15 additions & 18 deletions packages/react/src/components/about/request/AddSubber.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useReportMutation } from "@/services/reports.service";
import { useChannelReportMutation } from "@/services/reports.service";
import { Alert, AlertDescription } from "@/shadcn/ui/alert";
import { Button } from "@/shadcn/ui/button";
import {
Expand Down Expand Up @@ -33,24 +33,21 @@ export function AddSubberForm() {
const form = useForm({
defaultValues: formValues,
});
const { mutate, isPending } = useReportMutation(
{ type: "channel" },
{
onSuccess: () => {
console.log("Subber Channel request has been sent successfully");
toast({
title: t("channelRequest.sendSuccess"),
});
},
onError: (err) => {
toast({
variant: "error",
title: t("channelRequest.sendError"),
description: err.message,
});
},
const { mutate, isPending } = useChannelReportMutation({
onSuccess: () => {
console.log("Subber Channel request has been sent successfully");
toast({
title: t("channelRequest.sendSuccess"),
});
},
);
onError: (err) => {
toast({
variant: "error",
title: t("channelRequest.sendError"),
description: err.message,
});
},
});

const onSubmit: SubmitHandler<typeof formValues> = async ({
link,
Expand Down
33 changes: 15 additions & 18 deletions packages/react/src/components/about/request/AddVtuber.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useReportMutation } from "@/services/reports.service";
import { useChannelReportMutation } from "@/services/reports.service";
import { Alert, AlertDescription } from "@/shadcn/ui/alert";
import { Button } from "@/shadcn/ui/button";
import {
Expand Down Expand Up @@ -34,24 +34,21 @@ export function AddVtuberForm() {
const form = useForm({
defaultValues: formValues,
});
const { mutate, isPending } = useReportMutation(
{ type: "channel" },
{
onSuccess: () => {
console.log("Channel request has been sent successfully");
toast({
title: t("channelRequest.sendSuccess"),
});
},
onError: (err) => {
toast({
variant: "error",
title: t("channelRequest.sendError"),
description: err.message,
});
},
const { mutate, isPending } = useChannelReportMutation({
onSuccess: () => {
console.log("Channel request has been sent successfully");
toast({
title: t("channelRequest.sendSuccess"),
});
},
);
onError: (err) => {
toast({
variant: "error",
title: t("channelRequest.sendError"),
description: err.message,
});
},
});

const onSubmit: SubmitHandler<typeof formValues> = async ({
link,
Expand Down
33 changes: 15 additions & 18 deletions packages/react/src/components/about/request/DeleteChannel.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useReportMutation } from "@/services/reports.service";
import { useChannelReportMutation } from "@/services/reports.service";
import { Alert, AlertDescription } from "@/shadcn/ui/alert";
import { Button } from "@/shadcn/ui/button";
import {
Expand Down Expand Up @@ -32,24 +32,21 @@ export function DeleteChannelForm() {
const form = useForm({
defaultValues: formValues,
});
const { mutate, isPending } = useReportMutation(
{ type: "channel" },
{
onSuccess: () => {
console.log("Channel modify request has been sent successfully");
toast({
title: t("channelRequest.sendSuccess"),
});
},
onError: (err) => {
toast({
variant: "error",
title: t("channelRequest.sendError"),
description: err.message,
});
},
const { mutate, isPending } = useChannelReportMutation({
onSuccess: () => {
console.log("Channel modify request has been sent successfully");
toast({
title: t("channelRequest.sendSuccess"),
});
},
);
onError: (err) => {
toast({
variant: "error",
title: t("channelRequest.sendError"),
description: err.message,
});
},
});

const onSubmit: SubmitHandler<typeof formValues> = async ({
channel,
Expand Down
33 changes: 15 additions & 18 deletions packages/react/src/components/about/request/ModifyInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useReportMutation } from "@/services/reports.service";
import { useChannelReportMutation } from "@/services/reports.service";
import { Button } from "@/shadcn/ui/button";
import {
Form,
Expand Down Expand Up @@ -35,24 +35,21 @@ export function ModifyInfoForm() {
const form = useForm({
defaultValues: formValues,
});
const { mutate, isPending } = useReportMutation(
{ type: "channel" },
{
onSuccess: () => {
console.log("Channel modify request has been sent successfully");
toast({
title: t("channelRequest.sendSuccess"),
});
},
onError: (err) => {
toast({
variant: "error",
title: t("channelRequest.sendError"),
description: err.message,
});
},
const { mutate, isPending } = useChannelReportMutation({
onSuccess: () => {
console.log("Channel modify request has been sent successfully");
toast({
title: t("channelRequest.sendSuccess"),
});
},
);
onError: (err) => {
toast({
variant: "error",
title: t("channelRequest.sendError"),
description: err.message,
});
},
});

const onSubmit: SubmitHandler<typeof formValues> = async ({
channel,
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/common/TwitterFeed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function StatusTweetEmbed({
fetch("https://ext.holodex.net/api/status")
.then((res) => res.text())
.then((url) => setTweetUrl(url.trim()))
.catch((err) => setError("Failed to load status"));
.catch(() => setError("Failed to load status"));
}, []);

// Create tweet embed when both tweet URL and Twitter script are ready
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/video/VideoReport.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ export function ReportDialogMenu({
<FormField
control={form.control}
name="mentionedChannels"
render={({ field }) => (
render={() => (
<FormItem className="mt-4">
<FormLabel>Suggested Channel Mentions</FormLabel>
<FormControl>
Expand Down
1 change: 0 additions & 1 deletion packages/react/src/services/live.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { useClient } from "@/hooks/useClient";
import { hidePlaceholderAtom } from "@/store/settings";
import { useQuery } from "@tanstack/react-query";
import { useAtomValue } from "jotai";
import { CommonQueryConfig } from "./@types";

interface UseLiveParams {
channel_id?: string;
Expand Down
4 changes: 4 additions & 0 deletions packages/react/src/services/reports.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@ export interface VideoReportEmbed {

// Channel report types
export interface ChannelReportEmbed {
title: string;
color: number; // hex to number
fields: { name: string; value: string }[];
footer?: { text: string };
}

export interface ChannelReportBody {
content?: string;
embeds: ChannelReportEmbed[];
}

Expand Down

0 comments on commit eeb306b

Please sign in to comment.