-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Update Enable Payments terms page with updated terms #3879
Merged
Merged
Changes from all commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
a751401
set defualt step to terms for testing
Jag96 9ed0010
get collapsible demo working on native
Jag96 2569859
get collapsible working on web
Jag96 d30d2bb
use collapsibleSection structure
Jag96 cd8c11f
remove unnecessary import
Jag96 c481caf
pass data from terms page
Jag96 d7f4b47
move shared propTypes and defaults to file
Jag96 533230a
clean up inconsistencies
Jag96 b1c2551
get basic table/spacing views added
Jag96 febe9e4
split into long and short form pages
Jag96 4d8d775
add content and initial short form styling
Jag96 e8f0db3
use title
Jag96 1dd8628
add short form terms rows
Jag96 2c2233a
add links
Jag96 7d60c18
update styles, remove unnecessary termsPage
Jag96 8c19923
add spacing for long form
Jag96 3af9007
style collapsible component on web
Jag96 51b8def
get mobile collapsible component styles added
Jag96 3fd1513
add termsData and map function
Jag96 c10e872
add all long form content and en.js translations
Jag96 3c19afd
update long form spanish translations
Jag96 6fbe0cb
add listOfAllFees translation
Jag96 13a8a1f
translate short form
Jag96 067ca47
show open and close arrow for sections
Jag96 f4a98e9
style mobile collapsibles
Jag96 256bbfb
remove duplicated code
Jag96 7066646
use same name
Jag96 ffe4400
merge main
Jag96 1e12498
remove unnecessary view
Jag96 19a81a3
add more information section
Jag96 796e964
translate to spanish
Jag96 08bc872
lint
Jag96 c187568
merge main
Jag96 bf531fa
restyle short term row
Jag96 d632cb4
update spacing for row
Jag96 2e4070c
fix remaining short terms
Jag96 241f19e
re-style supporting text for long form
Jag96 373cefa
re-style long form
Jag96 bdfffc5
remove unused code, add some translations
Jag96 cb2a792
update withdrawal section content
Jag96 7fb67df
fix spacing bug for margins
Jag96 3b986cf
add arrow and printer icons
Jag96 7f14c69
fix links on mobile
Jag96 6b05d70
move checkboxes inside scrollview
Jag96 be34b12
fix right align issue on mobile
Jag96 b97340b
dry short terms views
Jag96 a8081b2
dry long terms views
Jag96 a1b6d5b
remove testing todos, remove unused styles
Jag96 339d50e
move some constantss
Jag96 d8e487b
fix heading space bug on mobile
Jag96 6a43c24
merge main
Jag96 87bdb54
update podfile.lock
Jag96 bccf156
remove extra space above button
Jag96 d9be8b9
merge main
Jag96 aca33b0
rename function
Jag96 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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,3 @@ | ||
import Collapsible from 'react-collapse'; | ||
|
||
export default Collapsible; |
26 changes: 26 additions & 0 deletions
26
src/components/CollapsibleSection/Collapsible/index.native.js
This file contains 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,26 @@ | ||
import CollapsibleRN from 'react-native-collapsible'; | ||
import PropTypes from 'prop-types'; | ||
import React from 'react'; | ||
|
||
const propTypes = { | ||
/** Whether the section should start expanded. False by default */ | ||
isOpened: PropTypes.bool, | ||
|
||
/** Children to display inside the Collapsible component */ | ||
children: PropTypes.node.isRequired, | ||
}; | ||
|
||
const defaultProps = { | ||
isOpened: false, | ||
}; | ||
|
||
const Collapsible = props => ( | ||
<CollapsibleRN collapsed={!props.isOpened}> | ||
{props.children} | ||
</CollapsibleRN> | ||
); | ||
|
||
Collapsible.displayName = 'Collapsible'; | ||
Collapsible.propTypes = propTypes; | ||
Collapsible.defaultProps = defaultProps; | ||
export default Collapsible; |
18 changes: 18 additions & 0 deletions
18
src/components/CollapsibleSection/CollapsibleSectionPropTypes.js
This file contains 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,18 @@ | ||
import PropTypes from 'prop-types'; | ||
|
||
const propTypes = { | ||
/** Title of the Collapsible section */ | ||
title: PropTypes.string.isRequired, | ||
|
||
/** Whether the section should start expanded. False by default */ | ||
isExpanded: PropTypes.bool, | ||
|
||
/** Children to display inside the Collapsible component */ | ||
children: PropTypes.node.isRequired, | ||
}; | ||
|
||
const defaultProps = { | ||
isExpanded: false, | ||
}; | ||
|
||
export {propTypes, defaultProps}; |
This file contains 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,53 @@ | ||
import React from 'react'; | ||
import {View, TouchableOpacity} from 'react-native'; | ||
import Collapsible from './Collapsible'; | ||
import Text from '../Text'; | ||
import {propTypes, defaultProps} from './CollapsibleSectionPropTypes'; | ||
import styles from '../../styles/styles'; | ||
import Icon from '../Icon'; | ||
import {DownArrow, UpArrow} from '../Icon/Expensicons'; | ||
|
||
class CollapsibleSection extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
this.toggleSection = this.toggleSection.bind(this); | ||
this.state = { | ||
isExpanded: this.props.isExpanded, | ||
}; | ||
} | ||
|
||
/** | ||
* Expands/collapses the section | ||
*/ | ||
toggleSection() { | ||
this.setState(prevState => ({ | ||
isExpanded: !prevState.isExpanded, | ||
})); | ||
} | ||
|
||
render() { | ||
const src = this.state.isExpanded ? UpArrow : DownArrow; | ||
stitesExpensify marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
return ( | ||
<View style={styles.mt4}> | ||
<TouchableOpacity onPress={this.toggleSection} style={[styles.pb4, styles.flexRow]}> | ||
<Text style={[styles.flex1, styles.textStrong]}> | ||
{this.props.title} | ||
</Text> | ||
<Icon src={src} /> | ||
</TouchableOpacity> | ||
<View style={styles.collapsibleSectionBorder} /> | ||
|
||
<Collapsible isOpened={this.state.isExpanded}> | ||
<View> | ||
{this.props.children} | ||
</View> | ||
</Collapsible> | ||
</View> | ||
); | ||
} | ||
} | ||
|
||
CollapsibleSection.defaultProps = defaultProps; | ||
CollapsibleSection.propTypes = propTypes; | ||
export default CollapsibleSection; |
This file contains 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 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
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.
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 didn't see where we are passing this prop and think maybe this should just be
false
?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.
True, we aren't currently using that prop value so I can just remove it and update the initial state to be false here