11import React from 'react' ;
22import Box from '@material-ui/core/Box' ;
33import Container from '@material-ui/core/Container' ;
4+ import Link from '@material-ui/core/Link' ;
45import Typography from '@material-ui/core/Typography' ;
56import { makeStyles } from '@material-ui/core/styles' ;
67import GenericHeaderSection from '../../components/GenericHeaderSection' ;
78import ImageComponent from '../../components/ImageComponent' ;
89import SettingsGearIcon from '../../icons/SettingsGearIcon' ;
10+ import { useClipboard } from 'use-clipboard-copy' ;
911
1012const useStyles = makeStyles ( ( theme ) => ( {
1113 boxContainer : {
12- padding : '64px 32px' ,
14+ padding : '32px' ,
1315 margin : 'auto' ,
16+ [ theme . breakpoints . down ( 'md' ) ] : {
17+ padding : '32px 0' ,
18+ } ,
1419 } ,
1520 summary : {
16- marginBottom : '30px' ,
21+ fontSize : '24px' ,
22+ margin : '32px auto 64px' ,
1723 textAlign : 'justify' ,
18- [ theme . breakpoints . down ( 'xs' ) ] : {
19- fontSize : '14px' ,
24+ width : '66%' ,
25+ [ theme . breakpoints . down ( 'md' ) ] : {
26+ fontSize : '20px' ,
27+ margin : '0px auto 32px' ,
28+ width : '100%' ,
2029 } ,
2130 } ,
2231 typoStyle : {
2332 fontWeight : '400' ,
2433 textAlign : 'justify' ,
34+ '& a:visited' : {
35+ color : theme . palette . secondary . main ,
36+ } ,
2537 [ theme . breakpoints . down ( 'xs' ) ] : {
2638 fontSize : '14px' ,
2739 } ,
@@ -32,11 +44,16 @@ const useStyles = makeStyles((theme) => ({
3244} ) ) ;
3345
3446const HowToUse = ( ) => {
47+ const clipboard = useClipboard ( ) ;
3548 const classes = useStyles ( ) ;
3649 const breadCrumbLinks = [
3750 { href : '/' , name : 'Home' } ,
3851 { href : '/join-index/how-to-add' , name : 'How to Add Your Project' } ,
3952 ] ;
53+ const copyText = ( e , text ) => {
54+ e . preventDefault ( ) ;
55+ clipboard . copy ( text ) ;
56+ } ;
4057 return (
4158 < Box className = 'pageContainer' >
4259 < Box className = 'boxBackground' >
@@ -52,10 +69,10 @@ const HowToUse = () => {
5269 < Box className = { classes . boxContainer } >
5370 < Box >
5471 < Typography variant = 'body1' className = { classes . summary } >
55- By adding the civictechindex topic tag to your project, we can
56- create a continuously updated repository for all civic tech
57- enthusiasts to find open source projects to model, connect with,
58- and learn from.
72+ By adding the < b > ' civictechindex' </ b >
73+ topic tag to your project, we can create a continuously updated
74+ repository for all civic tech enthusiasts to find open source
75+ projects to model, connect with, and learn from.
5976 </ Typography >
6077 </ Box >
6178 < Box >
@@ -70,6 +87,18 @@ const HowToUse = () => {
7087 don’t have "edit repository settings" privileges (and
7188 can’t perform the steps below).
7289 </ Typography >
90+ < Typography variant = 'body1' className = { classes . typoStyle } >
91+ Click{ ' ' }
92+ < Link
93+ data-cy = 'copy-link'
94+ onClick = { ( e ) => copyText ( e , window . location . href ) }
95+ key = 'join-index'
96+ href = '/join-index/how-to-add'
97+ >
98+ here
99+ </ Link > { ' ' }
100+ to copy the url for this page to send to your GitHub admin.
101+ </ Typography >
73102 </ Box >
74103 < ImageComponent src = '/images/instructions-step1.png' alt = 'Step 1' />
75104 < Box >
0 commit comments