-
Notifications
You must be signed in to change notification settings - Fork 576
/
Copy pathpoweredBy.jsx
56 lines (48 loc) · 1.46 KB
/
poweredBy.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/* @flow */
/** @jsx node */
import { node, type ChildType } from "@krakenjs/jsx-pragmatic/src";
import { type LocaleType } from "@paypal/sdk-constants/src";
import { LOGO_COLOR, LOGO_CLASS } from "@paypal/sdk-logos/src";
import { CLASS } from "../../constants";
import { Text } from "../text";
import { buttonContent } from "./content";
const POWERED_BY_PAYPAL_STYLE = `
.${CLASS.POWERED_BY} {
text-align: center;
margin: 10px auto;
height: 14px;
font-family: PayPalPlain-Regular, system-ui, -apple-system, Roboto, "Segoe UI", Helvetica-Neue, Helvetica, Arial, sans-serif;
font-size: 11px;
font-weight: 400;
font-style: italic;
font-stretch: normal;
color: #7b8388;
position: relative;
margin-right: 3px;
bottom: 3px;
}
.${CLASS.POWERED_BY} > .${CLASS.TEXT},
.${CLASS.POWERED_BY} > .${LOGO_CLASS.LOGO} {
display: inline-block;
vertical-align: middle;
height: 16px;
line-height: 16px;
font-size: 11px;
}
`;
type PoweredByPayPalProps = {|
locale: LocaleType,
nonce: string,
|};
export function PoweredByPayPal({
locale: { lang },
nonce,
}: PoweredByPayPalProps): ChildType {
const { PoweredBy } = buttonContent[lang];
return (
<div class={CLASS.POWERED_BY}>
<style nonce={nonce} innerHTML={POWERED_BY_PAYPAL_STYLE} />
{__WEB__ ? <Text /> : <PoweredBy logoColor={LOGO_COLOR.BLUE} />}
</div>
);
}