You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

49 rivejä
1.7 KiB

  1. import { Portal } from '@/types';
  2. import { withBasePath } from '@/lib/url';
  3. export default function HeroBanner({ portal }: { portal: Partial<Portal> }) {
  4. const themeColor = portal?.themeColor || '#1e3a8a';
  5. const heroImageUrl = withBasePath(portal?.heroImageUrl);
  6. const logoUrl = withBasePath(portal?.logoUrl);
  7. return (
  8. <div
  9. className="relative text-white text-center py-20 px-4 min-h-[40vh] flex flex-col justify-center"
  10. style={{
  11. backgroundImage: heroImageUrl ? `url(${heroImageUrl})` : 'none',
  12. backgroundSize: 'cover',
  13. backgroundPosition: 'center',
  14. backgroundColor: themeColor
  15. }}
  16. >
  17. {/* Dynamic Overlay: Either a solid dark tint, or a fade into the theme color */}
  18. <div
  19. className="absolute inset-0"
  20. style={{
  21. background: portal?.fadeHeroImage
  22. ? `linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, ${themeColor} 100%)`
  23. : 'rgba(0,0,0,0.6)'
  24. }}
  25. ></div>
  26. <div className="relative z-10 max-w-4xl mx-auto flex flex-col items-center">
  27. {logoUrl && (
  28. <img
  29. src={logoUrl}
  30. alt="Institution Logo"
  31. className="h-24 mb-6 object-contain"
  32. />
  33. )}
  34. <h1 className="text-4xl md:text-5xl lg:text-6xl font-bold mb-6 drop-shadow-md">
  35. {portal?.title || 'Welcome to the Network'}
  36. </h1>
  37. <div
  38. className="text-lg md:text-2xl drop-shadow-md font-light"
  39. dangerouslySetInnerHTML={{
  40. __html: portal?.welcomeText || 'Please contact administration to set up.',
  41. }}
  42. />
  43. </div>
  44. </div>
  45. );
  46. }