Skip to content

Commit f6ad613

Browse files
feat: Improve UX with better notification position and back button
- Move notifications from top-right to bottom-right to avoid navbar overlap - Add 'Back to Project' button on Templates page with animated arrow - Update notification slide animation to match new bottom position
1 parent 915fae8 commit f6ad613

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

frontend/src/components/Notification.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export const Notification: React.FC<NotificationProps> = ({
5151
}[type];
5252

5353
return (
54-
<div className={`fixed top-4 right-4 z-[100] ${bgColor} border ${borderColor} ${textColor} px-6 py-4 rounded-lg shadow-lg flex items-center gap-3 max-w-md animate-in fade-in slide-in-from-top-2`}>
54+
<div className={`fixed bottom-4 right-4 z-[100] ${bgColor} border ${borderColor} ${textColor} px-6 py-4 rounded-lg shadow-lg flex items-center gap-3 max-w-md animate-in fade-in slide-in-from-bottom-2`}>
5555
<span className="text-xl font-bold">{icon}</span>
5656
<p className="flex-1">{message}</p>
5757
<button

frontend/src/pages/Templates.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useState } from 'react';
2-
import { useParams } from 'react-router-dom';
2+
import { useParams, useNavigate } from 'react-router-dom';
33
import { gql } from '@apollo/client';
44
import { useQuery, useMutation } from '@apollo/client/react';
55
import Navbar from '../components/Navbar';
@@ -123,6 +123,7 @@ interface GetTagsData {
123123

124124
const Templates: React.FC = () => {
125125
const { projectId } = useParams<{ projectId: string }>();
126+
const navigate = useNavigate();
126127
const [showModal, setShowModal] = useState(false);
127128
const [editingTemplate, setEditingTemplate] = useState<Template | null>(null);
128129
const { notification, showNotification } = useNotification();
@@ -247,6 +248,16 @@ const Templates: React.FC = () => {
247248
<Navbar />
248249
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
249250
<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+
250261
<div className="flex items-center justify-between">
251262
<div>
252263
<h1 className="text-3xl font-bold text-gray-900 dark:text-white">

0 commit comments

Comments
 (0)