From 7c6d66137bd6687c5866e694ac1d4d6da7ae670a Mon Sep 17 00:00:00 2001 From: Kalki <97698934+jedan2506@users.noreply.github.com> Date: Wed, 17 Jul 2024 13:05:03 +0530 Subject: [PATCH] Frontend bug fixes (#72) * ensuring title and summary are never empty * code editor fixes --- gui/src/app/(programmer)/code/Code.tsx | 31 ++++++++++++------- .../(programmer)/design_workbench/page.tsx | 5 +-- gui/src/app/(programmer)/layout.tsx | 31 ++++++++++--------- gui/src/app/constants/UtilsConstants.ts | 4 +++ gui/src/app/utils.tsx | 18 +++++------ .../CreateEditDesignStory.tsx | 5 +++ .../DesignStoryDetails.tsx | 1 + .../StoryComponents/CreateEditStory.tsx | 6 ++++ 8 files changed, 63 insertions(+), 38 deletions(-) create mode 100644 gui/src/app/constants/UtilsConstants.ts diff --git a/gui/src/app/(programmer)/code/Code.tsx b/gui/src/app/(programmer)/code/Code.tsx index e17e7092..58d28eff 100644 --- a/gui/src/app/(programmer)/code/Code.tsx +++ b/gui/src/app/(programmer)/code/Code.tsx @@ -1,10 +1,10 @@ 'use client'; import React, { useEffect, useState, useRef, useMemo } from 'react'; import { usePathname } from 'next/navigation'; -import Loader from '@/components/CustomLoaders/Loader'; import { Button } from '@nextui-org/react'; -import CustomImage from '@/components/ImageComponents/CustomImage'; import imagePath from '@/app/imagePath'; +import Loader from '@/components/CustomLoaders/Loader'; +import CustomImage from '@/components/ImageComponents/CustomImage'; import CustomModal from '@/components/CustomModal/CustomModal'; import CustomInput from '@/components/CustomInput/CustomInput'; import { createPullRequest } from '@/api/DashboardService'; @@ -12,15 +12,15 @@ import toast from 'react-hot-toast'; export default function Code() { const [projectURL, setProjectURL] = useState(''); - const initialURL = useRef(null); - const iframeRef = useRef(null); - const pathName = usePathname(); const [isIframeLoaded, setIsIframeLoaded] = useState(false); const [prTitle, setPRTitle] = useState(''); const [prDescription, setPRDescription] = useState(''); const [isCreatePRModalOpen, setIsCreatePRModalOpen] = useState< boolean | null >(false); + const initialURL = useRef(null); + const iframeRef = useRef(null); + const pathName = usePathname(); useEffect(() => { const storedURL = localStorage.getItem('projectURL'); @@ -96,7 +96,7 @@ export default function Code() { title={'Embedded Workspace'} style={{ width: '100%', - height: 'calc(100vh - 92px)', + height: 'calc(100vh - 50px)', border: 'none', position: pathName === '/code' ? 'relative' : 'absolute', top: pathName === '/code' ? '0' : '-9999px', @@ -109,9 +109,11 @@ export default function Code() { return (
-
+
Code Editor +