Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(apm): adding paidy logo #84

Merged
merged 1 commit into from
Jan 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"standard-version": "^9.5.0"
},
"dependencies": {
"@paypal/sdk-constants": "^1.0.127",
"@paypal/sdk-constants": "^1.0.128",
"@krakenjs/belter": "^2.0.0",
"@krakenjs/jsx-pragmatic": "^3.0.0"
},
Expand Down
1 change: 1 addition & 0 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const LOGO = {
MERCADOPAGO: ("mercadopago": "mercadopago"),
MULTIBANCO: ("multibanco": "multibanco"),
SATISPAY: ("satispay": "satispay"),
PAIDY: ("paidy": "paidy"),
};

export const LOGO_COLOR = {
Expand Down
1 change: 1 addition & 0 deletions src/logos/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ export * from "./maxima";
export * from "./mercadopago";
export * from "./multibanco";
export * from "./satispay";
export * from "./paidy";
3 changes: 3 additions & 0 deletions src/logos/paidy/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/* @flow */

export * from "./logo";
130 changes: 130 additions & 0 deletions src/logos/paidy/logo.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
/* @flow */
/** @jsx node */

import { node, type ComponentNode } from "@krakenjs/jsx-pragmatic/src";

import { SVGLogo, getLogoColors, type SVGLogoProps } from "../../lib";
import { LOGO_COLOR, LOGO } from "../../constants";
import { type LogoColorMap } from "../../types";

const LOGO_COLORS: LogoColorMap = {
[LOGO_COLOR.DEFAULT]: {
primary: "#FFFFFF",
secondary: "#FFFFFF",
tertiary: "#FFFFFF",
},
[LOGO_COLOR.WHITE]: {
primary: "#FFFFFF",
secondary: "#FFFFFF",
tertiary: "#FFFFFF",
},
[LOGO_COLOR.BLACK]: {
primary: "#A6009C",
secondary: "#FF009C",
tertiary: "#1C1C1C",
},
};

export function PaidyLogo({
logoColor = LOGO_COLOR.BLACK,
...props
}: {
logoColor?: $Values<typeof LOGO_COLOR>,
}): ComponentNode<SVGLogoProps> {
const { primary, secondary, tertiary } = getLogoColors(
LOGO.PAIDY,
LOGO_COLORS,
logoColor
);

return (
<SVGLogo
{...props}
name={LOGO.PAIDY}
logoColor={logoColor}
render={() => {
return (
<svg
width="79"
height="22"
viewBox="0 0 79 22"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M9.8735 9.10432C9.78191 8.9761 8.7561 7.73047 8.7561 7.73047V15.6622C8.7561 16.3033 9.28733 16.8346 9.92846 16.8346C10.5696 16.8346 11.1008 16.3033 11.1008 15.6622L11.0825 10.4415C10.7345 10.0935 10.4047 9.72714 9.8735 9.10432Z"
fill="url(#paint0_linear_553_11067)"
/>
<path
d="M20.6261 13.7752C20.2231 13.7752 19.8385 13.6836 19.4904 13.5187C19.4721 13.7752 19.5637 14.5629 18.3181 15.4604C18.2265 15.5154 13.244 18.6844 12.1998 19.2157C10.8443 19.8934 9.34222 19.6919 8.46295 19.234C8.1149 19.0874 3.7552 16.4863 3.57202 16.358C3.2423 16.1199 2.71107 15.6803 2.54621 15.0941C2.39967 14.5995 2.39967 13.8118 2.39967 13.8118V7.21732C2.39967 6.19151 2.69276 4.3597 4.5612 3.5537C6.55787 2.82098 7.63863 3.97502 8.68276 5.23897C8.75604 5.33056 10.7893 8.02331 11.6869 8.81099C12.841 9.8368 14.0133 10.368 15.4055 10.368C19.179 10.368 20.6078 7.38218 20.6078 5.18401C20.6078 2.3264 18.2631 0 15.3872 0C13.6103 0 11.9617 0.897585 11.0092 2.38135C11.1923 2.58285 11.632 3.13239 11.7052 3.20566C11.7236 3.22398 12.4746 4.19484 12.5112 4.24979C12.6395 4.08493 13.7202 2.38135 15.3872 2.38135C17.0908 2.38135 18.1898 3.70025 18.1898 5.18401C18.1898 6.72273 16.9442 7.96836 15.4238 7.96836C14.5262 7.96836 13.9584 7.65695 13.244 7.01582C12.5296 6.37469 10.7527 4.02998 10.7527 4.02998C10.6062 3.82848 9.36053 2.34471 8.48127 1.75853C7.38218 1.02581 5.84346 0.567859 3.77352 1.26395C1.7219 1.96003 0 4.17652 0 7.23564L0.0183178 13.8301C0.0183178 14.0866 -2.83879e-07 14.9109 0.201498 15.6803C0.531224 16.9625 1.15404 17.6769 2.41798 18.4646C3.02248 18.8127 6.50291 20.8826 7.03414 21.1757C8.05995 21.7252 9.06744 22 10.423 22C11.4671 22 12.4929 21.7435 13.3539 21.3039C14.746 20.5895 19.2706 17.6953 19.5637 17.5121C20.8826 16.6145 21.9817 15.204 21.8535 13.4638C21.5054 13.6653 21.0841 13.7752 20.6261 13.7752Z"
fill="url(#paint1_linear_553_11067)"
/>
<path
d="M20.6261 12.4928C21.3954 12.4928 22.0182 11.87 22.0182 11.119C22.0182 10.3679 21.3954 9.74512 20.6261 9.74512C19.8567 9.74512 19.2339 10.3679 19.2339 11.119C19.2522 11.8883 19.8567 12.4928 20.6261 12.4928Z"
fill="url(#paint2_linear_553_11067)"
/>
<path
d="M30.0967 21.1573C29.364 21.1573 28.7961 20.5528 28.7961 19.8567V10.258C28.7961 8.44453 30.0601 5.58691 33.8153 5.58691C34.4564 5.58691 38.4864 5.58691 38.4864 10.8625C38.4864 15.9733 35.5372 16.2663 34.3282 16.2663C32.7345 16.2663 31.6904 15.2772 31.379 14.7093V19.8567C31.3973 20.5528 30.8294 21.1573 30.0967 21.1573ZM35.812 10.9541C35.812 9.96493 35.6471 9.17726 35.2441 8.6094C34.8594 8.04154 34.2916 7.78508 33.5955 7.78508C32.8994 7.78508 32.3315 8.04154 31.9469 8.6094C31.5988 9.08567 31.4339 9.87334 31.4339 10.9541C31.4339 11.9433 31.5988 12.676 32.0018 13.1523C32.3865 13.7201 32.9543 13.9766 33.6504 13.9766C34.2916 13.9766 34.8594 13.7201 35.2441 13.1523C35.6471 12.6394 35.812 11.8883 35.812 10.9541Z"
fill={tertiary}
/>
<path
d="M53.5619 16.1016C52.7742 16.1016 52.1331 15.4971 52.1331 14.7644V7.19904C52.1331 6.46631 52.7742 5.86182 53.5619 5.86182C54.3495 5.86182 54.9907 6.46631 54.9907 7.19904V14.7644C54.9907 15.4971 54.3312 16.1016 53.5619 16.1016Z"
fill={tertiary}
/>
<path
d="M53.5804 1.13574C52.7561 1.13574 52.0967 1.81351 52.0967 2.65614C52.0967 3.49877 52.7744 4.17654 53.5804 4.17654C54.3864 4.17654 55.0642 3.49877 55.0642 2.65614C55.0642 1.81351 54.4048 1.13574 53.5804 1.13574Z"
fill={tertiary}
/>
<path
d="M65.6702 0.824219C64.9375 0.824219 64.3696 1.42871 64.3696 2.1248V7.18059C64.0582 6.70432 63.6369 6.26468 63.1056 5.97159C62.6294 5.71514 62.0615 5.58692 61.4204 5.58692C60.2114 5.58692 59.2222 6.09982 58.4345 7.10732C57.7018 8.09649 57.3171 9.39707 57.3171 11.0091C57.3171 12.6577 57.7018 13.9583 58.4345 14.9108C58.8192 15.3871 59.3504 15.7718 59.9916 15.9916C60.6327 16.2114 61.2922 16.3396 61.9882 16.3396C63.2522 16.3396 64.3696 16.0282 65.4504 15.3871C66.4945 14.746 67.044 13.482 67.044 11.6685V2.14312C67.0257 1.37376 66.4212 0.824219 65.6702 0.824219ZM63.8567 13.2439C63.472 13.8117 62.9408 14.0682 62.2081 14.0682C61.4753 14.0682 60.9075 13.8117 60.5594 13.2439C60.1748 12.676 59.9916 11.9067 59.9916 10.8992C59.9916 9.98325 60.1564 9.25053 60.5594 8.73762C60.9441 8.16976 61.4753 7.91331 62.1531 7.91331C62.8492 7.91331 63.4171 8.16976 63.8017 8.70099C64.1864 9.26885 64.3696 10.0016 64.3696 10.8992C64.3879 11.8883 64.2047 12.7126 63.8567 13.2439Z"
fill={tertiary}
/>
<path
d="M48.4695 16.1384C49.2022 16.1384 49.7701 15.5339 49.7701 14.8378V10.1301C49.7701 8.3166 48.5061 5.45898 44.7509 5.45898C44.1098 5.45898 40.0798 5.45898 40.0798 10.7346C40.0798 15.8453 43.029 16.1384 44.238 16.1384C45.8317 16.1384 46.8758 15.1492 47.1872 14.5814V14.8378C47.1689 15.5156 47.7185 16.1384 48.4695 16.1384ZM42.7543 10.8079C42.7543 9.81868 42.9191 9.03101 43.3221 8.46315C43.7068 7.89529 44.2747 7.63883 44.9708 7.63883C45.6668 7.63883 46.2347 7.89529 46.6194 8.46315C46.9674 8.93942 47.1323 9.72709 47.1323 10.8079C47.1323 11.797 46.9674 12.5298 46.5644 13.006C46.1798 13.5739 45.6119 13.8303 44.9158 13.8303C44.2747 13.8303 43.7068 13.5739 43.3221 13.006C42.9191 12.4931 42.7543 11.7604 42.7543 10.8079Z"
fill={tertiary}
/>
<path
d="M70.2682 20.3878C70.2682 20.7725 70.5796 21.0839 70.9094 21.1205C71.697 21.2121 72.9427 21.2121 73.6387 20.6443C74.115 20.2596 74.4997 19.6917 74.8111 18.8308L78.1816 7.52854C78.493 6.66759 77.8336 5.80664 76.9177 5.80664C76.3132 5.80664 75.8003 6.19132 75.6537 6.75918L73.8402 13.0789L72.0268 6.79582C71.8619 6.19132 71.3307 5.80664 70.6895 5.80664C69.737 5.80664 69.0959 6.75918 69.389 7.62013L72.3382 17.3653C72.503 17.9332 72.4664 18.3179 72.1733 18.5377C71.8619 18.7942 71.4772 18.9224 70.9643 18.9224C70.5796 18.9224 70.2316 19.2704 70.2316 19.6551V20.3878H70.2682Z"
fill={tertiary}
/>
<defs>
<linearGradient
id="paint0_linear_553_11067"
x1="1.8347"
y1="19.3989"
x2="20.4582"
y2="2.27174"
gradientUnits="userSpaceOnUse"
>
<stop stop-color={primary} />
<stop offset="1" stop-color={secondary} />
</linearGradient>
<linearGradient
id="paint1_linear_553_11067"
x1="1.92847"
y1="25.6451"
x2="14.6235"
y2="3.65436"
gradientUnits="userSpaceOnUse"
>
<stop offset="0.00901231" stop-color={primary} />
<stop offset="1" stop-color={secondary} />
</linearGradient>
<linearGradient
id="paint2_linear_553_11067"
x1="6.07116"
y1="24.5072"
x2="25.4062"
y2="6.72557"
gradientUnits="userSpaceOnUse"
>
<stop stop-color={primary} />
<stop offset="1" stop-color={secondary} />
</linearGradient>
</defs>
</svg>
);
}}
/>
);
}
1 change: 1 addition & 0 deletions test/tests/funding/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ import "./itau";
import "./mercadopago";
import "./multibanco";
import "./satispay";
import "./paidy";
25 changes: 25 additions & 0 deletions test/tests/funding/paidy.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/* @flow */
/** @jsx node */

import { node, html } from "@krakenjs/jsx-pragmatic/src";

import { PaidyLogo, LOGO_COLOR } from "../../../src";
import { validateSVG } from "../common";

describe("paidy logo rendering happy cases", () => {
it("should render the paidy logo", () => {
const logo = <PaidyLogo />;

const logoHTML = logo.render(html());

validateSVG(logoHTML);
});

it("should render the paidy white logo", () => {
const logo = <PaidyLogo logoColor={LOGO_COLOR.WHITE} />;

const logoHTML = logo.render(html());

validateSVG(logoHTML);
});
});