@momo-kits/foundation 0.77.2-beta.4 → 0.77.2-beta.7

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/Layout/Card.tsx CHANGED
@@ -4,9 +4,10 @@ import {useGridSystem, validateChildren} from './utils';
4
4
  import {CardProps, GridContextProps} from './types';
5
5
  import {GridContext} from './index';
6
6
  import Item from './Item';
7
+ import {Image} from '../Image';
7
8
  import {ApplicationContext} from '../Application';
8
9
 
9
- const Card: React.FC<CardProps> = ({children, style}) => {
10
+ const Card: React.FC<CardProps> = ({children, style, backgroundImage}) => {
10
11
  const {showGrid} = useContext(ApplicationContext);
11
12
  const {numberOfColumns} = useGridSystem();
12
13
 
@@ -131,6 +132,22 @@ const Card: React.FC<CardProps> = ({children, style}) => {
131
132
  flexWrap: 'wrap',
132
133
  },
133
134
  ]}>
135
+ {!!backgroundImage && (
136
+ <Image
137
+ source={{uri: backgroundImage}}
138
+ style={[
139
+ style,
140
+ {
141
+ position: 'absolute',
142
+ width: widthSection,
143
+ top: 0,
144
+ bottom: 0,
145
+ left: 0,
146
+ right: 0,
147
+ },
148
+ ]}
149
+ />
150
+ )}
134
151
  {renderView(validateChildren(children, [Item]))}
135
152
  {showGrid && renderOverlay()}
136
153
  </View>
package/Layout/types.ts CHANGED
@@ -58,4 +58,5 @@ export interface ItemProps extends ViewProps {
58
58
 
59
59
  export interface CardProps extends ViewProps {
60
60
  background?: string;
61
+ backgroundImage?: string;
61
62
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.77.2-beta.04",
3
+ "version": "0.77.2-beta.07",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {