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
dba4b3fc
Commit
dba4b3fc
authored
4 years ago
by
Nidharshan A
Browse files
Options
Downloads
Patches
Plain Diff
Minor bug cleared.
parent
7ffc5dec
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
digital-course-file/src/user/Folder.js
+18
-20
18 additions, 20 deletions
digital-course-file/src/user/Folder.js
with
18 additions
and
20 deletions
digital-course-file/src/user/Folder.js
+
18
−
20
View file @
dba4b3fc
import
{
React
}
from
"
react
"
;
import
{
React
,
useState
,
useEffect
}
from
"
react
"
;
import
{
FontAwesomeIcon
}
from
"
@fortawesome/react-fontawesome
"
;
import
{
faFolder
}
from
"
@fortawesome/free-solid-svg-icons
"
import
{
Button
}
from
"
react-bootstrap
"
;
import
{
Link
}
from
"
react-router-dom
"
;
import
{
useHistory
}
from
"
react-router-dom
"
;
import
{
useContextMenu
,
Menu
,
Item
,
Separator
}
from
"
react-contexify
"
;
import
"
react-contexify/dist/ReactContexify.css
"
;
export
default
function
Folder
({
folder
})
{
...
...
@@ -18,14 +16,15 @@ export default function Folder ({folder}) {
});
function
displayMenu
(
e
)
{
show
(
e
,
{
props
:
{
id
:
Number
(
e
.
currentTarget
.
id
)
}
});
// e.preventDefault();
show
(
e
,
{
props
:
{
id
:
Number
(
e
.
currentTarget
.
id
)
,
folderId
:
folder
.
id
}
});
}
function
handleItemClick
({
event
,
props
,
data
,
triggerEvent
})
{
// console.log(props.folderId);
switch
(
event
.
currentTarget
.
id
)
{
case
"
open
"
:
history
.
push
(
`/folder/
${
folder
.
i
d
}
`
);
history
.
push
(
`/folder/
${
props
.
folder
I
d
}
`
);
break
;
case
"
rename
"
:
...
...
@@ -42,6 +41,7 @@ export default function Folder ({folder}) {
<
div
>
<
Button
onContextMenu
=
{
displayMenu
}
id
=
{
folder
.
id
}
to
=
{
`/folder/
${
folder
.
id
}
`
}
variant
=
"
outline-secondary
"
className
=
"
text-truncate w-100
"
...
...
@@ -57,11 +57,9 @@ export default function Folder ({folder}) {
<
Item
id
=
"
rename
"
onClick
=
{
handleItemClick
}
>
Rename
<
/Item
>
<
Item
id
=
"
details
"
onClick
=
{
handleItemClick
}
>
Details
<
/Item
>
<
/Menu
>
<
/div
>
...
...
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