Last active
April 4, 2020 18:59
-
-
Save anuk79/8ca90c664864e0b389565e6ca65280a6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
LoadingSpinnerStyled, | |
ErrorStyled, | |
} from './user.styled'; | |
export class User extends Component { | |
render() { | |
const { fetching, userDetails, errorFlag } = this.props; | |
let content; | |
if(fetching) { | |
content = <LoadingSpinnerStyled customClassName="user-loading-spinner" /> | |
} else if(errorFlag) { | |
content = ( | |
<ErrorStyled>{'Some error occurred. Please try again later.'}</ErrorStyled> | |
); | |
} else { | |
content = <UserView userDetails={userDetails} /> | |
} | |
return content; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment