Skip to content
This repository has been archived by the owner on Oct 4, 2021. It is now read-only.

Commit

Permalink
Правки под линтеры
Browse files Browse the repository at this point in the history
  • Loading branch information
olliva committed Mar 29, 2019
1 parent 7181a87 commit a363a22
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 19 deletions.
18 changes: 10 additions & 8 deletions components/ExtFancyButton/ExtFancyButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ interface IFancyButtonProps {

const title = typeof window !== 'undefined' && true && window.document.title && window;

export default ({ color, className, onClick }: IFancyButtonProps) => (
<button
className={`fancy-button ${className}`} onClick={onClick} style={{ backgroundColor: color }}
type="button"
>
click me {title}
</button>
);
export function ExtFancyButton({ color, className, onClick }: IFancyButtonProps): React.ReactNode {
return (
<button
className={`fancy-button ${className}`} onClick={onClick} style={{ backgroundColor: color }}
type="button"
>
click me {title}
</button>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
background: black;
border: 2px solid black;

transition-property: background-color, color, border-color;
transition-duration: 0.2s;

box-sizing: border-box;

&__button.fancy-button {
Expand All @@ -38,8 +35,6 @@

background: black;
opacity: 0;

transition: 0.2s;
}

&:active {
Expand Down
6 changes: 2 additions & 4 deletions components/ExtFancyParagraph/ExtFancyParagraph.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import './ExtFancyButton.scss';
import './ExtFancyParagraph.scss';

interface IFancyParagraphProps {
children: React.ReactChildren;
Expand All @@ -10,7 +10,7 @@ interface IFancyParagraphState {
color: string;
}

class ExtFancyParagraph extends React.PureComponent<IFancyParagraphProps, IFancyParagraphState> {
export class ExtFancyParagraph extends React.PureComponent<IFancyParagraphProps, IFancyParagraphState> {
public constructor(props: IFancyParagraphProps) {
super(props);

Expand Down Expand Up @@ -49,5 +49,3 @@ class ExtFancyParagraph extends React.PureComponent<IFancyParagraphProps, IFancy
);
}
}

export default ExtFancyParagraph;
5 changes: 3 additions & 2 deletions server/utils/preparePage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ const preparePage = (rawHtml: string): string => {
const $ = cheerio.load(rawHtml);

/* Вырезаем всех детей у hydro чтобы спокойно зарендерить компоненты с нуля */
$('.hydro').toArray().
map(component => component.children = []);
$('.hydro')
.toArray()
.map(component => component.children = []);

/* Добавляем стили и скрипты всех кастомных компонетов (загружаются синхронно) */
$('.page').append(`${customComponentStylesheet}\n${customComponentScript}`);
Expand Down

0 comments on commit a363a22

Please sign in to comment.