github.com/quickfeed/quickfeed@v0.0.0-20240507093252-ed8ca812a09c/public/src/components/profile/ProfileInfo.tsx (about)

     1  import React, { Dispatch, SetStateAction } from 'react'
     2  import { useAppState } from '../../overmind'
     3  
     4  /** ProfileInfo displays the user's profile information. */
     5  const ProfileInfo = ({ setEditing }: { setEditing: Dispatch<SetStateAction<boolean>> }): JSX.Element => {
     6      const self = useAppState().self
     7  
     8      return (
     9          <>
    10              <div className='card-text text-center'>
    11                  <h2 className='mb-4'>
    12                      {self.Name}
    13                  </h2>
    14              </div>
    15              <div className='card-text text-center'>
    16                  <i className='fa fa-envelope text-muted' />
    17                  <span className='ml-3'>{self.Email}</span>
    18              </div>
    19              <div className='card-text text-center'>
    20                  <i className='fa fa-graduation-cap text-muted' />
    21                  <span className='ml-3'>{self.StudentID}</span>
    22              </div>
    23              <span className="badge float-right clickable" onClick={() => setEditing(true)}><i className='fa fa-edit' /></span>
    24          </>
    25      )
    26  }
    27  
    28  export default ProfileInfo