From b1dc4b20b73223629f2a65e24d015654756ad772 Mon Sep 17 00:00:00 2001 From: Sumanth U <157620444+Sumanth077s@users.noreply.github.com> Date: Fri, 29 Nov 2024 18:10:40 +0530 Subject: [PATCH] Update Photo.js --- 19-stock-photos/final/src/Photo.js | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/19-stock-photos/final/src/Photo.js b/19-stock-photos/final/src/Photo.js index 7262d742f..ed620f97b 100644 --- a/19-stock-photos/final/src/Photo.js +++ b/19-stock-photos/final/src/Photo.js @@ -1,25 +1,34 @@ import React from 'react' const Photo = ({ - urls: { regular }, - alt_description, - likes, + urls: { regular }, // Destructuring the 'regular' URL from 'urls' for the image source + alt_description, // Destructuring the 'alt_description' for the alt text of the image + likes, // Destructuring the number of 'likes' for the photo user: { - name, - portfolio_url, - profile_image: { medium }, + name, // Destructuring the 'name' of the user who uploaded the photo + portfolio_url, // Destructuring the user's 'portfolio_url' for the link to their profile + profile_image: { medium }, // Destructuring the 'medium' profile image URL of the user }, }) => { return ( -
- {alt_description} +
+ {/* The photo article containing the image and the user info */} + {alt_description} + {/* Display the image using the 'regular' URL with the 'alt_description' as alt text */} +
+ {/* Div containing photo information */}
-

{name}

+

{name}

+ {/* Display the user's name */}

{likes} likes

+ {/* Display the number of likes */}
+ + {/* Link to the user's portfolio */} + {/* Display the user's profile image */}