#22: fix code style

This commit is contained in:
SleepWalker 2018-05-13 22:32:53 +03:00
parent a860e10847
commit 875e0b6e6b
2 changed files with 11 additions and 8 deletions

View File

@ -1,10 +1,10 @@
// @flow // @flow
import type { Node } from 'react';
import type { OauthAppResponse } from 'services/api/oauth';
import React, { Component } from 'react'; import React, { Component } from 'react';
import { FormattedMessage as Message } from 'react-intl'; import { FormattedMessage as Message } from 'react-intl';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import classNames from 'classnames'; import classNames from 'classnames';
import { SKIN_LIGHT, COLOR_BLACK, COLOR_RED } from 'components/ui'; import { SKIN_LIGHT, COLOR_BLACK, COLOR_RED } from 'components/ui';
import { Input, Button } from 'components/ui/form'; import { Input, Button } from 'components/ui/form';
import Collapse from 'components/ui/collapse'; import Collapse from 'components/ui/collapse';
@ -12,9 +12,6 @@ import Collapse from 'components/ui/collapse';
import styles from './applicationsIndex.scss'; import styles from './applicationsIndex.scss';
import messages from './ApplicationsIndex.intl.json'; import messages from './ApplicationsIndex.intl.json';
import type { Node } from 'react';
import type { OauthAppResponse } from 'services/api/oauth';
const ACTION_REVOKE_TOKENS = 'revoke-tokens'; const ACTION_REVOKE_TOKENS = 'revoke-tokens';
const ACTION_RESET_SECRET = 'reset-secret'; const ACTION_RESET_SECRET = 'reset-secret';
const ACTION_DELETE = 'delete'; const ACTION_DELETE = 'delete';
@ -41,7 +38,7 @@ export default class ApplicationItem extends Component<{
const { selectedAction, isActionPerforming } = this.state; const { selectedAction, isActionPerforming } = this.state;
let actionContent: Node; let actionContent: Node;
// eslint-disable-next-line
switch (selectedAction) { switch (selectedAction) {
case ACTION_REVOKE_TOKENS: case ACTION_REVOKE_TOKENS:
case ACTION_RESET_SECRET: case ACTION_RESET_SECRET:
@ -111,10 +108,11 @@ export default class ApplicationItem extends Component<{
</div> </div>
); );
break; break;
default:
actionContent = null;
break;
} }
// TODO: @SleepWalker: нужно сделать так, чтобы форматирование числа пользователей шло через пробел
return ( return (
<div className={classNames(styles.appItemContainer, { <div className={classNames(styles.appItemContainer, {
[styles.appExpanded]: expand, [styles.appExpanded]: expand,

View File

@ -107,10 +107,13 @@ function normalizeScrollPosition(y: number): number {
*/ */
export function restoreScroll(targetEl: ?HTMLElement = null) { export function restoreScroll(targetEl: ?HTMLElement = null) {
const { hash } = window.location; const { hash } = window.location;
setTimeout(() => { setTimeout(() => {
isFirstScroll = false; isFirstScroll = false;
if (targetEl === null) { if (targetEl === null) {
const id = hash.substr(1); const id = hash.substr(1);
if (!id) { if (!id) {
return; return;
} }
@ -119,12 +122,14 @@ export function restoreScroll(targetEl: ?HTMLElement = null) {
} }
const viewPort = document.body; const viewPort = document.body;
if (!viewPort) { if (!viewPort) {
console.log('Can not find viewPort element'); // eslint-disable-line console.log('Can not find viewPort element'); // eslint-disable-line
return; return;
} }
let y = 0; let y = 0;
if (targetEl) { if (targetEl) {
const { top } = targetEl.getBoundingClientRect(); const { top } = targetEl.getBoundingClientRect();
y = getScrollTop() + top - SCROLL_ANCHOR_OFFSET; y = getScrollTop() + top - SCROLL_ANCHOR_OFFSET;