Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PortalMEC-React
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
PortalMEC
PortalMEC-React
Commits
aa3db47f
Commit
aa3db47f
authored
4 years ago
by
Lucas Eduardo Schoenfelder
Browse files
Options
Downloads
Patches
Plain Diff
share to fb/twitter added
parent
7c586baf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!57
Merge of develop into master
,
!56
Fixed buttons reportar, seguir, compartilhar, guardar and entrar (in comments...
,
!24
Tela recurso
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Components/ShareModal.js
+29
-17
29 additions, 17 deletions
src/Components/ShareModal.js
with
29 additions
and
17 deletions
src/Components/ShareModal.js
+
29
−
17
View file @
aa3db47f
...
@@ -16,7 +16,7 @@ GNU Affero General Public License for more details.
...
@@ -16,7 +16,7 @@ GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
You should have received a copy of the GNU Affero General Public License
along with Plataforma Integrada MEC. If not, see <http://www.gnu.org/licenses/>.*/
along with Plataforma Integrada MEC. If not, see <http://www.gnu.org/licenses/>.*/
import
React
,
{
useContext
,
useRef
}
from
'
react
'
;
import
React
,
{
useRef
}
from
'
react
'
;
import
{
Button
}
from
'
@material-ui/core
'
;
import
{
Button
}
from
'
@material-ui/core
'
;
import
Modal
from
'
@material-ui/core/Modal
'
;
import
Modal
from
'
@material-ui/core/Modal
'
;
import
Backdrop
from
'
@material-ui/core/Backdrop
'
;
import
Backdrop
from
'
@material-ui/core/Backdrop
'
;
...
@@ -33,14 +33,12 @@ import LinkIcon from '../img/link_icon.svg'
...
@@ -33,14 +33,12 @@ import LinkIcon from '../img/link_icon.svg'
import
CloseModalButton
from
'
./CloseModalButton.js
'
import
CloseModalButton
from
'
./CloseModalButton.js
'
export
default
function
ReportModal
(
props
)
{
export
default
function
ReportModal
(
props
)
{
const
pRef
=
useRef
(
props
.
link
);
const
refContainer
=
useRef
(
props
.
link
);
function
copyToClipboard
(
e
)
{
function
copyToClipboard
(
e
)
{
console
.
log
(
pRef
.
current
)
let
copyText
=
document
.
getElementById
(
'
p-text
'
)
pRef
.
current
.
select
();
console
.
log
(
copyText
)
document
.
execCommand
(
'
copy
'
);
};
e
.
target
.
focus
();
};
return
(
return
(
<
StyledModal
<
StyledModal
...
@@ -72,22 +70,36 @@ export default function ReportModal (props) {
...
@@ -72,22 +70,36 @@ export default function ReportModal (props) {
<
/ResourceInfo
>
<
/ResourceInfo
>
<
ShareInfo
>
<
ShareInfo
>
<
Grid
container
style
=
{{
paddingRight
:
"
15px
"
,
paddingLeft
:
"
15px
"
}}
>
<
Grid
container
style
=
{{
paddingRight
:
"
15px
"
,
paddingLeft
:
"
15px
"
}}
>
{
/*Share to facebook*/
}
<
Grid
item
xs
=
{
4
}
>
<
Grid
item
xs
=
{
4
}
>
<
ShareButton
>
<
a
<
img
src
=
{
Facebook
}
alt
=
"
facebook-logo
"
/>
href
=
{
"
https://www.facebook.com/sharer/sharer.php?u=
"
+
props
.
link
}
<
p
>
FACEBOOK
<
/p
>
target
=
"
_blank
"
>
<
/ShareButton
>
<
ShareButton
>
<
img
src
=
{
Facebook
}
alt
=
"
facebook-logo
"
/>
<
p
>
FACEBOOK
<
/p
>
<
/ShareButton
>
<
/a
>
<
/Grid
>
<
/Grid
>
{
/*Share to Twitter*/
}
<
Grid
item
xs
=
{
4
}
>
<
Grid
item
xs
=
{
4
}
>
<
ShareButton
>
<
a
<
img
src
=
{
Twitter
}
alt
=
"
twitter-logo
"
/>
href
=
{
"
https://www.twitter.com/intent/tweet?url=
"
+
props
.
link
}
<
p
>
TWITTER
<
/p
>
target
=
"
_blank
"
>
<
/ShareButton
>
<
ShareButton
>
<
img
src
=
{
Twitter
}
alt
=
"
twitter-logo
"
/>
<
p
>
TWITTER
<
/p
>
<
/ShareButton
>
<
/a
>
<
/Grid
>
<
/Grid
>
{
/*Get shareable link*/
}
<
Grid
item
xs
=
{
4
}
>
<
Grid
item
xs
=
{
4
}
>
<
ShareButton
onClick
=
{
copyToClipboard
}
>
<
ShareButton
onClick
=
{
copyToClipboard
}
>
<
img
src
=
{
LinkIcon
}
alt
=
"
link-icon
"
/>
<
img
src
=
{
LinkIcon
}
alt
=
"
link-icon
"
/>
<
p
ref
=
{
pRef
}
value
=
{
props
.
link
}
>
COPIAR
LINK
<
/p
>
<
p
id
=
"
p-text
"
value
=
{
props
.
link
}
>
COPIAR
LINK
<
/p
>
<
/ShareButton
>
<
/ShareButton
>
<
/Grid
>
<
/Grid
>
<
/Grid
>
<
/Grid
>
...
...
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