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

Several layout improvements #2606

Merged
merged 3 commits into from
Jan 2, 2025
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
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
Loading