File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
client/src/screens/browse Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -147,6 +147,12 @@ const BrowseScreen = () => {
147
147
// console.error("Error refetching course data:", error);
148
148
// }
149
149
// };
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
+
150
156
return (
151
157
< Container color = { "light" } type = { "fluid" } >
152
158
< div className = "navbar-browse-screen" >
@@ -168,17 +174,17 @@ const BrowseScreen = () => {
168
174
< div className = "middle" >
169
175
< FolderInfo
170
176
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 }
173
179
canDownload = { folderData ?. childType === "File" }
174
180
contributionHandler = { contributionHandler }
175
181
folderId = { folderData ?. _id }
176
182
courseCode = { folderData ?. course }
177
183
/>
178
184
< div className = "files" >
179
- { ! folderData ? (
180
- "Select a course"
181
- ) : folderData ?. childType === "File" ? (
185
+ { ! folderData ?
186
+ headerText
187
+ : folderData ?. childType === "File" ? (
182
188
< FileController files = { folderData ?. children }
183
189
// fetchCourseDataAgain={fetchCourseDataAgain} courseCode={currCourseCode}
184
190
/>
You can’t perform that action at this time.
0 commit comments