mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-01-27 05:53:10 +05:30
#22: fix code style
This commit is contained in:
parent
a860e10847
commit
875e0b6e6b
@ -1,10 +1,10 @@
|
||||
// @flow
|
||||
import type { Node } from 'react';
|
||||
import type { OauthAppResponse } from 'services/api/oauth';
|
||||
import React, { Component } from 'react';
|
||||
import { FormattedMessage as Message } from 'react-intl';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
import classNames from 'classnames';
|
||||
|
||||
import { SKIN_LIGHT, COLOR_BLACK, COLOR_RED } from 'components/ui';
|
||||
import { Input, Button } from 'components/ui/form';
|
||||
import Collapse from 'components/ui/collapse';
|
||||
@ -12,9 +12,6 @@ import Collapse from 'components/ui/collapse';
|
||||
import styles from './applicationsIndex.scss';
|
||||
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_RESET_SECRET = 'reset-secret';
|
||||
const ACTION_DELETE = 'delete';
|
||||
@ -41,7 +38,7 @@ export default class ApplicationItem extends Component<{
|
||||
const { selectedAction, isActionPerforming } = this.state;
|
||||
|
||||
let actionContent: Node;
|
||||
// eslint-disable-next-line
|
||||
|
||||
switch (selectedAction) {
|
||||
case ACTION_REVOKE_TOKENS:
|
||||
case ACTION_RESET_SECRET:
|
||||
@ -111,10 +108,11 @@ export default class ApplicationItem extends Component<{
|
||||
</div>
|
||||
);
|
||||
break;
|
||||
default:
|
||||
actionContent = null;
|
||||
break;
|
||||
}
|
||||
|
||||
// TODO: @SleepWalker: нужно сделать так, чтобы форматирование числа пользователей шло через пробел
|
||||
|
||||
return (
|
||||
<div className={classNames(styles.appItemContainer, {
|
||||
[styles.appExpanded]: expand,
|
||||
|
@ -107,10 +107,13 @@ function normalizeScrollPosition(y: number): number {
|
||||
*/
|
||||
export function restoreScroll(targetEl: ?HTMLElement = null) {
|
||||
const { hash } = window.location;
|
||||
|
||||
setTimeout(() => {
|
||||
isFirstScroll = false;
|
||||
|
||||
if (targetEl === null) {
|
||||
const id = hash.substr(1);
|
||||
|
||||
if (!id) {
|
||||
return;
|
||||
}
|
||||
@ -119,12 +122,14 @@ export function restoreScroll(targetEl: ?HTMLElement = null) {
|
||||
}
|
||||
|
||||
const viewPort = document.body;
|
||||
|
||||
if (!viewPort) {
|
||||
console.log('Can not find viewPort element'); // eslint-disable-line
|
||||
return;
|
||||
}
|
||||
|
||||
let y = 0;
|
||||
|
||||
if (targetEl) {
|
||||
const { top } = targetEl.getBoundingClientRect();
|
||||
y = getScrollTop() + top - SCROLL_ANCHOR_OFFSET;
|
||||
|
Loading…
x
Reference in New Issue
Block a user