Skip to content

Commit

Permalink
several layout improvements / more consistent implementation of layout
Browse files Browse the repository at this point in the history
  • Loading branch information
myxmaster committed Dec 23, 2024
1 parent c6ffab9 commit 34ad548
Show file tree
Hide file tree
Showing 9 changed files with 913 additions and 856 deletions.
21 changes: 9 additions & 12 deletions components/Text.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as React from 'react';
import { Text, TextStyle, TouchableOpacity } from 'react-native';
import { inject, observer } from 'mobx-react';
import { Row } from './layout/Row';

import { themeColor } from './../utils/ThemeUtils';

Expand Down Expand Up @@ -34,16 +33,14 @@ export default class ZeusText extends React.Component<TextProps, {}> {
const { toggleInfoModal } = ModalStore!;

const CoreText = () => (
<Row>
<Text
style={{
fontFamily: 'PPNeueMontreal-Book',
color: themeColor('text'),
...style
}}
>
{children}
</Text>
<Text
style={{
fontFamily: 'PPNeueMontreal-Book',
color: themeColor('text'),
...style
}}
>
{children}
{infoModalText && (
<Text
style={{
Expand All @@ -55,7 +52,7 @@ export default class ZeusText extends React.Component<TextProps, {}> {
{' ⓘ'}
</Text>
)}
</Row>
</Text>
);

if (infoModalText) {
Expand Down
345 changes: 201 additions & 144 deletions views/Receive.tsx

Large diffs are not rendered by default.

230 changes: 129 additions & 101 deletions views/Settings/ChannelsSettings.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { StyleSheet, Text, View, ScrollView } from 'react-native';
import { inject, observer } from 'mobx-react';
import { StackNavigationProp } from '@react-navigation/stack';

Expand Down Expand Up @@ -100,9 +100,11 @@ export default class ChannelsSettings extends React.Component<
}}
navigation={navigation}
/>
<View
<ScrollView
style={{
padding: 20
flex: 1,
paddingHorizontal: 15,
marginTop: 5
}}
>
<Text
Expand Down Expand Up @@ -133,136 +135,162 @@ export default class ChannelsSettings extends React.Component<
}}
/>

<>
<Text
style={{
top: 20,
color: themeColor('secondaryText')
}}
>
{localeString('views.OpenChannel.announceChannel')}
</Text>
<Switch
value={!privateChannel}
onValueChange={async () => {
this.setState({
privateChannel: !privateChannel
});
await updateSettings({
channels: {
min_confs,
privateChannel: !privateChannel,
scidAlias,
simpleTaprootChannel
}
});
}}
disabled={simpleTaprootChannel}
/>
</>

{BackendUtils.isLNDBased() && (
<>
<View style={{ flexDirection: 'row', marginTop: 20 }}>
<View style={{ flex: 1 }}>
<Text
style={{
top: 20,
color: themeColor('secondaryText')
color: themeColor('secondaryText'),
fontSize: 17
}}
>
{localeString('views.OpenChannel.scidAlias')}
{localeString(
'views.OpenChannel.announceChannel'
)}
</Text>
</View>
<View style={{ alignSelf: 'center', marginLeft: 5 }}>
<Switch
value={scidAlias}
value={!privateChannel}
onValueChange={async () => {
this.setState({
scidAlias: !scidAlias
privateChannel: !privateChannel
});
await updateSettings({
channels: {
min_confs,
privateChannel,
scidAlias: !scidAlias,
privateChannel: !privateChannel,
scidAlias,
simpleTaprootChannel
}
});
}}
disabled={simpleTaprootChannel}
/>
</>
)}
</View>
</View>

{BackendUtils.supportsSimpleTaprootChannels() && (
<>
<Text
style={{
top: 20,
color: themeColor('secondaryText')
}}
{BackendUtils.isLNDBased() && (
<View style={{ flexDirection: 'row', marginTop: 20 }}>
<View style={{ flex: 1 }}>
<Text
style={{
color: themeColor('secondaryText'),
fontSize: 17
}}
>
{localeString(
'views.OpenChannel.scidAlias'
)}
</Text>
</View>
<View
style={{ alignSelf: 'center', marginLeft: 5 }}
>
{localeString(
'views.OpenChannel.simpleTaprootChannel'
)}
</Text>
<Switch
value={simpleTaprootChannel}
onValueChange={async () => {
this.setState({
simpleTaprootChannel:
!simpleTaprootChannel
});

if (!simpleTaprootChannel) {
<Switch
value={scidAlias}
onValueChange={async () => {
this.setState({
privateChannel: true
scidAlias: !scidAlias
});
await updateSettings({
channels: {
min_confs,
privateChannel,
scidAlias: !scidAlias,
simpleTaprootChannel
}
});
}
}}
/>
</View>
</View>
)}

await updateSettings({
channels: {
min_confs,
privateChannel:
!simpleTaprootChannel
? true
: privateChannel,
scidAlias,
{BackendUtils.supportsSimpleTaprootChannels() && (
<View style={{ flexDirection: 'row', marginTop: 20 }}>
<View style={{ flex: 1 }}>
<Text
style={{
color: themeColor('secondaryText'),
fontSize: 17
}}
>
{localeString(
'views.OpenChannel.simpleTaprootChannel'
)}
</Text>
</View>
<View
style={{ alignSelf: 'center', marginLeft: 5 }}
>
<Switch
value={simpleTaprootChannel}
onValueChange={async () => {
this.setState({
simpleTaprootChannel:
!simpleTaprootChannel
});

if (!simpleTaprootChannel) {
this.setState({
privateChannel: true
});
}
});
}}
/>
</>

await updateSettings({
channels: {
min_confs,
privateChannel:
!simpleTaprootChannel
? true
: privateChannel,
scidAlias,
simpleTaprootChannel:
!simpleTaprootChannel
}
});
}}
/>
</View>
</View>
)}

{(BackendUtils.supportsLSPS1customMessage() ||
BackendUtils.supportsLSPS1rest()) && (
<>
<Text
style={{
top: 20,
color: themeColor('secondaryText')
}}
<View style={{ flexDirection: 'row', marginTop: 20 }}>
<View style={{ flex: 1 }}>
<Text
style={{
color: themeColor('secondaryText'),
fontSize: 17
}}
>
{localeString(
'views.Settings.Channels.lsps1ShowPurchaseButton'
)}
</Text>
</View>
<View
style={{ alignSelf: 'center', marginLeft: 5 }}
>
{localeString(
'views.Settings.Channels.lsps1ShowPurchaseButton'
)}
</Text>
<Switch
value={lsps1ShowPurchaseButton}
onValueChange={async () => {
this.setState({
lsps1ShowPurchaseButton:
!lsps1ShowPurchaseButton
});
<Switch
value={lsps1ShowPurchaseButton}
onValueChange={async () => {
this.setState({
lsps1ShowPurchaseButton:
!lsps1ShowPurchaseButton
});

await updateSettings({
lsps1ShowPurchaseButton:
!lsps1ShowPurchaseButton
});
}}
/>
</>
await updateSettings({
lsps1ShowPurchaseButton:
!lsps1ShowPurchaseButton
});
}}
/>
</View>
</View>
)}
</View>
</ScrollView>
</Screen>
);
}
Expand Down
Loading

0 comments on commit 34ad548

Please sign in to comment.