Skip to content

Commit

Permalink
Propagate the compact flag through mailchimp wrapper (#80)
Browse files Browse the repository at this point in the history
* Fix linting errors

* Propagate the compact flag through mailchimp wrapper

* Bump patch
  • Loading branch information
andreicioban authored Mar 22, 2020
1 parent 572eb18 commit bbdbeb1
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@code4ro/taskforce-fe-components",
"version": "0.1.11",
"version": "0.1.12",
"private": false,
"dependencies": {
"bulma": "^0.8.0",
Expand Down
8 changes: 2 additions & 6 deletions src/components/banner/banner.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ export const Banner = ({ color, title, link }) => {
<div className={`banner-wrapper is-${color}`}>
<div className="banner">
<div className="title">
<a
href="${link}"
target="_blank"
rel="noopener noreferrer"
>
<a href={link} target="_blank" rel="noopener noreferrer">
{title || ""}
</a>
</div>
Expand All @@ -27,5 +23,5 @@ Banner.propTypes = {
};

Banner.defaultProps = {
color: 'yellow'
color: "yellow"
};
17 changes: 14 additions & 3 deletions src/components/banner/banner.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,24 @@ 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" />
<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" />
<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" />
<Banner
color="yellow"
title="15 RECOMANDĂRI privind conduita socială responsabilă în prevenirea răspândirii coronavirus. "
link="https://code4.ro"
/>
);
6 changes: 4 additions & 2 deletions src/components/subscribe/mailchimp-subscribe.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from "prop-types";
import { SubscribeForm } from "./subscribe-form";
import { sendSubscriptionRequest } from "./mailchimp.service";

export const MailchimpSubscribe = ({ url }) => {
export const MailchimpSubscribe = ({ url, compact }) => {
const [isLoading, setIsLoading] = useState(false);
const [isSuccess, setIsSuccess] = useState();
const [errorMessage, setErrorMessage] = useState();
Expand All @@ -26,10 +26,12 @@ export const MailchimpSubscribe = ({ url }) => {
loading={isLoading}
success={isSuccess}
errorMessage={errorMessage}
compact={compact}
/>
);
};

MailchimpSubscribe.propTypes = {
url: PropTypes.string.isRequired
url: PropTypes.string.isRequired,
compact: PropTypes.bool
};
6 changes: 6 additions & 0 deletions src/components/subscribe/mailchimp-subscribe.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ export const mailchimpSubscribe = () => {
);
};

export const mailchimpSubscribeCompact = () => (
<Wrapper classes="column is-one-fifth">
<MailchimpSubscribe url="" compact={true} />
</Wrapper>
);

export const subscribe = () => (
<Wrapper>
<SubscribeForm onSubmit={logOnSubmit} />
Expand Down

1 comment on commit bbdbeb1

@vercel
Copy link

@vercel vercel bot commented on bbdbeb1 Mar 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.