This repository has been archived by the owner on Dec 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 974
Create sectionTitle.js #8237
Merged
Merged
Create sectionTitle.js #8237
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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 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,121 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
const React = require('react') | ||
const ImmutableComponent = require('../immutableComponent') | ||
|
||
const {StyleSheet, css} = require('aphrodite/no-important') | ||
const globalStyles = require('../styles/global') | ||
const commonStyles = require('../styles/commonStyles') | ||
|
||
class SectionTitleWrapper extends ImmutableComponent { | ||
render () { | ||
return <div className={css( | ||
commonStyles.userSelectNone, | ||
styles.sectionTitleWrapper, | ||
this.props['data-beta'] && sectionTitleStyles.beta | ||
)} {...this.props} /> | ||
} | ||
} | ||
|
||
class SectionTitleLabelWrapper extends ImmutableComponent { | ||
render () { | ||
return <SectionTitleWrapper data-beta='true' {...this.props} /> | ||
} | ||
} | ||
|
||
class DefaultSectionTitle extends ImmutableComponent { | ||
render () { | ||
return <header className={css(styles.sectionTitleWrapper)}> | ||
<h1 className={css( | ||
commonStyles.userSelectNone, | ||
styles.sectionTitle | ||
)} {...this.props} /> | ||
</header> | ||
} | ||
} | ||
|
||
class AboutPageSectionTitle extends ImmutableComponent { | ||
render () { | ||
return <div className={css( | ||
commonStyles.userSelectNone, | ||
styles.sectionTitle, | ||
styles.prefSectionTitle, | ||
styles.aboutPageSectionTitle, | ||
this.props['data-subTitle'] && styles.aboutPageSectionSubTitle | ||
)} {...this.props} /> | ||
} | ||
} | ||
|
||
class AboutPageSectionSubTitle extends ImmutableComponent { | ||
render () { | ||
return <AboutPageSectionTitle data-subTitle='true' {...this.props} /> | ||
} | ||
} | ||
|
||
class SectionLabelTitle extends ImmutableComponent { | ||
render () { | ||
return <sup className={css( | ||
commonStyles.userSelectNone, | ||
styles.sectionLabelTitle | ||
)} {...this.props} /> | ||
} | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
sectionTitleWrapper: { | ||
marginBottom: '0.7rem', | ||
display: 'flex', | ||
alignItems: 'flex-end' | ||
}, | ||
|
||
sectionTitle: { | ||
color: globalStyles.color.darkGray, | ||
cursor: 'default', | ||
fontSize: '1.2rem', | ||
margin: 0, | ||
|
||
// Copied from common.less | ||
fontWeight: 400, | ||
WebkitFontSmoothing: 'antialiased' | ||
}, | ||
prefSectionTitle: { | ||
color: globalStyles.color.braveOrange, | ||
fontSize: '1.75rem' | ||
}, | ||
sectionLabelTitle: { | ||
color: '#999', | ||
fontSize: '15px' | ||
}, | ||
|
||
aboutPageSectionTitle: { | ||
display: 'inline-block' | ||
}, | ||
aboutPageSectionSubTitle: { | ||
fontSize: '16px', | ||
marginBottom: '12px', | ||
|
||
// cf: .siteDetailsPage .siteDetailsPageContent | ||
marginTop: '24px' | ||
} | ||
}) | ||
|
||
const sectionTitleStyles = StyleSheet.create({ | ||
beta: { | ||
display: 'flex', | ||
alignItems: 'flex-start' | ||
} | ||
}) | ||
|
||
module.exports = { | ||
sectionTitleStyles, | ||
|
||
SectionTitleWrapper, | ||
SectionTitleLabelWrapper, | ||
|
||
DefaultSectionTitle, | ||
SectionLabelTitle, | ||
AboutPageSectionTitle, | ||
AboutPageSectionSubTitle | ||
} |
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
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
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
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.
To make the header of payments and sync appear on the same height.