Skip to content

Commit cebf155

Browse files
Chandrasekar-Gandrewda
authored andcommitted
Migrate LoadingRepositoryList to styled-components (#839)
1 parent e668b04 commit cebf155

File tree

1 file changed

+44
-49
lines changed

1 file changed

+44
-49
lines changed
Lines changed: 44 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,45 @@
11
import React, { Component } from 'react';
2-
import { StyleSheet, Animated, View } from 'react-native';
2+
import { Animated } from 'react-native';
3+
import styled from 'styled-components';
34

45
import { colors } from 'config';
56
import { loadingAnimation } from 'utils';
67

7-
const styles = StyleSheet.create({
8-
container: {
9-
paddingTop: 20,
10-
paddingRight: 20,
11-
paddingBottom: 20,
12-
height: 100,
13-
borderBottomColor: '#ededed',
14-
borderBottomWidth: 1,
15-
backgroundColor: 'transparent',
16-
},
17-
wrapper: {
18-
flex: 1,
19-
flexDirection: 'column',
20-
marginLeft: 10,
21-
},
22-
textBarTitle: {
23-
height: 7,
24-
width: 100,
25-
backgroundColor: colors.greyDarkest,
26-
marginBottom: 10,
27-
},
28-
textBarLine1: {
29-
height: 7,
30-
width: 250,
31-
backgroundColor: colors.grey,
32-
marginBottom: 10,
33-
},
34-
textBarLine2: {
35-
height: 7,
36-
width: 80,
37-
backgroundColor: colors.grey,
38-
},
39-
});
8+
const Container = styled.View`
9+
padding-top: 20;
10+
padding-right: 20;
11+
padding-bottom: 20;
12+
height: 100;
13+
border-bottom-color: #ededed;
14+
border-bottom-width: 1;
15+
background-color: transparent;
16+
`;
17+
18+
const Wrapper = styled.View`
19+
flex: 1;
20+
flex-direction: column;
21+
margin-left: 10;
22+
`;
23+
24+
const TextBarTitle = styled(Animated.View)`
25+
height: 7;
26+
width: 100;
27+
background-color: ${colors.greyDarkest};
28+
margin-bottom: 10;
29+
`;
30+
31+
const TextBarLine1 = styled(Animated.View)`
32+
height: 7;
33+
width: 250;
34+
background-color: ${colors.grey};
35+
margin-bottom: 10;
36+
`;
37+
38+
const TextBarLine2 = styled(Animated.View)`
39+
height: 7;
40+
width: 80;
41+
background-color: ${colors.grey};
42+
`;
4043

4144
export class LoadingRepositoryListItem extends Component {
4245
constructor(props) {
@@ -52,21 +55,13 @@ export class LoadingRepositoryListItem extends Component {
5255

5356
render() {
5457
return (
55-
<View style={styles.container}>
56-
<View style={styles.wrapper}>
57-
<Animated.View
58-
style={[styles.textBarTitle, { opacity: this.state.fadeAnimValue }]}
59-
/>
60-
61-
<Animated.View
62-
style={[styles.textBarLine1, { opacity: this.state.fadeAnimValue }]}
63-
/>
64-
65-
<Animated.View
66-
style={[styles.textBarLine2, { opacity: this.state.fadeAnimValue }]}
67-
/>
68-
</View>
69-
</View>
58+
<Container>
59+
<Wrapper>
60+
<TextBarTitle style={{ opacity: this.state.fadeAnimValue }} />
61+
<TextBarLine1 style={{ opacity: this.state.fadeAnimValue }} />
62+
<TextBarLine2 style={{ opacity: this.state.fadeAnimValue }} />
63+
</Wrapper>
64+
</Container>
7065
);
7166
}
7267
}

0 commit comments

Comments
 (0)