WelcomeLabel.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import React, { Component } from 'react';
  2. import PropTypes from 'prop-types';
  3. import { SVGIcon } from 'ca-ui-toolkit';
  4. import './WelcomeLabel.scss';
  5. export class WelcomeLabel extends Component{
  6. static propTypes = {
  7. /** Custom class name(s) */
  8. className: PropTypes.string,
  9. labels: PropTypes.object.isRequired,
  10. themeValues: PropTypes.object
  11. };
  12. static defaultProps = {
  13. }
  14. constructor(props) {
  15. super(props);
  16. }
  17. renderLogo() {
  18. const { themeValues } = this.props;
  19. if (themeValues && themeValues.images && themeValues.images.brandIcon && themeValues.images.brandIcon !== 'common-CA_Avatar_Colour_64' ) {
  20. return (<img className="homeWelcomeLogo" src={themeValues.images.brandIcon} />);
  21. }
  22. return (
  23. <SVGIcon className='homeWelcomeLogo' size='xlarge' iconId='common-CA_Avatar_Colour_64'></SVGIcon>
  24. );
  25. }
  26. render() {
  27. return (
  28. <div className='WelcomeLabel'>
  29. { this.renderLogo() }
  30. <div className='promptLabel'>
  31. <div className='primaryWelcomeMsg'>
  32. {this.props.labels.welcome}
  33. </div>
  34. <div className='secondaryWelcomeMsg'>
  35. {this.props.labels.secondaryWelcomeMsg}
  36. </div>
  37. </div>
  38. </div>
  39. );
  40. }
  41. }