mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-29 04:35:36 +08:00
Remove unused styles (#22083)
Summary: Removes unused styles. NOTE: Lint rule `react-native/no-unused-styles` not added because of custom lint rule internally at Facebook that does this. Pull Request resolved: https://github.com/facebook/react-native/pull/22083 Differential Revision: D12929443 Pulled By: TheSavior fbshipit-source-id: d42b0be3db745e445447e65df3b78b61f53e4229
This commit is contained in:
committed by
Facebook Github Bot
parent
84c5416617
commit
ffd7195543
@@ -87,12 +87,6 @@ const styles = StyleSheet.create({
|
|||||||
textAlign: 'left',
|
textAlign: 'left',
|
||||||
top: -3,
|
top: -3,
|
||||||
},
|
},
|
||||||
buffer: {
|
|
||||||
fontSize: 10,
|
|
||||||
color: 'yellow',
|
|
||||||
flex: 1,
|
|
||||||
textAlign: 'center',
|
|
||||||
},
|
|
||||||
innerText: {
|
innerText: {
|
||||||
color: 'yellow',
|
color: 'yellow',
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
|
|||||||
@@ -53,11 +53,6 @@ const styles = StyleSheet.create({
|
|||||||
container: {
|
container: {
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
},
|
},
|
||||||
row: {
|
|
||||||
flexDirection: 'row',
|
|
||||||
alignItems: 'center',
|
|
||||||
justifyContent: 'space-around',
|
|
||||||
},
|
|
||||||
attr: {
|
attr: {
|
||||||
fontSize: 10,
|
fontSize: 10,
|
||||||
color: '#ccc',
|
color: '#ccc',
|
||||||
|
|||||||
@@ -57,10 +57,6 @@ const styles = StyleSheet.create({
|
|||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
alignSelf: 'center',
|
alignSelf: 'center',
|
||||||
},
|
},
|
||||||
textColumn: {
|
|
||||||
flex: 1,
|
|
||||||
flexDirection: 'column',
|
|
||||||
},
|
|
||||||
imageWide: {
|
imageWide: {
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
borderColor: 'black',
|
borderColor: 'black',
|
||||||
|
|||||||
@@ -259,16 +259,9 @@ const styles = StyleSheet.create({
|
|||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
flex: 1,
|
flex: 1,
|
||||||
},
|
},
|
||||||
url: {
|
|
||||||
fontSize: 9,
|
|
||||||
marginBottom: 14,
|
|
||||||
},
|
|
||||||
image: {
|
image: {
|
||||||
margin: 4,
|
margin: 4,
|
||||||
},
|
},
|
||||||
info: {
|
|
||||||
flex: 1,
|
|
||||||
},
|
|
||||||
container: {
|
container: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -57,17 +57,11 @@ const styles = StyleSheet.create({
|
|||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
},
|
},
|
||||||
horizontal: {
|
|
||||||
flexDirection: 'row',
|
|
||||||
},
|
|
||||||
storyBackground: {
|
storyBackground: {
|
||||||
width: 250,
|
width: 250,
|
||||||
height: 150,
|
height: 150,
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
},
|
},
|
||||||
text: {
|
|
||||||
fontSize: 13.5,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports = ImageCapInsetsExample;
|
module.exports = ImageCapInsetsExample;
|
||||||
|
|||||||
@@ -156,9 +156,6 @@ const styles = StyleSheet.create({
|
|||||||
padding: 10,
|
padding: 10,
|
||||||
marginBottom: 10,
|
marginBottom: 10,
|
||||||
},
|
},
|
||||||
buttonText: {
|
|
||||||
fontSize: 16,
|
|
||||||
},
|
|
||||||
viewContainer: {
|
viewContainer: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
|
|||||||
@@ -65,12 +65,6 @@ class IntentAndroidExample extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
container: {
|
|
||||||
flex: 1,
|
|
||||||
backgroundColor: 'white',
|
|
||||||
padding: 10,
|
|
||||||
paddingTop: 30,
|
|
||||||
},
|
|
||||||
button: {
|
button: {
|
||||||
padding: 10,
|
padding: 10,
|
||||||
backgroundColor: '#3B5998',
|
backgroundColor: '#3B5998',
|
||||||
|
|||||||
@@ -223,13 +223,6 @@ const styles = StyleSheet.create({
|
|||||||
color: 'white',
|
color: 'white',
|
||||||
paddingHorizontal: 8,
|
paddingHorizontal: 8,
|
||||||
},
|
},
|
||||||
rowText: {
|
|
||||||
color: '#888888',
|
|
||||||
},
|
|
||||||
thumbText: {
|
|
||||||
fontSize: 20,
|
|
||||||
color: '#888888',
|
|
||||||
},
|
|
||||||
buttonContents: {
|
buttonContents: {
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
|
|||||||
@@ -119,10 +119,6 @@ const styles = StyleSheet.create({
|
|||||||
flex: 1,
|
flex: 1,
|
||||||
backgroundColor: 'white',
|
backgroundColor: 'white',
|
||||||
},
|
},
|
||||||
singleLine: {
|
|
||||||
fontSize: 16,
|
|
||||||
padding: 4,
|
|
||||||
},
|
|
||||||
text: {
|
text: {
|
||||||
margin: 10,
|
margin: 10,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -230,9 +230,6 @@ const styles = StyleSheet.create({
|
|||||||
borderColor: '#f0f0f0',
|
borderColor: '#f0f0f0',
|
||||||
backgroundColor: '#f9f9f9',
|
backgroundColor: '#f9f9f9',
|
||||||
},
|
},
|
||||||
bottomSpacer: {
|
|
||||||
marginBottom: 100,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
exports.framework = 'React';
|
exports.framework = 'React';
|
||||||
|
|||||||
@@ -69,16 +69,6 @@ const styles = StyleSheet.create({
|
|||||||
descriptionText: {
|
descriptionText: {
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
},
|
},
|
||||||
disclosure: {
|
|
||||||
position: 'absolute',
|
|
||||||
top: 0,
|
|
||||||
right: 0,
|
|
||||||
padding: 10,
|
|
||||||
},
|
|
||||||
disclosureIcon: {
|
|
||||||
width: 12,
|
|
||||||
height: 8,
|
|
||||||
},
|
|
||||||
children: {
|
children: {
|
||||||
margin: 10,
|
margin: 10,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -69,10 +69,6 @@ class SlidingCompleteExample extends React.Component<
|
|||||||
}
|
}
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
slider: {
|
|
||||||
height: 10,
|
|
||||||
margin: 10,
|
|
||||||
},
|
|
||||||
text: {
|
text: {
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
|
|||||||
@@ -518,11 +518,6 @@ const styles = StyleSheet.create({
|
|||||||
backgroundColor: '#eeeeee',
|
backgroundColor: '#eeeeee',
|
||||||
padding: 10,
|
padding: 10,
|
||||||
},
|
},
|
||||||
title: {
|
|
||||||
marginTop: 16,
|
|
||||||
marginBottom: 8,
|
|
||||||
fontWeight: 'bold',
|
|
||||||
},
|
|
||||||
modalButton: {
|
modalButton: {
|
||||||
marginTop: 10,
|
marginTop: 10,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -490,9 +490,6 @@ class AutogrowingTextInputExample extends React.Component<
|
|||||||
}
|
}
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
page: {
|
|
||||||
paddingBottom: 300,
|
|
||||||
},
|
|
||||||
default: {
|
default: {
|
||||||
borderWidth: StyleSheet.hairlineWidth,
|
borderWidth: StyleSheet.hairlineWidth,
|
||||||
borderColor: '#0f0f0f',
|
borderColor: '#0f0f0f',
|
||||||
@@ -520,13 +517,6 @@ const styles = StyleSheet.create({
|
|||||||
fontFamily: 'Cochin',
|
fontFamily: 'Cochin',
|
||||||
height: 60,
|
height: 60,
|
||||||
},
|
},
|
||||||
multilineChild: {
|
|
||||||
width: 50,
|
|
||||||
height: 40,
|
|
||||||
position: 'absolute',
|
|
||||||
right: 5,
|
|
||||||
backgroundColor: 'red',
|
|
||||||
},
|
|
||||||
eventLabel: {
|
eventLabel: {
|
||||||
margin: 3,
|
margin: 3,
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
|
|||||||
@@ -467,10 +467,6 @@ const styles = StyleSheet.create({
|
|||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
},
|
},
|
||||||
icon: {
|
|
||||||
width: 24,
|
|
||||||
height: 24,
|
|
||||||
},
|
|
||||||
image: {
|
image: {
|
||||||
width: 50,
|
width: 50,
|
||||||
height: 50,
|
height: 50,
|
||||||
|
|||||||
@@ -362,10 +362,6 @@ const styles = StyleSheet.create({
|
|||||||
color: 'white',
|
color: 'white',
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
},
|
},
|
||||||
spinner: {
|
|
||||||
width: 20,
|
|
||||||
marginRight: 6,
|
|
||||||
},
|
|
||||||
buttons: {
|
buttons: {
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
height: 30,
|
height: 30,
|
||||||
|
|||||||
@@ -21,32 +21,31 @@ const ClippableView = requireNativeComponent('ClippableView');
|
|||||||
|
|
||||||
class ClippingSample1 extends React.Component {
|
class ClippingSample1 extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
const styles = sample1Styles;
|
|
||||||
return (
|
return (
|
||||||
<View>
|
<View>
|
||||||
<ClippableView
|
<ClippableView
|
||||||
clippableViewID="outer"
|
clippableViewID="outer"
|
||||||
style={styles.outer}
|
style={sample1Styles.outer}
|
||||||
removeClippedSubviews={true}>
|
removeClippedSubviews={true}>
|
||||||
<ClippableView
|
<ClippableView
|
||||||
clippableViewID="inner1"
|
clippableViewID="inner1"
|
||||||
style={[styles.inner, styles.inner1]}
|
style={[sample1Styles.inner, sample1Styles.inner1]}
|
||||||
/>
|
/>
|
||||||
<ClippableView
|
<ClippableView
|
||||||
clippableViewID="inner2"
|
clippableViewID="inner2"
|
||||||
style={[styles.inner, styles.inner2]}
|
style={[sample1Styles.inner, sample1Styles.inner2]}
|
||||||
/>
|
/>
|
||||||
<ClippableView
|
<ClippableView
|
||||||
clippableViewID="inner3"
|
clippableViewID="inner3"
|
||||||
style={[styles.inner, styles.inner3]}
|
style={[sample1Styles.inner, sample1Styles.inner3]}
|
||||||
/>
|
/>
|
||||||
<ClippableView
|
<ClippableView
|
||||||
clippableViewID="inner4"
|
clippableViewID="inner4"
|
||||||
style={[styles.inner, styles.inner4]}
|
style={[sample1Styles.inner, sample1Styles.inner4]}
|
||||||
/>
|
/>
|
||||||
<ClippableView
|
<ClippableView
|
||||||
clippableViewID="inner5"
|
clippableViewID="inner5"
|
||||||
style={[styles.inner, styles.inner5]}
|
style={[sample1Styles.inner, sample1Styles.inner5]}
|
||||||
/>
|
/>
|
||||||
</ClippableView>
|
</ClippableView>
|
||||||
</View>
|
</View>
|
||||||
@@ -90,32 +89,31 @@ const sample1Styles = StyleSheet.create({
|
|||||||
|
|
||||||
class ClippingSample2 extends React.Component {
|
class ClippingSample2 extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
const styles = sample2Styles;
|
|
||||||
return (
|
return (
|
||||||
<View>
|
<View>
|
||||||
<ClippableView
|
<ClippableView
|
||||||
clippableViewID="outer"
|
clippableViewID="outer"
|
||||||
style={styles.outer}
|
style={sample2Styles.outer}
|
||||||
removeClippedSubviews={true}>
|
removeClippedSubviews={true}>
|
||||||
<ClippableView
|
<ClippableView
|
||||||
clippableViewID="complexInner"
|
clippableViewID="complexInner"
|
||||||
style={styles.complexInner}
|
style={sample2Styles.complexInner}
|
||||||
removeClippedSubviews={true}>
|
removeClippedSubviews={true}>
|
||||||
<ClippableView
|
<ClippableView
|
||||||
clippableViewID="inner1"
|
clippableViewID="inner1"
|
||||||
style={[styles.inner, styles.inner1]}
|
style={[sample2Styles.inner, sample2Styles.inner1]}
|
||||||
/>
|
/>
|
||||||
<ClippableView
|
<ClippableView
|
||||||
clippableViewID="inner2"
|
clippableViewID="inner2"
|
||||||
style={[styles.inner, styles.inner2]}
|
style={[sample2Styles.inner, sample2Styles.inner2]}
|
||||||
/>
|
/>
|
||||||
<ClippableView
|
<ClippableView
|
||||||
clippableViewID="inner3"
|
clippableViewID="inner3"
|
||||||
style={[styles.inner, styles.inner3]}
|
style={[sample2Styles.inner, sample2Styles.inner3]}
|
||||||
/>
|
/>
|
||||||
<ClippableView
|
<ClippableView
|
||||||
clippableViewID="inner4"
|
clippableViewID="inner4"
|
||||||
style={[styles.inner, styles.inner4]}
|
style={[sample2Styles.inner, sample2Styles.inner4]}
|
||||||
/>
|
/>
|
||||||
</ClippableView>
|
</ClippableView>
|
||||||
</ClippableView>
|
</ClippableView>
|
||||||
@@ -164,17 +162,21 @@ const sample2Styles = StyleSheet.create({
|
|||||||
|
|
||||||
class UpdatingSample1 extends React.Component {
|
class UpdatingSample1 extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
const styles = updating1Styles;
|
|
||||||
const inner1Styles = [
|
const inner1Styles = [
|
||||||
styles.inner1,
|
updating1Styles.inner1,
|
||||||
{height: this.props.update1 ? 200 : 100},
|
{height: this.props.update1 ? 200 : 100},
|
||||||
];
|
];
|
||||||
const inner2Styles = [styles.inner2, {top: this.props.update2 ? 200 : 50}];
|
|
||||||
|
const inner2Styles = [
|
||||||
|
updating1Styles.inner2,
|
||||||
|
{top: this.props.update2 ? 200 : 50},
|
||||||
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View>
|
<View>
|
||||||
<ClippableView
|
<ClippableView
|
||||||
clippableViewID="outer"
|
clippableViewID="outer"
|
||||||
style={styles.outer}
|
style={updating1Styles.outer}
|
||||||
removeClippedSubviews={true}>
|
removeClippedSubviews={true}>
|
||||||
<ClippableView clippableViewID="inner1" style={inner1Styles} />
|
<ClippableView clippableViewID="inner1" style={inner1Styles} />
|
||||||
<ClippableView clippableViewID="inner2" style={inner2Styles} />
|
<ClippableView clippableViewID="inner2" style={inner2Styles} />
|
||||||
@@ -210,15 +212,21 @@ const updating1Styles = StyleSheet.create({
|
|||||||
|
|
||||||
class UpdatingSample2 extends React.Component {
|
class UpdatingSample2 extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
const styles = updating2Styles;
|
const outerStyles = [
|
||||||
const outerStyles = [styles.outer, {height: this.props.update ? 200 : 100}];
|
updating2Styles.outer,
|
||||||
|
{height: this.props.update ? 200 : 100},
|
||||||
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View>
|
<View>
|
||||||
<ClippableView
|
<ClippableView
|
||||||
clippableViewID="outer"
|
clippableViewID="outer"
|
||||||
style={outerStyles}
|
style={outerStyles}
|
||||||
removeClippedSubviews={true}>
|
removeClippedSubviews={true}>
|
||||||
<ClippableView clippableViewID="inner" style={styles.inner} />
|
<ClippableView
|
||||||
|
clippableViewID="inner"
|
||||||
|
style={updating2Styles.inner}
|
||||||
|
/>
|
||||||
</ClippableView>
|
</ClippableView>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
@@ -242,11 +250,14 @@ const updating2Styles = StyleSheet.create({
|
|||||||
|
|
||||||
class ScrollViewTest extends React.Component {
|
class ScrollViewTest extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
const styles = scrollTestStyles;
|
|
||||||
const children = [];
|
const children = [];
|
||||||
for (let i = 0; i < 4; i++) {
|
for (let i = 0; i < 4; i++) {
|
||||||
children[i] = (
|
children[i] = (
|
||||||
<ClippableView key={i} style={styles.row} clippableViewID={'' + i} />
|
<ClippableView
|
||||||
|
key={i}
|
||||||
|
style={scrollTestStyles.row}
|
||||||
|
clippableViewID={'' + i}
|
||||||
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
for (let i = 4; i < 6; i++) {
|
for (let i = 4; i < 6; i++) {
|
||||||
@@ -254,11 +265,17 @@ class ScrollViewTest extends React.Component {
|
|||||||
children[i] = (
|
children[i] = (
|
||||||
<ClippableView
|
<ClippableView
|
||||||
key={i}
|
key={i}
|
||||||
style={styles.complex}
|
style={scrollTestStyles.complex}
|
||||||
clippableViewID={viewID}
|
clippableViewID={viewID}
|
||||||
removeClippedSubviews={true}>
|
removeClippedSubviews={true}>
|
||||||
<ClippableView style={styles.inner} clippableViewID={viewID + '.1'} />
|
<ClippableView
|
||||||
<ClippableView style={styles.inner} clippableViewID={viewID + '.2'} />
|
style={scrollTestStyles.inner}
|
||||||
|
clippableViewID={viewID + '.1'}
|
||||||
|
/>
|
||||||
|
<ClippableView
|
||||||
|
style={scrollTestStyles.inner}
|
||||||
|
clippableViewID={viewID + '.2'}
|
||||||
|
/>
|
||||||
</ClippableView>
|
</ClippableView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -266,7 +283,7 @@ class ScrollViewTest extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<ScrollView
|
<ScrollView
|
||||||
removeClippedSubviews={true}
|
removeClippedSubviews={true}
|
||||||
style={styles.scrollView}
|
style={scrollTestStyles.scrollView}
|
||||||
testID="scroll_view">
|
testID="scroll_view">
|
||||||
{children}
|
{children}
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|||||||
@@ -48,13 +48,6 @@ const FlexTestAppStyles = StyleSheet.create({
|
|||||||
child: {
|
child: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
},
|
},
|
||||||
absolute: {
|
|
||||||
position: 'absolute',
|
|
||||||
top: 15,
|
|
||||||
left: 10,
|
|
||||||
width: 50,
|
|
||||||
height: 60,
|
|
||||||
},
|
|
||||||
bgRed: {
|
bgRed: {
|
||||||
backgroundColor: '#ff0000',
|
backgroundColor: '#ff0000',
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user