-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added banner component * trigger new now preview build * export banner component * code review fixes * exported also subscribe component
- Loading branch information
Showing
5 changed files
with
96 additions
and
1 deletion.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import React from "react"; | ||
import PropTypes from "prop-types"; | ||
import "./banner.scss"; | ||
|
||
export const Banner = ({ color, title, link }) => { | ||
return ( | ||
<div className={`banner-wrapper is-${color}`}> | ||
<div className="banner"> | ||
<div className="title"> | ||
<a | ||
href="${link}" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
{title || ""} | ||
</a> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
Banner.propTypes = { | ||
color: PropTypes.oneOf(["red", "pink", "green", "yellow"]), | ||
title: PropTypes.string.isRequired, | ||
link: PropTypes.string.isRequired | ||
}; | ||
|
||
Banner.defaultProps = { | ||
color: 'yellow' | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
@import "~bulma/sass/utilities/_all.sass"; | ||
|
||
$info-card-colors: ( | ||
'red': #FF1616, | ||
'pink': #F5BCD6, | ||
'green': #05D6C7, | ||
'yellow': #FFDE59); | ||
|
||
.banner-wrapper { | ||
width: 100%; | ||
} | ||
|
||
.banner { | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: center; | ||
align-items: center; | ||
min-height:50px; | ||
} | ||
|
||
.title { | ||
width: 100%; | ||
display: flex; | ||
justify-content: center; | ||
|
||
a { | ||
font-size: 1rem; | ||
font-weight: 400; | ||
color: #000; | ||
text-decoration: underline; | ||
|
||
} | ||
} | ||
|
||
@each $color-name, $color-value in $info-card-colors{ | ||
&.is-#{$color-name} { | ||
.banner{ | ||
background-color: $color-value; | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React from "react"; | ||
import { Banner } from "./banner"; | ||
|
||
import "./../../styles.scss"; | ||
|
||
export default { title: "Banner" }; | ||
|
||
export const defaultColor = () => ( | ||
<Banner title="15 RECOMANDĂRI privind conduita socială responsabilă în prevenirea răspândirii coronavirus. " link="https://code4.ro" /> | ||
); | ||
|
||
export const green = () => ( | ||
<Banner color="green" title="15 RECOMANDĂRI privind conduita socială responsabilă în prevenirea răspândirii coronavirus. " link="https://code4.ro" /> | ||
); | ||
|
||
export const yellow = () => ( | ||
<Banner color="yellow" title="15 RECOMANDĂRI privind conduita socială responsabilă în prevenirea răspândirii coronavirus. " link="https://code4.ro" /> | ||
); |
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