mirror of
https://github.com/snowball-tools/snowballtools-base.git
synced 2024-11-18 04:56:18 +00:00
fix navigate
This commit is contained in:
parent
6a108c1a1b
commit
4532a962d8
@ -18,14 +18,14 @@ export default [
|
||||
name: 'Kotlin',
|
||||
icon: 'kotlin',
|
||||
repoFullName: '',
|
||||
isComingSoon: false,
|
||||
isComingSoon: true,
|
||||
},
|
||||
{
|
||||
id: '4',
|
||||
name: 'React Native',
|
||||
icon: 'react-native',
|
||||
repoFullName: '',
|
||||
isComingSoon: false,
|
||||
isComingSoon: true,
|
||||
},
|
||||
{
|
||||
id: '5',
|
||||
|
@ -1,3 +1,4 @@
|
||||
import React, { ComponentPropsWithoutRef, useCallback } from 'react';
|
||||
import { Button } from 'components/shared/Button';
|
||||
import {
|
||||
ArrowRightCircleIcon,
|
||||
@ -6,7 +7,6 @@ import {
|
||||
TemplateIconType,
|
||||
} from 'components/shared/CustomIcon';
|
||||
import { Tag } from 'components/shared/Tag';
|
||||
import React, { ComponentPropsWithoutRef, useCallback } from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { useToast } from 'components/shared/Toast';
|
||||
import { cn } from 'utils/classnames';
|
||||
@ -24,7 +24,10 @@ export interface TemplateCardProps extends ComponentPropsWithoutRef<'div'> {
|
||||
isGitAuth: boolean;
|
||||
}
|
||||
|
||||
export const TemplateCard = ({ template, isGitAuth }: TemplateCardProps) => {
|
||||
export const TemplateCard: React.FC<TemplateCardProps> = ({
|
||||
template,
|
||||
isGitAuth,
|
||||
}: TemplateCardProps) => {
|
||||
const { toast, dismiss } = useToast();
|
||||
const navigate = useNavigate();
|
||||
|
||||
@ -38,7 +41,7 @@ export const TemplateCard = ({ template, isGitAuth }: TemplateCardProps) => {
|
||||
});
|
||||
}
|
||||
if (isGitAuth) {
|
||||
return navigate(`/template?templateId=${template.id}`);
|
||||
return navigate(`template?templateId=${template.id}`);
|
||||
}
|
||||
return toast({
|
||||
id: 'connect-git-account',
|
||||
|
Loading…
Reference in New Issue
Block a user