|
1 | 1 | import { useState } from 'react'; |
2 | | -import { useParams } from 'react-router-dom'; |
| 2 | +import { useParams, useNavigate } from 'react-router-dom'; |
3 | 3 | import { gql } from '@apollo/client'; |
4 | 4 | import { useQuery, useMutation } from '@apollo/client/react'; |
5 | 5 | import Navbar from '../components/Navbar'; |
@@ -123,6 +123,7 @@ interface GetTagsData { |
123 | 123 |
|
124 | 124 | const Templates: React.FC = () => { |
125 | 125 | const { projectId } = useParams<{ projectId: string }>(); |
| 126 | + const navigate = useNavigate(); |
126 | 127 | const [showModal, setShowModal] = useState(false); |
127 | 128 | const [editingTemplate, setEditingTemplate] = useState<Template | null>(null); |
128 | 129 | const { notification, showNotification } = useNotification(); |
@@ -247,6 +248,16 @@ const Templates: React.FC = () => { |
247 | 248 | <Navbar /> |
248 | 249 | <div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8"> |
249 | 250 | <div className="mb-8"> |
| 251 | + <button |
| 252 | + onClick={() => navigate(`/project/${projectId}`)} |
| 253 | + className="mb-4 flex items-center gap-2 text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white transition-colors group" |
| 254 | + > |
| 255 | + <svg className="w-5 h-5 group-hover:-translate-x-1 transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
| 256 | + <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M15 19l-7-7 7-7" /> |
| 257 | + </svg> |
| 258 | + <span className="font-medium">Back to Project</span> |
| 259 | + </button> |
| 260 | + |
250 | 261 | <div className="flex items-center justify-between"> |
251 | 262 | <div> |
252 | 263 | <h1 className="text-3xl font-bold text-gray-900 dark:text-white"> |
|
0 commit comments