Skip to content

Commit b6ffd67

Browse files
authored
Merge pull request #158 from ani-team/fix/followup_pr120
Правки по #120
2 parents c3b99f8 + be078bb commit b6ffd67

File tree

13 files changed

+23
-21
lines changed

13 files changed

+23
-21
lines changed

src/app/error-handling/error-catcher.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ export default function ErrorCatcher({ handler, children }: Props) {
4343
setError(mapError(graphQLErrors?.[0] || networkError));
4444
});
4545
apolloClient.setLink(errorLink.concat(apolloClient.link));
46-
}, [apolloClient]);
46+
// eslint-disable-next-line react-hooks/exhaustive-deps
47+
}, []);
4748

4849
useEffect(() => setError(null), [location]);
4950

src/app/hocs/with-router.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ import React, { Suspense } from "react";
33
import { BrowserRouter, Route } from "react-router-dom";
44
import { QueryParamProvider } from "use-query-params";
55

6+
/**
7+
* Инициализация роутера с провайдером для работы с get-параметрами
8+
*/
69
const withRouter = (component: () => JSX.Element) => () => (
710
<BrowserRouter>
811
<Suspense fallback={<Spin delay={300} className="overlay" size="large" />}>

src/app/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ import { Layout } from "antd";
33
import Routing from "pages";
44
import { ErrorCatcher } from "./error-handling";
55
import Header from "./header";
6-
import "./index.scss";
76
import { withHocs } from "./hocs";
7+
import "./index.scss";
88

9+
// !!! FIXME: manage access
910
const ErrorPage = lazy(() => import("pages/error"));
1011
/**
1112
* Entry-point приложения
Lines changed: 1 addition & 0 deletions
Loading
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
background: #e9ffff url("./assets/bg.png") no-repeat center/cover;
55
}
66

7-
.home-hero {
7+
.hero-sheet {
88
display: flex;
99
align-items: center;
1010
height: inherit;
Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,30 @@ type Props = {
1212
useSadHero?: boolean;
1313
};
1414

15-
const HomeHero = ({ title, description, action, useSadHero = false }: Props) => {
15+
const HeroSheet = ({ title, description, action, useSadHero = false }: Props) => {
1616
const history = useHistory();
1717
const preferredAction = action ?? {
1818
text: "Back",
1919
to: () => (history.length > 1 ? history.goBack() : history.push("/")),
2020
};
21+
const HeroIcon = useSadHero ? SadIcon : Icon;
2122

2223
return (
2324
<div className="page page-background">
24-
<Row className="home-hero">
25+
<Row className="hero-sheet">
2526
<Col span={16}>
26-
<h1 className="home-hero__title">{title}</h1>
27-
<p className="home-hero__description">{description}</p>
28-
<button className="home-hero__button" onClick={() => preferredAction.to()}>
27+
<h1 className="hero-sheet__title">{title}</h1>
28+
<p className="hero-sheet__description">{description}</p>
29+
<button className="hero-sheet__button" onClick={() => preferredAction.to()}>
2930
{preferredAction.text}
3031
</button>
3132
</Col>
3233
<Col span={8}>
33-
{useSadHero ? (
34-
<SadIcon className="home-hero__icon" />
35-
) : (
36-
<Icon className="home-hero__icon" />
37-
)}
34+
<HeroIcon className="hero-sheet__icon" />
3835
</Col>
3936
</Row>
4037
</div>
4138
);
4239
};
4340

44-
export default HomeHero;
41+
export default HeroSheet;

src/features/home-hero/assets/github-icon-sad.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/features/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ export { default as RepoList } from "./repo-list";
1010
export { default as RepoStat } from "./repo-stat";
1111
export { default as Search } from "./search";
1212
export { default as Origin } from "./origin";
13+
export { default as HeroSheet } from "./hero-sheet";
1314
export { Auth };

0 commit comments

Comments
 (0)