File tree Expand file tree Collapse file tree
components/AnimatedContent Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { css } from "../../../styled-system/css" ;
2+
3+ export default function ShareButton ( ) {
4+ const handleShareX = ( ) => {
5+ const url = window . location . href + "?utm_source=share_btn&utm_medium=x_post_link" ;
6+ const text = document . title || 'Check this out' ;
7+ const shareUrl = `https://x.com/intent/post?text=${ encodeURIComponent ( text ) } &url=${ encodeURIComponent ( url ) } ` ;
8+ window . open ( shareUrl , '_blank' , 'noopener,noreferrer' ) ;
9+ }
10+ return (
11+ < button className = { css ( {
12+ background : "transparent" ,
13+ border : "1px solid #f0d0ff" ,
14+ color : "#f0d0ff" ,
15+ cursor : "pointer" ,
16+ padding : "10px 20px" ,
17+ textDecoration : "underline" ,
18+ "&:hover" : {
19+ background : "#f0d0ff" ,
20+ color : "#050021" ,
21+ textDecoration : "none" ,
22+ } ,
23+ } ) } onClick = { handleShareX } >
24+ Share on X
25+ </ button >
26+ ) ;
27+ }
Original file line number Diff line number Diff line change 11import { css } from "../../styled-system/css" ;
22import Link from "next/link" ;
33import ClickSpark from "../components/ClickSpark/ClickSpark" ;
4+ import ShareButton from "../components/AnimatedContent/shrebtn" ;
45
56export default function Layout ( { children } ) {
67 return (
@@ -64,7 +65,7 @@ export default function Layout({ children }) {
6465 >
6566 Apps
6667 </ Link >
67-
68+
6869 < Link
6970 href = { "/videos" }
7071 className = { css ( {
@@ -90,6 +91,13 @@ export default function Layout({ children }) {
9091 background : "#000" ,
9192 } ) }
9293 >
94+
95+ < div className = { css ( { marginBottom : "20px" } ) } >
96+ < p > Share this page:</ p >
97+ < div className = { css ( { display : "flex" , justifyContent : "center" } ) } >
98+ < ShareButton />
99+ </ div >
100+ </ div >
93101 < div > (c) Nknight AMAMIYA 2021</ div >
94102 < Link
95103 href = { "https://varius.technology/" }
@@ -112,7 +120,7 @@ export default function Layout({ children }) {
112120 >
113121 nknighta.me
114122 </ Link >
115-
123+
116124 < Link
117125 href = { "/llmassets" }
118126 className = { css ( {
You can’t perform that action at this time.
0 commit comments