Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/refactor codes page #474

Merged
merged 4 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Improvements

- [#474](https://github.com/alleslabs/celatone-frontend/pull/474) Refactor stored and saved codes pages
- [#468](https://github.com/alleslabs/celatone-frontend/pull/468) Add breadcrumb to pool id page
- [#466](https://github.com/alleslabs/celatone-frontend/pull/466) Fix developer mode alert
- [#457](https://github.com/alleslabs/celatone-frontend/pull/457) Add alert for proposal forum review
Expand Down
6 changes: 5 additions & 1 deletion src/lib/components/forms/FilterByPermission.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ interface PermissionOption {
label: string;
value: PermissionFilterValue;
disabled: boolean;
icon?: IconKeys;
icon: IconKeys;
iconColor: string;
}

interface FilterByPermissionProps {
Expand All @@ -25,18 +26,21 @@ const options: PermissionOption[] = [
value: "all",
disabled: false,
icon: "check",
iconColor: "gray.600",
},
{
label: "Can Instantiate without proposal",
value: "without-proposal",
disabled: false,
icon: "instantiate",
iconColor: "gray.600",
},
{
label: "Instantiate through proposal only",
value: "with-proposal",
disabled: false,
icon: "vote",
iconColor: "gray.600",
},
];

Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/table/transactions/TransactionsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ export const TransactionsTable = ({
if (isLoading) return <Loading withBorder />;
if (!transactions?.length) return emptyState;

const templateColumns = `25px 180px 48px minmax(360px, 1fr) ${
const templateColumns = `40px 190px 48px minmax(360px, 1fr) ${
showRelations ? "100px " : ""
}max(160px) ${showTimestamp ? "max(220px) " : ""}${
}max(160px) ${showTimestamp ? "max(230px) " : ""}${
showAction ? "100px " : ""
}`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const TransactionsTableRow = ({
/>
)}
</TableRow>
<TableRow>
<TableRow pr={1}>
<>
<ExplorerLink
value={transaction.hash.toLocaleUpperCase()}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/tx/modal/ButtonSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ export const ButtonSection = ({
<Button
variant="ghost-secondary"
onClick={() => {
navigate({ pathname: "/my-codes" });
navigate({ pathname: "/stored-codes" });
onClose?.();
}}
>
See my codes list
See my stored codes
</Button>
<Button
variant="primary"
Expand Down
2 changes: 1 addition & 1 deletion src/lib/layout/navbar/Expand.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const NavInfo = ({ submenu, isCurrentPage }: NavInfoProps) => (
<Text
variant="body2"
className="ellipsis"
color={submenu.isDisable ? "text.dark" : "text.main"}
color={submenu.isDisable ? "text.disabled" : "text.main"}
>
{submenu.name}
</Text>
Expand Down
6 changes: 3 additions & 3 deletions src/lib/layout/navbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ const Navbar = ({ isExpand, isDevMode, setIsExpand }: NavbarProps) => {
...(isDevMode && wasm.enabled
? [
{
name: "My Codes",
slug: "/codes",
name: "My Stored Codes",
slug: "/stored-codes",
icon: "code" as IconKeys,
},
{
Expand Down Expand Up @@ -107,7 +107,7 @@ const Navbar = ({ isExpand, isDevMode, setIsExpand }: NavbarProps) => {
submenu: [
{
name: "Saved Codes",
slug: "/my-codes",
slug: "/saved-codes",
icon: "code" as IconKeys,
},
{
Expand Down
36 changes: 0 additions & 36 deletions src/lib/pages/my-codes/components/MySavedCodesSection.tsx

This file was deleted.

61 changes: 0 additions & 61 deletions src/lib/pages/my-codes/components/MyStoredCodesSection.tsx

This file was deleted.

138 changes: 0 additions & 138 deletions src/lib/pages/my-codes/index.tsx

This file was deleted.

24 changes: 24 additions & 0 deletions src/lib/pages/saved-codes/components/MySavedCodesSection.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { MySavedCodesTable } from "lib/components/table";
import type { CodeInfo } from "lib/types";

interface MySavedCodesSectionProps {
codes: CodeInfo[];
isLoading: boolean;
onRowSelect: (codeId: number) => void;
isSearching: boolean;
}

export const MySavedCodesSection = ({
codes,
isLoading,
onRowSelect,
isSearching,
}: MySavedCodesSectionProps) => (
<MySavedCodesTable
codes={codes}
isLoading={isLoading}
onRowSelect={onRowSelect}
emptyMessage="Codes saved using Celatone will display here. Saved codes are stored locally on your device."
isSearching={isSearching}
/>
);
Loading