@@ -20,12 +20,12 @@ const vscodeDevUrl = "https://vscode.dev/edu/makecode/"
2020
2121export interface ShareInfoProps {
2222 projectName : string ;
23- description ?: string ;
23+ projectDescription ?: string ;
2424 screenshotUri ?: string ;
2525 isLoggedIn ?: boolean ;
2626 hasProjectBeenPersistentShared ?: boolean ;
2727 simRecorder : SimRecorder ;
28- publishAsync : ( name : string , screenshotUri ?: string , forceAnonymous ?: boolean ) => Promise < ShareData > ;
28+ publishAsync : ( name : string , description ?: string , screenshotUri ?: string , forceAnonymous ?: boolean ) => Promise < ShareData > ;
2929 isMultiplayerGame ?: boolean ; // Arcade: Does the game being shared have multiplayer enabled?
3030 kind ?: "multiplayer" | "vscode" | "share" ; // Arcade: Was the share dialog opened specifically for hosting a multiplayer game?
3131 anonymousShareByDefault ?: boolean ;
@@ -37,7 +37,7 @@ export interface ShareInfoProps {
3737export const ShareInfo = ( props : ShareInfoProps ) => {
3838 const {
3939 projectName,
40- description ,
40+ projectDescription ,
4141 screenshotUri,
4242 isLoggedIn,
4343 simRecorder,
@@ -50,6 +50,7 @@ export const ShareInfo = (props: ShareInfoProps) => {
5050 onClose,
5151 } = props ;
5252 const [ name , setName ] = React . useState ( projectName ) ;
53+ const [ description , setDescription ] = React . useState ( projectDescription ) ;
5354 const [ thumbnailUri , setThumbnailUri ] = React . useState ( screenshotUri ) ;
5455 const [ shareState , setShareState ] = React . useState < "share" | "gifrecord" | "publish" | "publish-vscode" | "publishing" > ( "share" ) ;
5556 const [ shareData , setShareData ] = React . useState < ShareData > ( ) ;
@@ -95,7 +96,7 @@ export const ShareInfo = (props: ShareInfoProps) => {
9596 const handlePublishClick = async ( ) => {
9697 setShareState ( "publishing" ) ;
9798 setLastShareWasAnonymous ( isAnonymous ) ;
98- let publishedShareData = await publishAsync ( name , thumbnailUri , isAnonymous ) ;
99+ let publishedShareData = await publishAsync ( name , description , thumbnailUri , isAnonymous ) ;
99100 setShareData ( publishedShareData ) ;
100101 if ( ! publishedShareData ?. error ) setShareState ( "publish" ) ;
101102 else setShareState ( "share" )
@@ -104,7 +105,7 @@ export const ShareInfo = (props: ShareInfoProps) => {
104105 const handlePublishInVscodeClick = async ( ) => {
105106 setShareState ( "publishing" ) ;
106107 setLastShareWasAnonymous ( isAnonymous ) ;
107- let publishedShareData = await publishAsync ( name , thumbnailUri , isAnonymous ) ;
108+ let publishedShareData = await publishAsync ( name , description , thumbnailUri , isAnonymous ) ;
108109 setShareData ( publishedShareData ) ;
109110 if ( ! publishedShareData ?. error ) {
110111 setShareState ( "publish-vscode" ) ;
@@ -238,9 +239,9 @@ export const ShareInfo = (props: ShareInfoProps) => {
238239 const handleMultiplayerShareConfirmClick = async ( ) => {
239240 setShareState ( "publishing" ) ;
240241 setIsShowingMultiConfirmation ( false ) ;
241- setLastShareWasAnonymous ( isAnonymous ) ;
242+ setLastShareWasAnonymous ( isAnonymous ) ;
242243
243- const publishedShareData = await publishAsync ( name , thumbnailUri , isAnonymous ) ;
244+ const publishedShareData = await publishAsync ( name , description , thumbnailUri , isAnonymous ) ;
244245
245246 // TODO multiplayer: This won't work on staging (parseScriptId domains check doesn't include staging urls)
246247 // but those wouldn't load anyways (as staging multiplayer is currently fetching games from prod links)
@@ -322,7 +323,7 @@ export const ShareInfo = (props: ShareInfoProps) => {
322323 if ( setAnonymousSharePreference ) setAnonymousSharePreference ( ! newValue ) ;
323324 }
324325
325- const inputTitle = prePublish ? lf ( "Project Title " ) :
326+ const inputTitle = prePublish ? lf ( "Project Name " ) :
326327 ( shareState === "publish-vscode" ? lf ( "Share Successful" ) : lf ( "Project Link" ) ) ;
327328
328329 const shareAttemptWasAnonymous = lastShareWasAnonymous === undefined ? isAnonymous : lastShareWasAnonymous ;
@@ -378,6 +379,19 @@ export const ShareInfo = (props: ShareInfoProps) => {
378379 onBlur = { setName }
379380 onEnterKey = { setName }
380381 preserveValueOnBlur = { true } />
382+ { pxt . appTarget . appTheme . showProjectDescription && < >
383+ < div className = "project-share-title project-share-label" id = "share-description-title" >
384+ { lf ( "Project Description" ) }
385+ </ div >
386+ < Textarea
387+ ariaDescribedBy = "share-description-title"
388+ ariaLabel = { lf ( "Type a description for your project" ) }
389+ initialValue = { projectDescription || '' }
390+ onChange = { setDescription }
391+ id = "projectDescriptionTextareaShare"
392+ resize = "vertical"
393+ />
394+ </ > }
381395 { isLoggedIn && hasProjectBeenPersistentShared && < Checkbox
382396 id = "persistent-share-checkbox"
383397 label = { lf ( "Update existing share link for this project" ) }
0 commit comments