-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
created event share component ui and functionality
- Loading branch information
Showing
7 changed files
with
475 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import React from "react"; | ||
import styles from "./ShareEvent.module.scss"; | ||
import notify from "../../../lib/notify"; | ||
import { | ||
FacebookShareButton, | ||
LinkedinShareButton, | ||
TwitterShareButton, | ||
WhatsappShareButton | ||
} from "react-share"; | ||
import { FacebookIcon, TwitterIcon, LinkedinIcon, WhatsappIcon } from "react-share"; | ||
function ShareEvent({ hidewindow, location }) { | ||
const url = location; | ||
const copytoclipboard = () => { | ||
navigator.clipboard.writeText(url); | ||
notify("Copied to clipboard", "success"); | ||
}; | ||
return ( | ||
<div className={styles.cover}> | ||
<div className={styles.card}> | ||
<div className={styles.topbar}> | ||
<div>Share</div> | ||
<div onClick={hidewindow} className={styles.close}> | ||
<svg | ||
width="16" | ||
height="16" | ||
viewBox="0 0 12 12" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<path | ||
d="M6 4.66688L10.6669 0L12 1.33312L7.33312 6L12 10.6669L10.6669 12L6 7.33312L1.33312 12L0 10.6669L4.66688 6L0 1.33312L1.33312 0L6 4.66688Z" | ||
fill="#ffffff" | ||
/> | ||
</svg> | ||
</div> | ||
</div> | ||
<div> | ||
<FacebookShareButton url={url}> | ||
<FacebookIcon size={32} /> | ||
</FacebookShareButton> | ||
<LinkedinShareButton url={url}> | ||
<LinkedinIcon size={32} /> | ||
</LinkedinShareButton> | ||
<TwitterShareButton url={url}> | ||
<TwitterIcon size={32} /> | ||
</TwitterShareButton> | ||
<WhatsappShareButton url={url}> | ||
<WhatsappIcon size={32} /> | ||
</WhatsappShareButton> | ||
</div> | ||
<div> | ||
<input | ||
onClick={copytoclipboard} | ||
type="text" | ||
name="link" | ||
id="link" | ||
readOnly={true} | ||
value={url} | ||
className={styles.link} | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default ShareEvent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
.cover{ | ||
@apply w-full h-screen flex flex-row justify-center items-center z-50 fixed; | ||
background-color: rgba($color: #000000, $alpha: 0.6); | ||
} | ||
.card{ | ||
@apply w-full md:w-1/3 h-auto p-4 mx-4; | ||
background-color: rgb(29, 28, 28); | ||
} | ||
.topbar{ | ||
@apply flex justify-between text-white font-bold text-xl my-2; | ||
} | ||
.link{ | ||
@apply p-2 w-full bg-gray-700 text-gray-100 mt-4 cursor-pointer; | ||
} | ||
.facebook{ | ||
margin: 10px 10px; | ||
cursor: pointer; | ||
svg:hover{ | ||
fill: #0e76a8; | ||
} | ||
} | ||
.instagram{ | ||
margin: 10px 10px; | ||
cursor: pointer; | ||
svg:hover{ | ||
fill: #3f729b; | ||
} | ||
} | ||
.twitter{ | ||
margin: 10px 10px; | ||
cursor: pointer; | ||
svg:hover{ | ||
fill: #00acee; | ||
} | ||
} | ||
.close{ | ||
cursor: pointer; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.