Skip to content

Commit 75184f5

Browse files
authored
chore: Delete unused type and move constants file (#5078)
1 parent 61274f1 commit 75184f5

6 files changed

Lines changed: 8 additions & 20 deletions

File tree

static/js/publisher/components/PublishedSnapList/PublishedSnapList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { ISnap } from "../../types";
44
import SnapNameEntry from "./SnapNameEntry";
55
import NewSnapNotification from "../NewSnapNotification";
66
import EmptySnapList from "../EmptySnapList";
7-
import { PAGE_NUMBER } from "../../types/constants";
7+
import { ITEMS_PER_PAGE } from "../../constants";
88

99
function PublishedSnapList({
1010
snaps,
@@ -115,7 +115,7 @@ function PublishedSnapList({
115115
/>
116116
<Pagination
117117
currentPage={currentPage}
118-
itemsPerPage={PAGE_NUMBER}
118+
itemsPerPage={ITEMS_PER_PAGE}
119119
paginate={(page) => setCurrentPage(page)}
120120
totalItems={totalItems}
121121
/>

static/js/publisher/components/PublishedSnapSection/PublishedSnapSection.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Accordion } from "@canonical/react-components";
33
import { ISnap } from "../../types";
44
import PublishedSnapList from "../PublishedSnapList";
55
import PublisherMetrics from "../PublisherMetrics";
6-
import { PAGE_NUMBER } from "../../types/constants";
6+
import { ITEMS_PER_PAGE } from "../../constants";
77

88
function PublishedSnapSection({
99
snaps,
@@ -14,10 +14,10 @@ function PublishedSnapSection({
1414
}) {
1515
const [currentPage, setCurrentPage] = useState<number>(1);
1616

17-
const firstItemOfPage = (currentPage - 1) * PAGE_NUMBER;
17+
const firstItemOfPage = (currentPage - 1) * ITEMS_PER_PAGE;
1818
const snapsInPage = snaps.slice(
1919
firstItemOfPage,
20-
firstItemOfPage + PAGE_NUMBER,
20+
firstItemOfPage + ITEMS_PER_PAGE,
2121
);
2222

2323
return (

static/js/publisher/components/RegisteredSnaps/RegisteredSnaps.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
} from "@canonical/react-components";
1111

1212
import { ISnap } from "../../types";
13-
import { PAGE_NUMBER } from "../../types/constants";
13+
import { ITEMS_PER_PAGE } from "../../constants";
1414

1515
function RegisteredSnaps({
1616
snaps,
@@ -168,7 +168,7 @@ function RegisteredSnaps({
168168
{
169169
key: "registered-snap-names",
170170
title: `Registered snap names (${snaps.length})`,
171-
content: <MainTable rows={getData()} paginate={PAGE_NUMBER} />,
171+
content: <MainTable rows={getData()} paginate={ITEMS_PER_PAGE} />,
172172
},
173173
]}
174174
expanded="registered-snap-names"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const ITEMS_PER_PAGE = 10;

static/js/publisher/types/constants.ts

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

static/js/publisher/types/shared.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,6 @@ export type RouteParams = {
44

55
export type Status = "Pending" | "Expired" | "Revoked";
66

7-
// Slices
8-
export type CurrentStoreSlice = {
9-
currentStore: {
10-
currentStore: {
11-
id: string;
12-
"manual-review-policy": string;
13-
private: boolean;
14-
name: string;
15-
};
16-
};
17-
};
18-
197
// Item lists
208
export type InvitesList = Array<Invite>;
219
export type MembersList = Array<Member>;

0 commit comments

Comments
 (0)