Skip to content

Commit

Permalink
Merge pull request #90 from alleslabs/feat/admin-migrate-router
Browse files Browse the repository at this point in the history
feat: admin migrate routes
  • Loading branch information
songwongtp authored Jan 17, 2023
2 parents bf79daf + 8f8fffc commit 8ba8f96
Show file tree
Hide file tree
Showing 14 changed files with 74 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Features

- [#90](https://github.com/alleslabs/celatone-frontend/pull/90) Add update admin (`/admin`) and migrate (`/migrate`) page routes
- [#91](https://github.com/alleslabs/celatone-frontend/pull/91) Add migrate shortcut to the sidebar
- [#75](https://github.com/alleslabs/celatone-frontend/pull/75) Add code-related contracts table to the code detail page
- [#81](https://github.com/alleslabs/celatone-frontend/pull/81) Can scroll on side bar with fix deploy new contract button
Expand Down
File renamed without changes.
3 changes: 1 addition & 2 deletions src/lib/pages/deploy/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { Heading, Text } from "@chakra-ui/react";
import { useRouter } from "next/router";

import { ButtonCard } from "lib/components/ButtonCard";
import { Stepper } from "lib/components/stepper";
import WasmPageContainer from "lib/components/WasmPageContainer";

import { ButtonCard } from "./components/ButtonCard";

const Deploy = () => {
const router = useRouter();
return (
Expand Down
33 changes: 33 additions & 0 deletions src/lib/pages/migrate/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { Heading, Text } from "@chakra-ui/react";

import { ButtonCard } from "lib/components/ButtonCard";
import { Stepper } from "lib/components/stepper";
import WasmPageContainer from "lib/components/WasmPageContainer";

const Migrate = () => {
return (
<WasmPageContainer>
<Text variant="body1" color="text.dark" mb={3} fontWeight={700}>
MIGRATE CONTRACT
</Text>
<Stepper currentStep={1} />
<Heading as="h4" variant="h4" my="48px">
Migrate Contract
</Heading>
{/* Select Migrate Contract modal */}
<ButtonCard
title="Upload new WASM File"
description="Deploy contract by upload new Wasm file"
onClick={() => {}}
mb="16px"
/>
<ButtonCard
title="Use existing Code IDs"
description="Input code ID or select from stored codes or your saved codes"
onClick={() => {}}
/>
</WasmPageContainer>
);
};

export default Migrate;
33 changes: 33 additions & 0 deletions src/lib/pages/update-admin/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { Heading, Text } from "@chakra-ui/react";
import { useRouter } from "next/router";
import { useState } from "react";

import WasmPageContainer from "lib/components/WasmPageContainer";
import { useValidateAddress } from "lib/hooks";
import { getFirstQueryParam } from "lib/utils";

const UpdateAdmin = () => {
const router = useRouter();
const { validateContractAddress } = useValidateAddress();

const contractAddressParam = getFirstQueryParam(router.query.contract);

const [contractAddress] = useState(
!validateContractAddress(contractAddressParam)
? contractAddressParam
: undefined
);

return (
<WasmPageContainer>
<Heading as="h4" variant="h4">
Update Admin
</Heading>
<Text variant="body1" color="text.dark" mb={3} fontWeight={700}>
{contractAddress}
</Text>
</WasmPageContainer>
);
};

export default UpdateAdmin;
3 changes: 3 additions & 0 deletions src/pages/admin.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import UpdateAdmin from "lib/pages/update-admin";

export default UpdateAdmin;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions src/pages/migrate.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Migrate from "lib/pages/migrate";

export default Migrate;
File renamed without changes.

2 comments on commit 8ba8f96

@vercel
Copy link

@vercel vercel bot commented on 8ba8f96 Jan 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 8ba8f96 Jan 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.