Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Commit a69eb0c

Browse files
valentinewallacetanx
authored andcommitted
Create new SettingsCopy component and update Select Autopilot styles.
1 parent d7a777b commit a69eb0c

File tree

2 files changed

+57
-36
lines changed

2 files changed

+57
-36
lines changed

src/component/setting.js

Lines changed: 48 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -85,20 +85,11 @@ const iStyles = StyleSheet.create({
8585
item: {
8686
height: 60,
8787
},
88-
left: {
89-
flex: 1,
90-
},
9188
name: {
89+
flex: 1,
9290
color: color.grey,
9391
fontSize: font.sizeSub,
9492
},
95-
copy: {
96-
width: '80%',
97-
fontSize: font.sizeS,
98-
lineHeight: font.lineHeightS,
99-
color: color.greyListLabel,
100-
opacity: 0.74,
101-
},
10293
lbl: {
10394
fontSize: font.sizeS,
10495
color: color.greyListLabel,
@@ -109,22 +100,9 @@ const iStyles = StyleSheet.create({
109100
},
110101
});
111102

112-
export const SettingItem = ({
113-
name,
114-
copy,
115-
onSelect,
116-
label,
117-
arrow,
118-
children,
119-
}) => (
120-
<ListItem
121-
style={[iStyles.item, copy ? { height: 80 } : null]}
122-
onSelect={onSelect}
123-
>
124-
<View style={iStyles.left}>
125-
<Text style={iStyles.name}>{name}</Text>
126-
{copy ? <Text style={iStyles.copy}>{copy}</Text> : null}
127-
</View>
103+
export const SettingItem = ({ name, onSelect, label, arrow, children }) => (
104+
<ListItem style={iStyles.item} onSelect={onSelect}>
105+
<Text style={iStyles.name}>{name}</Text>
128106
{label ? <Text style={iStyles.lbl}>{label}</Text> : null}
129107
{children}
130108
{arrow ? (
@@ -137,13 +115,56 @@ export const SettingItem = ({
137115

138116
SettingItem.propTypes = {
139117
name: PropTypes.string.isRequired,
140-
copy: PropTypes.string,
141118
onSelect: PropTypes.func,
142119
label: PropTypes.string,
143120
arrow: PropTypes.bool,
144121
children: PropTypes.node,
145122
};
146123

124+
//
125+
// Setting Copy Item
126+
//
127+
128+
const iCopyStyles = StyleSheet.create({
129+
item: {
130+
height: 100,
131+
},
132+
left: {
133+
flex: 1,
134+
flexDirection: 'column',
135+
justifyContent: 'center',
136+
},
137+
name: {
138+
color: color.grey,
139+
fontSize: font.sizeSub,
140+
marginBottom: 5,
141+
},
142+
copy: {
143+
width: '80%',
144+
fontSize: font.sizeS,
145+
lineHeight: font.lineHeightS,
146+
color: color.greyListLabel,
147+
opacity: 0.74,
148+
},
149+
});
150+
151+
export const SettingCopyItem = ({ name, onSelect, copy, children }) => (
152+
<ListItem style={iCopyStyles.item} onSelect={onSelect}>
153+
<View style={iCopyStyles.left}>
154+
<Text style={iCopyStyles.name}>{name}</Text>
155+
<Text style={iCopyStyles.copy}>{copy}</Text>
156+
</View>
157+
{children}
158+
</ListItem>
159+
);
160+
161+
SettingCopyItem.propTypes = {
162+
name: PropTypes.string.isRequired,
163+
onSelect: PropTypes.func,
164+
copy: PropTypes.string,
165+
children: PropTypes.node,
166+
};
167+
147168
//
148169
// Setting Header
149170
//

src/view/select-atpl-mobile.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import Background from '../component/background';
77
import MainContent from '../component/main-content';
88
import { CopyOnboardText, Text } from '../component/text';
99
import { RadioButton, GlasButton } from '../component/button';
10-
import { SettingItem } from '../component/setting';
10+
import { SettingCopyItem } from '../component/setting';
1111
import { color, font, smallBreakWidth } from '../component/style';
1212

1313
//
@@ -20,16 +20,16 @@ const baseStyles = {
2020
paddingRight: 20,
2121
},
2222
title: {
23-
marginTop: 60,
23+
marginTop: 80,
2424
textAlign: 'center',
2525
},
2626
copyTxt: {
2727
textAlign: 'center',
2828
marginTop: 10,
29-
maxWidth: 300,
29+
maxWidth: 260,
3030
},
3131
list: {
32-
marginTop: 50,
32+
marginTop: 40,
3333
width: undefined,
3434
alignSelf: 'stretch',
3535
},
@@ -62,23 +62,23 @@ const SelectAutopilotView = ({ store, autopilot, info }) => (
6262
}
6363
</Text>
6464
<View style={styles.list}>
65-
<SettingItem
65+
<SettingCopyItem
6666
name="Use autopilot (recommended)"
6767
copy="I want the app to create channels and move my funds into those channels automatically."
6868
onSelect={() => (store.settings.autopilot ? {} : autopilot.toggle())}
6969
>
7070
<RadioButton selected={store.settings.autopilot === true} />
71-
</SettingItem>
72-
<SettingItem
71+
</SettingCopyItem>
72+
<SettingCopyItem
7373
name="Create channels manually"
7474
copy="I don't want the app to automatically create channels for me. I can do this all myself."
7575
onSelect={() => (!store.settings.autopilot ? {} : autopilot.toggle())}
7676
>
7777
<RadioButton selected={store.settings.autopilot === false} />
78-
</SettingItem>
78+
</SettingCopyItem>
7979
</View>
8080
</MainContent>
81-
<GlasButton onPress={() => info.initLoaderSyncing()}>Next</GlasButton>
81+
<GlasButton onPress={() => info.initLoaderSyncing()}>Save</GlasButton>
8282
</Background>
8383
);
8484

0 commit comments

Comments
 (0)