File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -241,7 +241,7 @@ const Header = ({
241241 } ;
242242
243243 const tweet = ( ) => {
244- const link = `https://twitter.com/intent/tweet?text=Check%20this%20amazing%20app%20http ://unshape .vercel.app/,%20created%20by%20@tapasadhikary%20and%20friends%0A%0A%23DEVCommunity%20%23100DaysOfCode%20%23unshape ` ;
244+ const link = `https://twitter.com/intent/tweet?text=Check%20this%20amazing%20app%20https ://tryshape .vercel.app/,%20created%20by%20@tapasadhikary%20and%20friends%0A%0A%23DEVCommunity%20%23100DaysOfCode%20%23tryshape ` ;
245245 if ( typeof window !== 'undefined' ) {
246246 window . open (
247247 link ,
Original file line number Diff line number Diff line change @@ -411,6 +411,10 @@ const ShapeList = (
411411 }
412412 } ;
413413
414+ const canEditOrDelete = shape => {
415+ return user . email === shape . createdBy ;
416+ }
417+
414418
415419
416420 return (
@@ -500,13 +504,13 @@ const ShapeList = (
500504 </ Button >
501505 </ ShapeActionsPrimary >
502506 < ShapeActionsSecondary >
503- { shape . private ?
507+ { canEditOrDelete ( shape ) ?
504508 < Button title = "Edit Shape" size = 'sm' variant = "outline-secondary" onClick = { ( ) => { performEdit ( shape ) ; console . log ( shape ) } } >
505509 < FiEdit2 />
506510 Edit
507511 </ Button > : null
508512 }
509- { shape . private ?
513+ { canEditOrDelete ( shape ) ?
510514 < Button title = "Delete Shape" size = 'sm' variant = "outline-secondary" onClick = { ( ) => { performDelete ( shape ) ; console . log ( shape ) } } >
511515 < FiTrash2 />
512516 Delete
You can’t perform that action at this time.
0 commit comments