Skip to content

Commit 199ae42

Browse files
authored
header text in browse page
1 parent 104a498 commit 199ae42

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

client/src/screens/browse/index.jsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,12 @@ const BrowseScreen = () => {
147147
// console.error("Error refetching course data:", error);
148148
// }
149149
// };
150+
const headerText=folderData?.path ?
151+
folderData.path
152+
: folderData?.childType==="Folder"? "Select a folder..."
153+
: folderData?.childType==="File"? "Select a file..."
154+
:currYear? "Select an year...":"Select a course..."
155+
150156
return (
151157
<Container color={"light"} type={"fluid"}>
152158
<div className="navbar-browse-screen">
@@ -168,17 +174,17 @@ const BrowseScreen = () => {
168174
<div className="middle">
169175
<FolderInfo
170176
isBR={user.user.isBR}
171-
path={folderData?.path ? folderData.path : "Select a folder..."}
172-
name={folderData?.name ? folderData.name : "Select a folder"}
177+
path={headerText}
178+
name={folderData?.name ? folderData.name : headerText}
173179
canDownload={folderData?.childType === "File"}
174180
contributionHandler={contributionHandler}
175181
folderId={folderData?._id}
176182
courseCode={folderData?.course}
177183
/>
178184
<div className="files">
179-
{!folderData ? (
180-
"Select a course"
181-
) : folderData?.childType === "File" ? (
185+
{!folderData ?
186+
headerText
187+
: folderData?.childType === "File" ? (
182188
<FileController files={folderData?.children}
183189
// fetchCourseDataAgain={fetchCourseDataAgain} courseCode={currCourseCode}
184190
/>

0 commit comments

Comments
 (0)