Skip to content

Commit 40ea640

Browse files
authored
Merge pull request #2146 from StoDevX/duplicate-gradients
Fix duplicated gradients
2 parents 3c8418d + 954fdd8 commit 40ea640

File tree

3 files changed

+35
-13
lines changed

3 files changed

+35
-13
lines changed

source/views/home/edit/row.android.js

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,31 @@ export class EditHomeRow extends React.PureComponent<Props> {
6868

6969
render() {
7070
const {item, isFirst, isLast} = this.props
71+
const tint = item.gradient ? item.gradient[0] : item.tint
72+
7173
return (
7274
<View style={styles.row}>
73-
<MenuIcon icon={this.props.item.icon} tint={item.tint} />
75+
<MenuIcon icon={this.props.item.icon} tint={tint} />
7476

75-
<Text style={[styles.text, {color: item.tint}]}>{item.title}</Text>
77+
<Text style={[styles.text, {color: tint}]}>{item.title}</Text>
7678

7779
<Switch
7880
onValueChange={this.onToggleSwitch}
7981
value={this.props.isEnabled}
8082
/>
8183

82-
<ArrowIcon dir="up" disabled={isFirst} onPress={this.onMoveUp} />
83-
<ArrowIcon dir="down" disabled={isLast} onPress={this.onMoveDown} />
84+
<ArrowIcon
85+
dir="up"
86+
disabled={isFirst}
87+
onPress={this.onMoveUp}
88+
tint={tint}
89+
/>
90+
<ArrowIcon
91+
dir="down"
92+
disabled={isLast}
93+
onPress={this.onMoveDown}
94+
tint={tint}
95+
/>
8496
</View>
8597
)
8698
}
@@ -90,8 +102,9 @@ type ArrowIconProps = {
90102
dir: 'up' | 'down',
91103
disabled: boolean,
92104
onPress: () => any,
105+
tint: string,
93106
}
94-
const ArrowIcon = ({dir, disabled, onPress}: ArrowIconProps) => {
107+
const ArrowIcon = ({dir, disabled, onPress, tint}: ArrowIconProps) => {
95108
const icon = `md-arrow-${dir}`
96109
const size = 24
97110

@@ -107,7 +120,7 @@ const ArrowIcon = ({dir, disabled, onPress}: ArrowIconProps) => {
107120

108121
return (
109122
<Touchable borderless={true} onPress={onPress}>
110-
<IonIcon name={icon} size={size} style={styles.icon} />
123+
<IonIcon name={icon} size={size} style={[styles.icon, {color: tint}]} />
111124
</Touchable>
112125
)
113126
}

source/views/home/edit/row.ios.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ const styles = StyleSheet.create({
4040
flexShrink: 0,
4141
fontSize: 18,
4242
color: c.black,
43+
marginRight: 10,
4344
},
4445
})
4546

@@ -161,11 +162,15 @@ export class EditHomeRow extends React.Component<Props, State> {
161162
render() {
162163
const width = this.props.width - ROW_HORIZONTAL_MARGIN * 2
163164

165+
const tint = this.props.data.gradient
166+
? this.props.data.gradient[0]
167+
: this.props.data.tint
168+
164169
return (
165170
<Animated.View style={[styles.row, this.state.style, {width}]}>
166-
<MenuIcon icon={this.props.data.icon} tint={this.props.data.tint} />
171+
<MenuIcon icon={this.props.data.icon} tint={tint} />
167172

168-
<Text style={[styles.text, {color: this.props.data.tint}]}>
173+
<Text style={[styles.text, {color: tint}]}>
169174
{this.props.data.title}
170175
</Text>
171176

@@ -174,7 +179,11 @@ export class EditHomeRow extends React.Component<Props, State> {
174179
value={this.props.isEnabled}
175180
/>
176181

177-
<IonIcon name="ios-reorder" size={32} style={[styles.icon]} />
182+
<IonIcon
183+
name="ios-reorder"
184+
size={32}
185+
style={[styles.icon, {color: tint}]}
186+
/>
178187
</Animated.View>
179188
)
180189
}

source/views/views.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,15 @@ export const allViews: ViewType[] = [
110110
title: 'Campus Dictionary',
111111
icon: 'open-book',
112112
tint: c.olive,
113-
gradient: c.yellowToGoldLight,
113+
gradient: c.pinkToHotpink,
114114
},
115115
{
116116
type: 'view',
117117
view: 'StudentOrgsView',
118118
title: 'Student Orgs',
119119
icon: 'globe',
120120
tint: c.periwinkle,
121-
gradient: c.lightBlueToBlueDark,
121+
gradient: c.tealToSeafoam,
122122
},
123123
{
124124
type: 'url',
@@ -127,15 +127,15 @@ export const allViews: ViewType[] = [
127127
title: 'Moodle',
128128
icon: 'graduation-cap',
129129
tint: c.cantaloupe,
130-
gradient: c.yellowToGoldDark,
130+
gradient: c.yellowToGoldLight,
131131
},
132132
{
133133
type: 'view',
134134
view: 'HelpView',
135135
title: 'Report A Problem',
136136
icon: 'help',
137137
tint: c.lavender,
138-
gradient: c.purpleToIndigo,
138+
gradient: c.seafoamToGrass,
139139
},
140140
]
141141

0 commit comments

Comments
 (0)