CSS Style- icon for login account

i am looking to design the SignIn option in my react Project, i came across one of the icon as solid image.


i understand i can use it using className , css properties and using the script link from fontawesome.com

I am thinking if i can use this icon when the user signed in correctly but also picks up the user first account and display as CustomerName in place for user-circle.
my guess is that i will need some java script code here but not sure where to start and if it is even possible.

Any advice please guys.