Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
Digital course file
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SE-PROJECT-TEAM
Digital course file
Commits
4e7724ec
Commit
4e7724ec
authored
4 years ago
by
Ganapathi Subramanyam Jayam
Browse files
Options
Downloads
Patches
Plain Diff
refresh bug
parent
7264f288
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
digital-course-file/src/hooks/useFolder.js
+3
-3
3 additions, 3 deletions
digital-course-file/src/hooks/useFolder.js
digital-course-file/src/user/Hero.js
+10
-3
10 additions, 3 deletions
digital-course-file/src/user/Hero.js
with
13 additions
and
6 deletions
digital-course-file/src/hooks/useFolder.js
+
3
−
3
View file @
4e7724ec
...
...
@@ -5,7 +5,7 @@ import Loader from "react-loader-spinner";
export
const
ROOT_FOLDER
=
{
name
:
'
Courses
'
,
id
:
null
,
path
:
[]
,
parents
:
[]};
export
function
useFolder
(
folderId
=
null
,
folder
=
null
)
{
export
function
useFolder
(
folderId
=
null
,
folder
=
null
,
rand
)
{
// const {currentUser} = firebase.auth.currentUser;
...
...
@@ -109,7 +109,7 @@ export function useFolder( folderId = null, folder= null) {
payload
:
{
childFolders
:
snapshot
.
docs
.
map
(
database
.
formatDoc
)
}
})
})
},[
folderId
])
},[
folderId
,
rand
])
useEffect
(()
=>
{
if
(
firebase
.
auth
().
currentUser
)
{
...
...
@@ -126,7 +126,7 @@ export function useFolder( folderId = null, folder= null) {
)
}
},
[
folderId
])
},
[
folderId
,
rand
])
return
state
;
}
This diff is collapsed.
Click to expand it.
digital-course-file/src/user/Hero.js
+
10
−
3
View file @
4e7724ec
import
React
,
{
useState
,
Component
}
from
'
react
'
import
AddFolder
from
'
./AddFolder
'
import
AddFile
from
'
./AddFile
'
import
{
Container
,
Button
,
Navbar
,
Nav
}
from
'
react-bootstrap
'
import
{
Container
,
Navbar
,
Nav
}
from
'
react-bootstrap
'
import
{
useFolder
}
from
'
.././hooks/useFolder
'
import
Folder
from
'
./Folder
'
import
FolderNav
from
'
./FolderNav
'
...
...
@@ -14,11 +14,18 @@ import 'firebase/storage'
import
Loader
from
'
react-loader-spinner
'
import
Dropzone
from
'
./Dropzone
'
import
ParticlesBg
from
'
particles-bg
'
import
{
v4
as
uuidV4
}
from
'
uuid
'
const
Hero
=
({
handleLogout
})
=>
{
const
{
folderId
}
=
useParams
()
const
{
state
=
{}
}
=
useLocation
()
const
{
folder
,
childFolders
,
childFiles
}
=
useFolder
(
folderId
,
state
.
folder
)
const
rand
=
uuidV4
()
const
{
folder
,
childFolders
,
childFiles
}
=
useFolder
(
folderId
,
state
.
folder
,
rand
)
if
(
!
folder
)
{
return
(
...
...
@@ -40,7 +47,7 @@ const Hero = ({ handleLogout }) => {
return
(
<>
<
Container
fluid
>
<
ParticlesBg
type
=
"
cobweb
"
bg
=
{
true
}
/
>
<
ParticlesBg
type
=
'
cobweb
'
bg
=
{
true
}
/
>
<
div
className
=
'
d-flex align-items-center
'
>
<
FolderNav
currentFolder
=
{
folder
}
/
>
<
AddFolder
currentFolder
=
{
folder
}
/
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment