@@ -15,12 +15,13 @@ const Home: NextPage = () => {
1515 const [ title , setTitle ] = useState < string > ( "Title" ) ;
1616 const [ desc , setDesc ] = useState < string > ( "Description" ) ;
1717 const [ imgUrl , setImgUrl ] = useState < string > ( "" ) ;
18+ const [ socialMedia , setSocialMedia ] = useState < string > ( "Twitter: @yehezgun" ) ;
1819 const [ siteName , setSiteName ] = useState < string > ( "yehezgun.com" ) ;
1920 const [ isCopied , setIsCopied ] = useState < boolean > ( false ) ;
2021 const ogUrl = new URL (
2122 `/api/og?title=${ title } &desc=${ desc } ${
2223 imgUrl . length > 10 ? `&imgUrl=${ imgUrl } ` : ""
23- } &siteName=${ siteName } `,
24+ } &siteName=${ siteName } &socialMedia= ${ socialMedia } `,
2425 baseURL
2526 ) ;
2627
@@ -36,6 +37,9 @@ const Home: NextPage = () => {
3637 const handleSiteNameChange = ( e : React . ChangeEvent < HTMLInputElement > ) => {
3738 setSiteName ( e . target . value ) ;
3839 } ;
40+ const handleSocialMediaChange = ( e : React . ChangeEvent < HTMLInputElement > ) => {
41+ setSocialMedia ( e . target . value ) ;
42+ } ;
3943
4044 const onCopied = ( ) => {
4145 setIsCopied ( true ) ;
@@ -92,6 +96,17 @@ const Home: NextPage = () => {
9296 defaultValue = { siteName }
9397 />
9498 </ div >
99+ < div className = "flex flex-col gap-2" >
100+ < label htmlFor = "title" className = "font-bold" >
101+ Social Media
102+ </ label >
103+ < input
104+ type = "text"
105+ onChange = { handleSocialMediaChange }
106+ className = { clsxm ( "base-form" ) }
107+ defaultValue = { socialMedia }
108+ />
109+ </ div >
95110 < Button block variant = "secondary" onClick = { ( ) => onCopied ( ) } >
96111 Copy URL
97112 </ Button >
0 commit comments