Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Feat/accordian disable row" #3352

Merged
merged 1 commit into from
Jan 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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