Skip to content

Commit 69730b1

Browse files
authored
Merge pull request #167 from ani-team/fix/component_defs
Объявление компонентов в одном виде
2 parents 549a6e2 + dc0815d commit 69730b1

File tree

9 files changed

+24
-18
lines changed

9 files changed

+24
-18
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ type Props = PropsWithChildren<{
3333
handler: (props: { error: AppError }) => ReactNode;
3434
}>;
3535

36-
export default function ErrorCatcher({ handler, children }: Props) {
36+
const ErrorCatcher = ({ handler, children }: Props) => {
3737
const apolloClient = useApolloClient();
3838
const location = useLocation();
3939
const [error, setError] = useState<AppError | null>(null);
@@ -52,4 +52,6 @@ export default function ErrorCatcher({ handler, children }: Props) {
5252
return <>{handler({ error })}</>;
5353
}
5454
return <>{children}</>;
55-
}
55+
};
56+
57+
export default ErrorCatcher;

src/features/repo-details/details-card/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import "./index.scss";
44

55
type Props = PropsWithChildren<{ title: string; className?: string; primary?: boolean }>;
66

7-
function DetailsCard({ title, className, primary, children }: Props) {
7+
const DetailsCard = ({ title, className, primary, children }: Props) => {
88
return (
99
<div className={cn("details-card", { primary }, className)}>
1010
<h3>{title}</h3>
1111
{children}
1212
</div>
1313
);
14-
}
14+
};
1515

1616
export default DetailsCard;

src/features/repo-details/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type Collaborator = {
1919
avatarUrl: string;
2020
};
2121

22-
function RepoDetails({ repo: identity }: Props) {
22+
const RepoDetails = ({ repo: identity }: Props) => {
2323
const { data, loading } = useRepoDetailsQuery({
2424
variables: {
2525
name: identity.name,
@@ -88,6 +88,6 @@ function RepoDetails({ repo: identity }: Props) {
8888
/>
8989
</div>
9090
);
91-
}
91+
};
9292

9393
export default RepoDetails;

src/features/repo-explorer/components/branches-menu/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ type Props = {
99
branches?: Array<{ name: string; prefix: string }>;
1010
};
1111

12-
function BranchesMenu({ repo, branches }: Props) {
12+
const BranchesMenu = ({ repo, branches }: Props) => {
1313
return (
1414
<Menu className="branches-menu" onClick={() => {}}>
1515
{branches?.map((branch, index) => (
@@ -21,6 +21,6 @@ function BranchesMenu({ repo, branches }: Props) {
2121
))}
2222
</Menu>
2323
);
24-
}
24+
};
2525

2626
export default BranchesMenu;

src/features/repo-explorer/components/entries-view/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ type Props = {
2525
};
2626
};
2727

28-
function EntriesView({ loading, files, lastCommit, className }: Props) {
28+
const EntriesView = ({ loading, files, lastCommit, className }: Props) => {
2929
return (
3030
<div className={cn("repo-git-view", className)}>
3131
{loading && <SkeletonArea />}
@@ -38,7 +38,7 @@ function EntriesView({ loading, files, lastCommit, className }: Props) {
3838
)}
3939
</div>
4040
);
41-
}
41+
};
4242

4343
const GitFileView = ({ name, type }: GitFile) => (
4444
<List.Item className="repo-git-view__item">

src/features/repo-explorer/components/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const useRepoDetails = (repoInfo: RepoBranchInfoQuery | undefined) => {
5959
};
6060
};
6161

62-
function Explorer({ repo }: Props) {
62+
const Explorer = ({ repo }: Props) => {
6363
const { branch } = useBranch(repo);
6464
const { loading, data } = useRepoBranchInfoQuery({
6565
variables: {
@@ -81,6 +81,6 @@ function Explorer({ repo }: Props) {
8181
<RepoReadme text={readme} loading={loading} />
8282
</div>
8383
);
84-
}
84+
};
8585

8686
export default Explorer;

src/features/repo-explorer/components/toolbar/clone-menu.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Button, Input, Tooltip } from "antd";
44

55
type Props = { url: string };
66

7-
export default function CloneMenu({ url }: Props) {
7+
const CloneMenu = ({ url }: Props) => {
88
const cloneField = useRef<Input>(null);
99
const [isUrlCopied, setUrlCopied] = useState<boolean | null>(null);
1010
useEffect(() => {
@@ -45,4 +45,6 @@ export default function CloneMenu({ url }: Props) {
4545
/>
4646
</div>
4747
);
48-
}
48+
};
49+
50+
export default CloneMenu;

src/features/repo-explorer/components/toolbar/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ type Props = {
1111
activeBranch: string;
1212
};
1313

14-
function RepoToolbar({ repo, branches, activeBranch }: Props) {
14+
const RepoToolbar = ({ repo, branches, activeBranch }: Props) => {
1515
return (
1616
<div className="flex justify-between">
1717
<Dropdown
@@ -32,6 +32,6 @@ function RepoToolbar({ repo, branches, activeBranch }: Props) {
3232
</Popover>
3333
</div>
3434
);
35-
}
35+
};
3636

3737
export default RepoToolbar;

src/pages/error/index.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { AppError } from "models";
77

88
type Props = { error: AppError };
99

10-
export default function ErrorPage({ error }: Props) {
10+
const ErrorPage = ({ error }: Props) => {
1111
const { logout } = Auth.useAuth();
1212

1313
const action =
@@ -29,4 +29,6 @@ export default function ErrorPage({ error }: Props) {
2929
action={action}
3030
/>
3131
);
32-
}
32+
};
33+
34+
export default ErrorPage;

0 commit comments

Comments
 (0)