forked from cerc-io/snowballtools-base
fix navigate
This commit is contained in:
parent
4532a962d8
commit
5946755749
@ -7,7 +7,7 @@ import {
|
|||||||
TemplateIconType,
|
TemplateIconType,
|
||||||
} from 'components/shared/CustomIcon';
|
} from 'components/shared/CustomIcon';
|
||||||
import { Tag } from 'components/shared/Tag';
|
import { Tag } from 'components/shared/Tag';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate, useParams } from 'react-router-dom';
|
||||||
import { useToast } from 'components/shared/Toast';
|
import { useToast } from 'components/shared/Toast';
|
||||||
import { cn } from 'utils/classnames';
|
import { cn } from 'utils/classnames';
|
||||||
|
|
||||||
@ -30,6 +30,7 @@ export const TemplateCard: React.FC<TemplateCardProps> = ({
|
|||||||
}: TemplateCardProps) => {
|
}: TemplateCardProps) => {
|
||||||
const { toast, dismiss } = useToast();
|
const { toast, dismiss } = useToast();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
const { orgSlug } = useParams();
|
||||||
|
|
||||||
const handleClick = useCallback(() => {
|
const handleClick = useCallback(() => {
|
||||||
if (template?.isComingSoon) {
|
if (template?.isComingSoon) {
|
||||||
@ -41,7 +42,9 @@ export const TemplateCard: React.FC<TemplateCardProps> = ({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (isGitAuth) {
|
if (isGitAuth) {
|
||||||
return navigate(`template?templateId=${template.id}`);
|
return navigate(
|
||||||
|
`/${orgSlug}/projects/create/template?templateId=${template.id}`,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return toast({
|
return toast({
|
||||||
id: 'connect-git-account',
|
id: 'connect-git-account',
|
||||||
|
Loading…
Reference in New Issue
Block a user