1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-10-03 12:21:52 +02:00

Add teams support

This commit is contained in:
Kamran Ahmed
2023-07-20 19:24:34 +01:00
parent bbe8125fc1
commit 03ba0c384b
101 changed files with 5612 additions and 182 deletions

View File

@@ -1,5 +1,6 @@
import { useEffect, useRef, useState } from 'preact/hooks';
import { httpPost } from '../../lib/http';
import { useToast } from '../../hooks/use-toast';
type ContributionInputProps = {
id: number;
@@ -116,6 +117,7 @@ type ContributionFormProps = {
export function ContributionForm(props: ContributionFormProps) {
const { onClose, resourceType, resourceId, topicId } = props;
const toast = useToast();
const [isSubmitting, setIsSubmitting] = useState(false);
const [links, setLinks] = useState<
{ id: number; title: string; link: string }[]
@@ -144,7 +146,7 @@ export function ContributionForm(props: ContributionFormProps) {
setIsSubmitting(false);
if (!response || error) {
alert(error?.message || 'Something went wrong. Please try again.');
toast.error(error?.message || 'Something went wrong. Please try again.');
return;
}