Skip to content

Commit 85d8441

Browse files
authored
SkeletonView - support content visible on start (#1664)
* SkeletonView - support content visible on start * Fix some types
1 parent 808c98b commit 85d8441

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

generatedTypes/src/components/skeletonView/index.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import React, { Component } from 'react';
22
import { Animated, StyleProp, ViewStyle, AccessibilityProps } from 'react-native';
3-
declare enum Template {
3+
export declare enum Template {
44
LIST_ITEM = "listItem",
55
TEXT_CONTENT = "content"
66
}
7-
declare enum Size {
7+
export declare enum Size {
88
SMALL = "small",
99
LARGE = "large"
1010
}
11-
declare enum ContentType {
11+
export declare enum ContentType {
1212
AVATAR = "avatar",
1313
THUMBNAIL = "thumbnail"
1414
}

src/components/skeletonView/index.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ let ShimmerPlaceholder: any;
1414

1515
const ANIMATION_DURATION = 400;
1616

17-
enum Template {
17+
export enum Template {
1818
LIST_ITEM = 'listItem',
1919
TEXT_CONTENT = 'content'
2020
}
2121

22-
enum Size {
22+
export enum Size {
2323
SMALL = 'small',
2424
LARGE = 'large'
2525
}
2626

27-
enum ContentType {
27+
export enum ContentType {
2828
AVATAR = 'avatar',
2929
THUMBNAIL = 'thumbnail'
3030
}
@@ -165,17 +165,17 @@ class SkeletonView extends Component<SkeletonViewProps, SkeletonState> {
165165
borderRadius: BorderRadiuses.br10
166166
};
167167

168-
static templates = Template;
169-
static sizes = Size;
170-
static contentTypes = ContentType;
168+
static templates: typeof Template = Template;
169+
static sizes: typeof Size = Size;
170+
static contentTypes: typeof ContentType = ContentType;
171171

172172
fadeInAnimation?: Animated.CompositeAnimation;
173173

174174
constructor(props: SkeletonViewProps) {
175175
super(props);
176176

177177
this.state = {
178-
isAnimating: !_.isUndefined(props.showContent),
178+
isAnimating: props.showContent === false,
179179
opacity: new Animated.Value(0)
180180
};
181181

0 commit comments

Comments
 (0)