Skip to content
This repository has been archived by the owner on Jun 15, 2022. It is now read-only.

Commit

Permalink
Linting Style
Browse files Browse the repository at this point in the history
  • Loading branch information
bryvin committed Feb 8, 2020
1 parent f5a2886 commit d073b03
Show file tree
Hide file tree
Showing 7 changed files with 108 additions and 105 deletions.
4 changes: 2 additions & 2 deletions src/App.js
Expand Up @@ -85,7 +85,7 @@ const AppDrawerStack = createDrawerNavigator(
/** We have to return something. */
return NavigationActions.setParams({
params: { dummy: true },
key: route.key,
key: route.key
});
}
};
Expand Down Expand Up @@ -120,7 +120,7 @@ const AppDrawer = createStackNavigator(
[SCREEN_INPUT_MODAL]: InputModalStack,
[SCREEN_AUTHENTICATE]: AuthenticateModalStack,
[SCREEN_MANAGE_PRIVILEGES]: ManagePrivilegesStack,
[SCREEN_KEY_RECOVERY]: KeyRecoveryStack,
[SCREEN_KEY_RECOVERY]: KeyRecoveryStack
},
{
mode: 'modal',
Expand Down
12 changes: 3 additions & 9 deletions src/global.js
Expand Up @@ -26,7 +26,7 @@ import {
SFPrivilegesManager
} from 'standard-file-js';

SFItem.AppDomain = "org.standardnotes.sn";
SFItem.AppDomain = 'org.standardnotes.sn';

global.SFItem = SFItem;
global.SFItemParams = SFItemParams;
Expand All @@ -38,16 +38,10 @@ global.SFHttpManager = SFHttpManager;
global.SFAuthManager = SFAuthManager;
global.SFPrivilegesManager = SFPrivilegesManager;

import SF from "./lib/sfjs/sfjs"
import SF from './lib/sfjs/sfjs';
global.SFJS = SF.get();

import {
SNNote,
SNTag,
SNTheme,
SNComponent,
SNComponentManager
} from 'snjs';
import { SNNote, SNTag, SNTheme, SNComponent, SNComponentManager } from 'snjs';

global.SNNote = SNNote;
global.SNTag = SNTag;
Expand Down
50 changes: 27 additions & 23 deletions src/style/ActionSheetWrapper.js
@@ -1,27 +1,28 @@
import React, {Component} from 'react';
import { StyleSheet, StatusBar, Alert, Platform, Dimensions } from 'react-native';
import StyleKit from "@Style/StyleKit"
import ActionSheet from 'react-native-actionsheet'
import ApplicationState from "@Lib/ApplicationState"
import React from 'react';
import { StyleSheet } from 'react-native';
import ActionSheet from 'react-native-actionsheet';
import ApplicationState from '@Lib/ApplicationState';
import StyleKit from '@Style/StyleKit';

export default class ActionSheetWrapper {

static BuildOption({text, key, callback, destructive}) {
static BuildOption({ text, key, callback, destructive }) {
return {
text,
key,
callback,
destructive
}
};
}

constructor({title, options, onCancel}) {
options.push({text: "Cancel", callback: onCancel});
constructor({ title, options, onCancel }) {
options.push({ text: 'Cancel', callback: onCancel });
this.options = options;

this.destructiveIndex = this.options.indexOf(this.options.find((candidate) => {
return candidate.destructive;
}))
this.destructiveIndex = this.options.indexOf(
this.options.find(candidate => {
return candidate.destructive;
})
);
this.cancelIndex = this.options.length - 1;
this.title = title;
}
Expand All @@ -30,44 +31,47 @@ export default class ActionSheetWrapper {
this.actionSheet.show();
}

handleActionSheetPress = (index) => {
handleActionSheetPress = index => {
let option = this.options[index];
option.callback && option.callback(option);
}
};

actionSheetElement() {
return (
<ActionSheet
ref={o => this.actionSheet = o}
ref={o => (this.actionSheet = o)}
title={this.title}
options={this.options.map((option) => {return option.text})}
options={this.options.map(option => {
return option.text;
})}
cancelButtonIndex={this.cancelIndex}
destructiveButtonIndex={this.destructiveIndex}
onPress={this.handleActionSheetPress}
{...ActionSheetWrapper.actionSheetStyles()}
/>
)
);
}

static actionSheetStyles() {
return {
wrapperStyle: StyleKit.styles.actionSheetWrapper,
overlayStyle: StyleKit.styles.actionSheetOverlay,
bodyStyle : StyleKit.styles.actionSheetBody,
bodyStyle: StyleKit.styles.actionSheetBody,

buttonWrapperStyle: StyleKit.styles.actionSheetButtonWrapper,
buttonTitleStyle: StyleKit.styles.actionSheetButtonTitle,

titleWrapperStyle: StyleKit.styles.actionSheetTitleWrapper,
titleTextStyle: StyleKit.styles.actionSheetTitleText,
tintColor: ApplicationState.isIOS ? undefined : StyleKit.variable("stylekitInfoColor"),
tintColor: ApplicationState.isIOS
? undefined
: StyleKit.variables.stylekitInfoColor,

buttonUnderlayColor: StyleKit.variable("stylekitBorderColor"),
buttonUnderlayColor: StyleKit.variables.stylekitBorderColor,

cancelButtonWrapperStyle: StyleKit.styles.actionSheetCancelButtonWrapper,
cancelButtonTitleStyle: StyleKit.styles.actionSheetCancelButtonTitle,
cancelMargin: StyleSheet.hairlineWidth
}
};
}

}
14 changes: 7 additions & 7 deletions src/style/AndroidTextFix.js
Expand Up @@ -9,15 +9,15 @@ const React = require('react');
const { Platform, Text } = require('react-native');

const defaultFontFamily = {
...Platform.select({
android: { fontFamily: 'Roboto' }
})
...Platform.select({
android: { fontFamily: 'Roboto' }
})
};

const oldRender = Text.render;
Text.render = function(...args) {
const origin = oldRender.call(this, ...args);
return React.cloneElement(origin, {
style: [defaultFontFamily, origin.props.style]
});
const origin = oldRender.call(this, ...args);
return React.cloneElement(origin, {
style: [defaultFontFamily, origin.props.style]
});
};

0 comments on commit d073b03

Please sign in to comment.