pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 1 | import { Component } from "react"; |
| 2 | import Styles from '../styles/header.module.css'; |
| 3 | |
| 4 | class Header extends Component { |
| 5 | constructor(props) { |
| 6 | super(props); |
Samuel Shuert | 604e31d | 2021-09-02 16:06:20 -0500 | [diff] [blame] | 7 | this.keys = [] |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 8 | } |
| 9 | |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 10 | render() { |
| 11 | return ( |
| 12 | <div className={Styles.header} style={{ |
| 13 | backgroundImage:`linear-gradient(69.44deg, #${this.props.gradient[0]} 0%, #${this.props.gradient[1]} 100%)`, |
| 14 | margin: "0" |
| 15 | }} id={this.props.id ? this.props.id : null}> |
pineafan | aed3024 | 2021-09-04 09:33:40 +0100 | [diff] [blame] | 16 | <img alt="" className={Styles.backgroundImage} src={`/Headers/${this.props.wave}.svg`} /> |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 17 | <div className={Styles.panel}> |
| 18 | <div className={Styles.titleContainer}> |
| 19 | <h1 className={Styles.title}>{this.props.name}</h1> |
| 20 | </div> |
| 21 | <p className={Styles.subtext + " " + (this.props.buttons.length ? Styles.subtextExtra : null)}>{this.props.subtext}</p> |
| 22 | <div className={Styles.buttonLayout}> |
| 23 | { |
Samuel Shuert | 604e31d | 2021-09-02 16:06:20 -0500 | [diff] [blame] | 24 | this.props.buttons ? this.props.buttons.map((button, index) => { |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 25 | return <a |
Samuel Shuert | 604e31d | 2021-09-02 16:06:20 -0500 | [diff] [blame] | 26 | key={index} |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 27 | className={Styles.button} |
| 28 | style={{backgroundColor:`#${button.color}`, color:`#${button.buttonText}`}} |
Samuel Shuert | 835c71f | 2021-09-03 15:49:26 -0500 | [diff] [blame] | 29 | href={button.link} |
pineafan | aed3024 | 2021-09-04 09:33:40 +0100 | [diff] [blame] | 30 | target={button.target ? "_blank" : null} |
| 31 | rel="noreferror"> |
Samuel Shuert | 835c71f | 2021-09-03 15:49:26 -0500 | [diff] [blame] | 32 | {button.text} |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 33 | </a> |
| 34 | }) : null |
| 35 | } |
| 36 | </div> |
| 37 | </div> |
| 38 | <span className={Styles.arrowSpan + " " + (this.props.hideArrow ? Styles.arrowHidden : null)}> |
pineafan | aed3024 | 2021-09-04 09:33:40 +0100 | [diff] [blame] | 39 | <a href="#start"><img alt="Down arrow" src="/Arrow.svg" className={Styles.arrow} /></a> |
pineafan | a5ce910 | 2021-09-02 17:21:31 +0100 | [diff] [blame] | 40 | </span> |
| 41 | </div> |
| 42 | ) |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | export default Header; |