@thecb/components 11.10.0-beta.1 → 11.10.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, { Fragment } from "react";
|
|
2
|
-
import styled from "styled-components";
|
|
1
|
+
import React, { Fragment, useContext } from "react";
|
|
2
|
+
import styled, { ThemeContext } from "styled-components";
|
|
3
3
|
import CardType from "../card-type";
|
|
4
4
|
import Text from "../text";
|
|
5
5
|
import { Box, Stack } from "../layouts";
|
|
@@ -27,10 +27,12 @@ const FormattedCreditCard = ({
|
|
|
27
27
|
expireDate,
|
|
28
28
|
expirationStatus,
|
|
29
29
|
themeValues
|
|
30
|
-
}) =>
|
|
30
|
+
}) => {
|
|
31
|
+
const { isMobile } = useContext(ThemeContext);
|
|
32
|
+
return (
|
|
31
33
|
<CreditCardWrapper>
|
|
32
34
|
<CCIconWrapper>
|
|
33
|
-
<CardType type={type} size="large" />
|
|
35
|
+
<CardType type={type} size={isMobile ? "small" : "large"} />
|
|
34
36
|
</CCIconWrapper>
|
|
35
37
|
<Stack childGap="0">
|
|
36
38
|
<Box padding="0">
|
|
@@ -58,7 +60,8 @@ const FormattedCreditCard = ({
|
|
|
58
60
|
)}
|
|
59
61
|
</Stack>
|
|
60
62
|
</CreditCardWrapper>
|
|
61
|
-
);
|
|
63
|
+
);
|
|
64
|
+
};
|
|
62
65
|
export default themeComponent(
|
|
63
66
|
FormattedCreditCard,
|
|
64
67
|
"FormattedCreditCard",
|