This repository has been archived by the owner on Jun 15, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #231 from standardnotes/linting
Linting Entire codebase
- Loading branch information
Showing
68 changed files
with
3,447 additions
and
2,650 deletions.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,51 @@ | ||
import React, { Component } from 'react'; | ||
import React from 'react'; | ||
import { TouchableHighlight, Text, View } from 'react-native'; | ||
import SectionedTableCell from './SectionedTableCell' | ||
import StyleKit from '@Style/StyleKit' | ||
import SectionedTableCell from '@Components/SectionedTableCell'; | ||
import StyleKit from '@Style/StyleKit'; | ||
|
||
export default class ButtonCell extends SectionedTableCell { | ||
|
||
rules() { | ||
let rules = super.rules(); | ||
if(this.props.maxHeight) { rules.push({maxHeight: this.props.maxHeight}) } | ||
const rules = super.rules(); | ||
if (this.props.maxHeight) { | ||
rules.push({ maxHeight: this.props.maxHeight }); | ||
} | ||
return rules; | ||
} | ||
|
||
buttonRules() { | ||
let rules = [StyleKit.stylesForKey('buttonCellButton')]; | ||
if(this.props.leftAligned) { rules.push(StyleKit.styles.buttonCellButtonLeft) } | ||
if(this.props.bold) { rules.push(StyleKit.styles.bold) } | ||
if(this.props.disabled) { rules.push({color: 'gray', opacity: 0.6}) } | ||
if(this.props.important) { rules.push({color: StyleKit.variables.stylekitDangerColor}) } | ||
const rules = [StyleKit.stylesForKey('buttonCellButton')]; | ||
if (this.props.leftAligned) { | ||
rules.push(StyleKit.styles.buttonCellButtonLeft); | ||
} | ||
if (this.props.bold) { | ||
rules.push(StyleKit.styles.bold); | ||
} | ||
if (this.props.disabled) { | ||
rules.push({ color: 'gray', opacity: 0.6 }); | ||
} | ||
if (this.props.important) { | ||
rules.push({ color: StyleKit.variables.stylekitDangerColor }); | ||
} | ||
return rules; | ||
} | ||
|
||
render() { | ||
return ( | ||
<TouchableHighlight | ||
underlayColor={StyleKit.variable('stylekitBorderColor')} | ||
style={[StyleKit.styles.flexContainer, StyleKit.styles.buttonCell, ...this.rules()]} | ||
underlayColor={StyleKit.variables.stylekitBorderColor} | ||
style={[ | ||
StyleKit.styles.flexContainer, | ||
StyleKit.styles.buttonCell, | ||
...this.rules() | ||
]} | ||
disabled={this.props.disabled} | ||
onPress={this.props.onPress}> | ||
onPress={this.props.onPress} | ||
> | ||
<View> | ||
<Text style={this.buttonRules()}>{this.props.title}</Text> | ||
{this.props.children && | ||
this.props.children | ||
} | ||
{this.props.children && this.props.children} | ||
</View> | ||
</TouchableHighlight> | ||
) | ||
); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,32 +1,28 @@ | ||
import React, { Component } from 'react'; | ||
import {TouchableHighlight, Text, View} from 'react-native'; | ||
import SectionedTableCell from './SectionedTableCell' | ||
import StyleKit from "@Style/StyleKit" | ||
import React from 'react'; | ||
import { View } from 'react-native'; | ||
import SectionedTableCell from '@Components/SectionedTableCell'; | ||
|
||
export default class Circle extends SectionedTableCell { | ||
|
||
constructor(props) { | ||
super(props); | ||
this.size = props.size || 12; | ||
this.loadStyles(); | ||
} | ||
|
||
render() { | ||
return ( | ||
<View style={this.styles.circle} /> | ||
) | ||
return <View style={this.styles.circle} />; | ||
} | ||
|
||
loadStyles() { | ||
this.styles = { | ||
circle: { | ||
width: this.size, | ||
height: this.size, | ||
borderRadius: this.size/2.0, | ||
borderRadius: this.size / 2.0, | ||
backgroundColor: this.props.backgroundColor, | ||
borderColor: this.props.borderColor, | ||
borderWidth: 1 | ||
} | ||
} | ||
}; | ||
} | ||
} |
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.