Skip to content

Commit

Permalink
Merge pull request #26 from alleslabs/fix-typos
Browse files Browse the repository at this point in the history
fix(pages): fix typos and misc
  • Loading branch information
evilpeach committed Dec 22, 2022
2 parents 6db9322 + 2ce88d9 commit 7801f7d
Show file tree
Hide file tree
Showing 15 changed files with 117 additions and 115 deletions.
2 changes: 1 addition & 1 deletion src/lib/app-fns/tx/upload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const uploadContractTx = ({
},
],
receiptInfo: {
header: "Upload WASM Complete",
header: "Upload Wasm Complete",
description: (
<>
<span style={{ fontWeight: 700 }}>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/dropzone/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function DropZone({ setFile, ...componentProps }: DropZoneProps) {
<span style={{ color: "#f48fb1", textDecoration: "underline" }}>
Click to upload
</span>{" "}
or drag WASM file here
or drag Wasm file here
</Text>
<Text variant="body2" color="text.dark">
.wasm (max. 800KB)
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/state/ZeroState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const ZeroState = ({ list, isReadOnly }: ZeroStateProps) => {
<Flex alignItems="center" flexDir="column" gap="4">
<Icon as={MdSearch} color="gray.600" boxSize="16" />
<Text color="gray.500">
You don’t have any deploy or saved contracts.
You don’t have any deployed or saved contracts.
</Text>
{!isReadOnly && (
<>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/pages/codes/components/CodesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const Empty = ({ type }: OtherTBodyProps) => {
</Text>
) : (
<Text color="text.dark">
Your uploaded WASM files will display as My Stored Codes
Your uploaded Wasm files will display as My Stored Codes
</Text>
)}
</StateContainer>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/pages/codes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const Codes = observer(() => {
<CustomTab codeCount={savedCodesCount}>My Saved Codes </CustomTab>
</TabList>
<InputWithIcon
placeholder="Search with Code ID or Code Description"
placeholder="Search with code ID or code description"
value={keyword}
onChange={handleFilterChange}
/>
Expand Down
4 changes: 2 additions & 2 deletions src/lib/pages/deploy/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ const Deploy = () => {
Select Deploy Option
</Heading>
<ButtonCard
title="Upload new WASM File"
description="Deploy contract by uploading a new WASM file"
title="Upload new Wasm File"
description="Deploy contract by upload new Wasm file"
onClick={() => router.push("/upload")}
mb="16px"
/>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/pages/home/components/QuickMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const QuickMenu = () => {
Deploy new contract
</Text>
<Text color="gray.900" variant="body2">
Deploy contract by upload new WASM file
Deploy contract by upload new Wasm file
</Text>
</Flex>
<Icon as={MdChevronRight} color="gray.900" boxSize={9} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { IoList } from "react-icons/io5";

import { useCodeListData } from "lib/pages/codes/data";

import { CodeTable } from "./CodeTable";
import { CodeTableReadOnly } from "./CodeTableReadOnly";

interface CodeSelectModalButtonProps {
onCodeSelect: (code: string) => void;
Expand Down Expand Up @@ -67,11 +67,14 @@ export const CodeSelectModalButton = ({
<Text variant="body1" fontWeight={700} ml="24px" mb="24px">
My Stored Codes
</Text>
<CodeTable onCodeSelect={handleSelect} codes={storedCodes} />
<CodeTableReadOnly
onCodeSelect={handleSelect}
codes={storedCodes}
/>
<Text variant="body1" fontWeight={700} ml="24px" my="24px">
Saved Codes
</Text>
<CodeTable onCodeSelect={handleSelect} codes={savedCodes} />
<CodeTableReadOnly onCodeSelect={handleSelect} codes={savedCodes} />
</ModalBody>
</ModalContent>
</Modal>
Expand Down
88 changes: 0 additions & 88 deletions src/lib/pages/instantiate/component/code-select/CodeTable.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
import {
Table,
TableContainer,
Tbody,
Td,
Text,
Th,
Thead,
Tr,
} from "@chakra-ui/react";

import type { CodeInfo } from "lib/types";
import { truncate } from "lib/utils";

interface TableRowProps {
onCodeSelect: (newVal: string) => void;
codeDetail: CodeInfo;
}

const TableRow = ({ onCodeSelect, codeDetail }: TableRowProps) => {
return (
<Tr
sx={{
"& td:first-of-type": { pl: "60px" },
"& td:last-child": { pr: "60px" },
}}
cursor="pointer"
_hover={{ bg: "gray.900", transition: "all .2s" }}
onClick={() => onCodeSelect(codeDetail.id.toString())}
>
<Td width="20%">
<Text variant="body2">{codeDetail.id}</Text>
</Td>
<Td width="40%">
<Text variant="body2" className="ellipsis">
{codeDetail?.description ?? "No Description"}
</Text>
</Td>
<Td width="15%" textAlign="center">
<Text variant="body2">{codeDetail.contracts}</Text>
</Td>
<Td width="25%">
<Text variant="body2">{truncate(codeDetail.uploader)}</Text>
</Td>
</Tr>
);
};

interface CodeTableReadOnlyProps {
onCodeSelect: (code: string) => void;
codes: CodeInfo[];
}

export const CodeTableReadOnly = ({
onCodeSelect,
codes,
}: CodeTableReadOnlyProps) => {
return (
<TableContainer w="full" my="16px">
<Table variant="simple">
<Thead>
<Tr
sx={{
"& th:first-of-type": { pl: "60px" },
"& th:last-child": { pr: "60px" },
"& th": { textTransform: "none", border: "none", color: "white" },
}}
>
<Th width="20%">Code ID</Th>
<Th width="40%">Description</Th>
<Th width="15%">Contracts</Th>
<Th width="25%">Uploader</Th>
</Tr>
</Thead>
<Tbody>
{codes.map((code, index) => (
<TableRow
key={code.id + index.toString()}
codeDetail={code}
onCodeSelect={onCodeSelect}
/>
))}
</Tbody>
</Table>
</TableContainer>
);
};
4 changes: 2 additions & 2 deletions src/lib/pages/pastTxs/components/MsgDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ const MsgDetail = ({ msg, success }: MsgDetailProps) => {
const singleMsgProps: SingleMsgProps = success
? {
type: "Upload",
text1: "WASM to Code ID",
text1: "Wasm to Code ID",
text3: msgUpload.id?.toString(),
}
: {
type: "Failed",
text1: "to upload WASM file",
text1: "to upload Wasm file",
};
return <SingleMsg {...singleMsgProps} />;
}
Expand Down
10 changes: 5 additions & 5 deletions src/lib/pages/pastTxs/components/PastTxTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@ const PastTxTable = ({ element }: PastTxTableProps) => {
? {
type: "Upload",
length: uploadMsgs.length,
text: "WASM files",
text: "Wasm files",
}
: {
type: "Failed to upload",
length: uploadMsgs.length,
text: "WASM files",
text: "Wasm files",
};
return <MultipleMsg {...multipleMsgProps} />;
}
Expand All @@ -132,12 +132,12 @@ const PastTxTable = ({ element }: PastTxTableProps) => {
const singleMsgProps: SingleMsgProps = element.success
? {
type: "Upload",
text1: "WASM to Code ID",
text1: "Wasm to Code ID",
text3: uploadMsgs[0].id.toString(),
}
: {
type: "Failed",
text1: "to upload WASM file",
text1: "to upload Wasm file",
};
return <SingleMsg {...singleMsgProps} />;
},
Expand Down Expand Up @@ -467,7 +467,7 @@ const PastTxTable = ({ element }: PastTxTableProps) => {
<Td border={hideBorder}>
<Flex role="group" w="fit-content">
<ExplorerLink
value={element.hash.substring(2)}
value={element.hash.substring(2).toUpperCase()}
type="tx_hash"
canCopyWithHover
/>
Expand Down
10 changes: 5 additions & 5 deletions src/lib/pages/pastTxs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ const PastTxs = () => {
Past transactions involving the Wasm module will display here
</Text>
<Text variant="body1" color="text.dark">
This includes MsgStoreCode, MsgInstantiateContract, and
MsgExecuteContract
such as Instantiate, Execute, or Upload Wasm file will display
here.
</Text>
</Flex>
</>
Expand Down Expand Up @@ -212,7 +212,7 @@ const PastTxs = () => {
<FalseState
icon="on"
text1="Past transactions involving with Wasm module"
text2="such as Instantiate, Execute, or Upload WASM file will display here."
text2="such as Instantiate, Execute, or Upload Wasm file will display here."
/>
);
}
Expand All @@ -238,7 +238,7 @@ const PastTxs = () => {
Messages
</Th>
<Th textTransform="none" w="25%">
Time Stamp
Timestamp
</Th>
<Th w="10%" />
<Th w="5%" />
Expand Down Expand Up @@ -342,7 +342,7 @@ const PastTxs = () => {
size="sm"
onClick={() => setIbcButton(!ibcButton)}
>
IBC Layers
IBC
</Button>
</Flex>
</Box>
Expand Down
6 changes: 3 additions & 3 deletions src/lib/pages/upload/components/UploadCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ const getStatusDecorator = (
case "Completed":
return {
icon: <Icon as={MdCheckCircle} boxSize="6" color="success.main" />,
statusText: <span style={{ color: "#66BB6A" }}>Valid WASM file</span>,
statusText: <span style={{ color: "#66BB6A" }}>Valid Wasm file</span>,
};
case "Failed":
return {
icon: <Icon as={IoIosWarning} boxSize="6" color="error.main" />,
statusText: <span style={{ color: "#EF5350" }}>Invalid WASM file</span>,
statusText: <span style={{ color: "#EF5350" }}>Invalid Wasm file</span>,
helperText: error,
};
default:
Expand Down Expand Up @@ -73,7 +73,7 @@ export const UploadCard = ({
{file.name}
</Text>
<Text variant="body2" color="text.dark">
{big(file.size).div(1000).toFixed(0)} kb{statusText}
{big(file.size).div(1000).toFixed(0)} KB{statusText}
</Text>
</Flex>
<Flex align="center" gap="16px" ml="auto">
Expand Down
2 changes: 1 addition & 1 deletion src/lib/pages/upload/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const Upload = () => {
</Text>
<Stepper currentStep={1} />
<Heading as="h4" variant="h4" my="48px">
Upload wasm file
Upload Wasm file
</Heading>
<ConnectWalletAlert
subtitle="You need to connect your wallet first"
Expand Down

1 comment on commit 7801f7d

@vercel
Copy link

@vercel vercel bot commented on 7801f7d Dec 22, 2022

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.