Skip to content

Commit

Permalink
moved themeColor() calls from static styles to render methods
Browse files Browse the repository at this point in the history
  • Loading branch information
myxmaster committed Nov 25, 2023
1 parent 6b4bcf4 commit e4d59f2
Show file tree
Hide file tree
Showing 10 changed files with 159 additions and 84 deletions.
10 changes: 7 additions & 3 deletions components/CollapsedQR.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,17 @@ function ValueText({ value, truncateLongValue }: ValueTextProps) {
}
highlight={false}
>
<Text style={styles.value} numberOfLines={state.numberOfValueLines}>
<Text
style={{ ...styles.value, color: themeColor('secondaryText') }}
numberOfLines={state.numberOfValueLines}
>
{value}
</Text>
</Touchable>
) : (
<Text style={styles.value}>{value}</Text>
<Text style={{ ...styles.value, color: themeColor('secondaryText') }}>
{value}
</Text>
);
}

Expand Down Expand Up @@ -259,7 +264,6 @@ const styles = StyleSheet.create({
value: {
marginBottom: 15,
paddingLeft: 20,
color: themeColor('secondaryText'),
fontFamily: 'PPNeueMontreal-Book'
},
qrPadding: {
Expand Down
31 changes: 9 additions & 22 deletions views/Channels/Channel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,9 @@ export default class ChannelView extends React.Component<
localBalance={lurkerMode ? 50 : localBalance}
remoteBalance={lurkerMode ? 50 : remoteBalance}
/>
<Text style={styles.status}>
<Text
style={{ ...styles.status, color: themeColor('text') }}
>
{pendingOpen
? localeString('views.Channel.pendingOpen')
: pendingClose || closing
Expand Down Expand Up @@ -568,7 +570,12 @@ export default class ChannelView extends React.Component<
<View>
{(BackendUtils.isLNDBased() || !implementation) && (
<>
<Text style={styles.text}>
<Text
style={{
...styles.text,
color: themeColor('text')
}}
>
{localeString(
'views.Channel.closingRate'
)}
Expand Down Expand Up @@ -610,11 +617,6 @@ export default class ChannelView extends React.Component<

const styles = StyleSheet.create({
text: {
color: themeColor('text'),
fontFamily: 'PPNeueMontreal-Book'
},
secondaryText: {
color: themeColor('secondaryText'),
fontFamily: 'PPNeueMontreal-Book'
},
content: {
Expand All @@ -626,7 +628,6 @@ const styles = StyleSheet.create({
},
status: {
fontFamily: 'PPNeueMontreal-Book',
color: themeColor('text'),
alignSelf: 'center',
marginBottom: 10
},
Expand All @@ -639,22 +640,8 @@ const styles = StyleSheet.create({
paddingBottom: 30,
textAlign: 'center'
},
balance: {
fontSize: 15,
fontWeight: 'bold'
},
button: {
paddingTop: 15,
paddingBottom: 15
},
editFeeBox: {
paddingTop: 10,
paddingBottom: 10,
paddingLeft: 15,
marginTop: 15,
flexDirection: 'row',
borderRadius: 4,
borderColor: themeColor('secondaryText'),
borderWidth: 3
}
});
48 changes: 31 additions & 17 deletions views/ContactDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,12 @@ export default class ContactDetails extends React.Component<
>
<LightningBolt />
<Text
style={
styles.contactFields
}
style={{
...styles.contactFields,
color: themeColor(
'chain'
)
}}
>
{address.length > 23
? `${address.substring(
Expand Down Expand Up @@ -326,9 +329,12 @@ export default class ContactDetails extends React.Component<
>
<LightningBolt />
<Text
style={
styles.contactFields
}
style={{
...styles.contactFields,
color: themeColor(
'chain'
)
}}
>
{address.length > 23
? `${address.substring(
Expand Down Expand Up @@ -372,9 +378,12 @@ export default class ContactDetails extends React.Component<
>
<BitcoinIcon />
<Text
style={
styles.contactFields
}
style={{
...styles.contactFields,
color: themeColor(
'chain'
)
}}
>
{address.length > 23
? `${address.substring(
Expand Down Expand Up @@ -413,9 +422,12 @@ export default class ContactDetails extends React.Component<
>
<VerifiedAccount />
<Text
style={
styles.contactFields
}
style={{
...styles.contactFields,
color: themeColor(
'chain'
)
}}
>
{value.length > 15
? `${value.substring(
Expand Down Expand Up @@ -454,9 +466,12 @@ export default class ContactDetails extends React.Component<
<KeySecurity />
</View>
<Text
style={
styles.contactFields
}
style={{
...styles.contactFields,
color: themeColor(
'chain'
)
}}
>
{value.length > 15
? `${value.substring(
Expand Down Expand Up @@ -498,7 +513,6 @@ const styles = StyleSheet.create({
contactFields: {
fontSize: 24,
marginBottom: 4,
marginLeft: 4,
color: themeColor('chain')
marginLeft: 4
}
});
15 changes: 8 additions & 7 deletions views/EditFee.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,14 @@ export default class EditFee extends React.Component<

{!displayOnly && (
<>
<Text style={styles.custom}>
<Text
style={{
fontSize: 18,
top: 48,
left: 15,
color: themeColor('text')
}}
>
{localeString(
'views.EditFee.custom'
)}
Expand Down Expand Up @@ -403,12 +410,6 @@ const styles = StyleSheet.create({
feeText: {
fontSize: 18
},
custom: {
color: themeColor('text'),
fontSize: 18,
top: 48,
left: 15
},
confirmButton: {
marginTop: 20,
width: 350
Expand Down
19 changes: 15 additions & 4 deletions views/LnurlPay/Success.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,27 @@ export default class LnurlPaySuccess extends React.Component<LnurlPaySuccessProp

return scrollable ? (
<ScrollView
style={{ ...styles.container, maxHeight }}
style={{
...styles.container,
borderColor: themeColor('text'),
backgroundColor: themeColor('secondary'),
maxHeight
}}
contentContainerStyle={{ gap: 5, padding: 15 }}
>
{body}
{servicedBy}
</ScrollView>
) : (
<View style={{ ...styles.container, maxHeight, padding: 15 }}>
<View
style={{
...styles.container,
borderColor: themeColor('text'),
backgroundColor: themeColor('secondary'),
maxHeight,
padding: 15
}}
>
{body}
{servicedBy}
</View>
Expand All @@ -138,8 +151,6 @@ const styles = StyleSheet.create({
container: {
borderWidth: 1,
borderRadius: 5,
borderColor: themeColor('text'),
backgroundColor: themeColor('secondary'),
gap: 5
}
});
3 changes: 1 addition & 2 deletions views/Routing/RoutingHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ export function RoutingHeader(props) {
: 120,
padding: 16,
borderBottomLeftRadius: 40,
borderBottomRightRadius: 20,
color: themeColor('text')
borderBottomRightRadius: 20
}
});

Expand Down
Loading

0 comments on commit e4d59f2

Please sign in to comment.