This repository was archived by the owner on Feb 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 168
Select autopilot during wallet setup. #1258
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
cf430b3
Add copy prop to SettingItem component.
valentinewallace 507c9aa
Add select autopilot view for mobile.
valentinewallace 9512fc3
Add nav action mobile to screen storybook.
valentinewallace d7a777b
Wire up Select Autopilot mobile view.
valentinewallace a69eb0c
Create new SettingsCopy component and update Select Autopilot styles.
valentinewallace c95a9a3
Refactor SettingCopyItem styles
tanx 95e022a
Cleanup select-atpl-mobile.js
tanx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| import React from 'react'; | ||
| import { View } from 'react-native'; | ||
| import { createStyles, maxWidth } from '../component/media-query'; | ||
| import { observer } from 'mobx-react'; | ||
| import PropTypes from 'prop-types'; | ||
| import Background from '../component/background'; | ||
| import MainContent from '../component/main-content'; | ||
| import { CopyOnboardText, Text } from '../component/text'; | ||
| import { RadioButton, GlasButton } from '../component/button'; | ||
| import { SettingCopyItem } from '../component/setting'; | ||
| import { color, font, smallBreakWidth } from '../component/style'; | ||
|
|
||
| // | ||
| // Select Autopilot View | ||
| // | ||
|
|
||
| const baseStyles = { | ||
| content: { | ||
| paddingLeft: 20, | ||
| paddingRight: 20, | ||
| }, | ||
| title: { | ||
| marginTop: 80, | ||
| textAlign: 'center', | ||
| }, | ||
| copyTxt: { | ||
| textAlign: 'center', | ||
| marginTop: 20, | ||
| maxWidth: 260, | ||
| }, | ||
| list: { | ||
| marginTop: 40, | ||
| width: undefined, | ||
| alignSelf: 'stretch', | ||
| }, | ||
| }; | ||
|
|
||
| const styles = createStyles( | ||
| baseStyles, | ||
|
|
||
| maxWidth(smallBreakWidth, { | ||
| title: { | ||
| fontSize: font.sizeL + 10, | ||
| lineHeight: font.sizeL + 10, | ||
| marginTop: 40, | ||
| }, | ||
| list: { | ||
| marginTop: 50, | ||
| }, | ||
| }) | ||
| ); | ||
|
|
||
| const SelectAutopilotView = ({ store, autopilot, info }) => ( | ||
| <Background color={color.blackDark}> | ||
| <MainContent style={styles.content}> | ||
| <CopyOnboardText style={styles.title}> | ||
| Automatically set up channels? | ||
| </CopyOnboardText> | ||
| <Text style={styles.copyTxt}> | ||
| { | ||
| "If you want to avoid manual channel creation, the app can allocate funds to channels for you. It's called autopilot." | ||
| } | ||
| </Text> | ||
| <View style={styles.list}> | ||
| <SettingCopyItem | ||
| name="Use autopilot (recommended)" | ||
| copy="I want the app to create channels and move my funds into those channels automatically." | ||
| onSelect={() => !store.settings.autopilot && autopilot.toggle()} | ||
| > | ||
| <RadioButton selected={store.settings.autopilot === true} /> | ||
| </SettingCopyItem> | ||
| <SettingCopyItem | ||
| name="Create channels manually" | ||
| copy="I don't want the app to automatically create channels for me. I can do this all myself." | ||
| onSelect={() => store.settings.autopilot && autopilot.toggle()} | ||
| > | ||
| <RadioButton selected={store.settings.autopilot === false} /> | ||
| </SettingCopyItem> | ||
| </View> | ||
| </MainContent> | ||
| <GlasButton onPress={() => info.initLoaderSyncing()}>Save</GlasButton> | ||
| </Background> | ||
| ); | ||
|
|
||
| SelectAutopilotView.propTypes = { | ||
| store: PropTypes.object.isRequired, | ||
| autopilot: PropTypes.object.isRequired, | ||
| info: PropTypes.object.isRequired, | ||
| }; | ||
|
|
||
| export default observer(SelectAutopilotView); | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the word "recommended" because I think it's an improvement. Feel free to request removal if you prefer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense 👍