Skip to content

Commit 8bf94c5

Browse files
edits
1 parent 3449b75 commit 8bf94c5

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

frontend/src/pages/Admin/SurveysPage/Surveys.tsx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -630,15 +630,17 @@ const AdminSurveys = () => {
630630
{isPublishing ? 'Publishing...' : 'Publish'}
631631
</button>
632632
)}
633-
<button
634-
onClick={() => {
635-
closeDetailModal();
636-
navigate(`/admin/surveys/edit/${selectedSurvey.id}`);
637-
}}
638-
className='px-6 py-2.5 bg-[#D54242] hover:bg-[#b53a3a] text-white rounded-xl font-medium transition'
639-
>
640-
Edit
641-
</button>
633+
{!selectedSurvey.isPublished && (
634+
<button
635+
onClick={() => {
636+
closeDetailModal();
637+
navigate(`/admin/surveys/edit/${selectedSurvey.id}`);
638+
}}
639+
className='px-6 py-2.5 bg-[#D54242] hover:bg-[#b53a3a] text-white rounded-xl font-medium transition'
640+
>
641+
Edit
642+
</button>
643+
)}
642644
<button
643645
onClick={closeDetailModal}
644646
className='px-6 py-2.5 bg-[#D54242] hover:bg-[#b53a3a] text-white rounded-xl font-medium transition'

0 commit comments

Comments
 (0)