Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
form-creator-ui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Harbor Registry
Model registry
Operate
Environments
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
simmctic
form-creator
form-creator-ui
Merge requests
!60
Issue
#55
: Add copy to clipboard feature on share.
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Issue
#55
: Add copy to clipboard feature on share.
issue/55
into
master
Overview
0
Commits
1
Pipelines
0
Changes
1
Closed
shpl19
requested to merge
issue/55
into
master
4 years ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
closes
#55 (closed)
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
a07b99ce
1 commit,
4 years ago
1 file
+
16
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
src/components/fieldsListForms/ShareButton.jsx
+
16
−
1
Options
import
React
from
"
react
"
;
import
Dialog
from
"
@material-ui/core/Dialog
"
;
import
ShareOutlinedIcon
from
"
@material-ui/icons/ShareOutlined
"
;
import
FileCopyIcon
from
"
@material-ui/icons/FileCopy
"
;
import
IconButton
from
"
@material-ui/core/IconButton
"
;
import
Button
from
"
@material-ui/core/Button
"
;
import
Tooltip
from
"
@material-ui/core/Tooltip
"
;
import
Grid
from
"
@material-ui/core/Grid
"
;
import
DialogContent
from
"
@material-ui/core/DialogContent
"
;
import
DialogContentText
from
"
@material-ui/core/DialogContentText
"
;
import
DialogTitle
from
"
@material-ui/core/DialogTitle
"
;
import
{
useTheme
}
from
"
@material-ui/core/styles
"
;
import
{
DialogActions
}
from
"
@material-ui/core
"
;
function
ShareButton
(
props
)
{
const
[
open
,
setOpen
]
=
React
.
useState
(
false
);
@@ -21,6 +24,8 @@ function ShareButton(props) {
setOpen
(
false
);
};
const
form_link
=
`https://genforms.c3sl.ufpr.br/#/answer/
${
props
.
id
}
`
;
return
(
<>
<
Tooltip
title
=
"Compartilhar"
arrow
>
@@ -40,8 +45,18 @@ function ShareButton(props) {
</
DialogTitle
>
<
DialogContent
>
<
DialogContentText
id
=
"alert-dialog-description"
>
https://genforms.c3sl.ufpr.br/#/answer/
{
props
.
id
}
{
form_link
}
</
DialogContentText
>
<
DialogActions
disableSpacing
>
<
Button
variant
=
"outlined"
onClick
=
{
()
=>
{
navigator
.
clipboard
.
writeText
(
form_link
);
}
}
>
<
FileCopyIcon
/>
</
Button
>
</
DialogActions
>
</
DialogContent
>
</
Dialog
>
</>
Loading