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
36efe64b
Commit
36efe64b
authored
4 years ago
by
akula0611
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of
https://git.amrita.edu/se-project-team/digital-course-file
into master
parents
3f3fc1a6
dba4b3fc
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide 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 @
36efe64b
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
})
{
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
"
...
...
@@ -51,20 +51,18 @@ export default function Folder ({folder}) {
<
/Button
>
<
Menu
id
=
{
MENU_ID
}
>
<
Item
id
=
"
open
"
onClick
=
{
handleItemClick
}
>
Open
<
/Item
>
<
Item
id
=
"
rename
"
onClick
=
{
handleItemClick
}
>
Rename
<
/Item
>
<
Item
id
=
"
details
"
onClick
=
{
handleItemClick
}
>
Details
<
/Item
>
<
/Menu
>
<
Item
id
=
"
open
"
onClick
=
{
handleItemClick
}
>
Open
<
/Item
>
<
Item
id
=
"
rename
"
onClick
=
{
handleItemClick
}
>
Rename
<
/Item
>
<
Item
id
=
"
details
"
onClick
=
{
handleItemClick
}
>
Details
<
/Item
>
<
/Menu
>
<
/div
>
);
}
\ No newline at end of file
}
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