Skip to content

Commit

Permalink
Merge pull request #3352 from GeekyAnts/revert-3240-feat/accordianDis…
Browse files Browse the repository at this point in the history
…ableRow

Revert "Feat/accordian disable row"
  • Loading branch information
shivrajkumar committed Jan 7, 2021
2 parents f48f8a7 + a3e78a1 commit 6e2ca10
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 23 deletions.
18 changes: 4 additions & 14 deletions src/basic/Accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ const styles = StyleSheet.create({
class DefaultHeader extends React.Component {
render() {
const {
disable,
expanded,
expandedIcon,
expandedIconStyle,
Expand All @@ -42,10 +41,7 @@ class DefaultHeader extends React.Component {
headerStyle || { backgroundColor: variables.headerStyle }
]}
>
<Text style={{ color: disable ? variable.disableRow : null }}>
{' '}
{title}
</Text>
<Text> {title}</Text>
<Icon
style={[
{ fontSize: variables.accordionIconFontSize },
Expand All @@ -55,8 +51,7 @@ class DefaultHeader extends React.Component {
: { color: variables.expandedIconStyle }
: icon && iconStyle
? iconStyle
: { color: disable ? variable.disableRow : variables.iconStyle },

: { color: variables.iconStyle }
]}
name={
expanded ? expandedIcon || 'ios-arrow-up' : icon || 'ios-arrow-down'
Expand Down Expand Up @@ -112,7 +107,6 @@ class AccordionItem extends React.Component {
render() {
const {
contentStyle,
disable,
expanded,
expandedIcon,
expandedIconStyle,
Expand All @@ -130,7 +124,6 @@ class AccordionItem extends React.Component {
return (
<View>
<TouchableWithoutFeedback
disabled={disable}
onPress={() => {
onAccordionOpen && !expanded && onAccordionOpen(item, index);
onAccordionClose && expanded && onAccordionClose(item, index);
Expand All @@ -142,7 +135,7 @@ class AccordionItem extends React.Component {
renderHeader(item, expanded, index)
) : (
<DefaultHeader
disable={disable}
title={item.title}
expanded={expanded}
headerStyle={headerStyle}
icon={icon}
Expand Down Expand Up @@ -181,7 +174,7 @@ export class Accordion extends React.Component {
selected = expandMultiple ? selected : selected.slice(0, 1);
}
this.state = {
selected: props.expanded,
selected
};
}

Expand All @@ -201,7 +194,6 @@ export class Accordion extends React.Component {
const {
contentStyle,
dataArray,
disable,
expandedIcon,
expandedIconStyle,
headerStyle,
Expand Down Expand Up @@ -230,7 +222,6 @@ export class Accordion extends React.Component {
keyExtractor={(item, index) => String(index)}
renderItem={({ item, index }) => (
<AccordionItem
disable={disable == index ? true : false}
key={String(index)}
item={item}
expanded={this.state.selected.indexOf(index) !== -1}
Expand All @@ -246,7 +237,6 @@ export class Accordion extends React.Component {
expandedIconStyle={expandedIconStyle}
onAccordionOpen={onAccordionOpen}
onAccordionClose={onAccordionClose}
setSelected={(i) => this.setSelected(i)}
/>
)}
{...this.props}
Expand Down
1 change: 0 additions & 1 deletion src/theme/variables/commonColor.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export default {
contentStyle: '#f5f4f5',
expandedIconStyle: '#000',
accordionBorderColor: '#d3d3d3',
disableRow: '#a9a9a9',

// ActionSheet
elevation: 4,
Expand Down
17 changes: 10 additions & 7 deletions src/theme/variables/material.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export default {
contentStyle: '#f5f4f5',
expandedIconStyle: '#000',
accordionBorderColor: '#d3d3d3',
disableRow: '#a9a9a9',

// ActionSheet
elevation: 4,
Expand Down Expand Up @@ -181,10 +180,14 @@ export default {
toolbarDefaultBorder: '#3F51B5',
iosStatusbar: 'light-content',
get statusBarColor() {
return color(this.toolbarDefaultBg).darken(0.2).hex();
return color(this.toolbarDefaultBg)
.darken(0.2)
.hex();
},
get darkenHeader() {
return color(this.tabBgColor).darken(0.03).hex();
return color(this.tabBgColor)
.darken(0.03)
.hex();
},

// Icon
Expand Down Expand Up @@ -289,13 +292,13 @@ export default {
topInset: 24,
leftInset: 0,
rightInset: 0,
bottomInset: 34,
bottomInset: 34
},
landscape: {
topInset: 0,
leftInset: 44,
rightInset: 44,
bottomInset: 21,
},
},
bottomInset: 21
}
}
};
1 change: 0 additions & 1 deletion src/theme/variables/platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export default {
expandedIconStyle: '#000',
headerStyle: '#edebed',
iconStyle: '#000',
disableRow: '#a9a9a9',

// ActionSheet
elevation: 4,
Expand Down

0 comments on commit 6e2ca10

Please sign in to comment.