Skip to content

Commit

Permalink
feature/copy-fixes (#12)
Browse files Browse the repository at this point in the history
* Update page title and description in index.html and en.json

Signed-off-by: Bartosz Solka <[email protected]>

* feat: account ids field validation improvements

Signed-off-by: michalrozekariane <[email protected]>

---------

Signed-off-by: Bartosz Solka <[email protected]>
Signed-off-by: michalrozekariane <[email protected]>
Co-authored-by: Bartosz Solka <[email protected]>
  • Loading branch information
1 parent 309004e commit 15c9694
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="hederaIcon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Hedera airdrop helper</title>
<title>Hedera Airdrop List Verifier</title>
</head>
<body>
<div id="root"></div>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "airdrop-list-verifier",
"name": "hedera-airdrop-list-verifier",
"homepage": "https://Ashe-Oro-Accelerator.github.io/airdrop-list-verifier",
"private": true,
"version": "0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { defaultNetwork } from '@/utils/const';
const App = () => {
const [tokenId, setTokenId] = useState<string>('');
const [accountIds, setAccountIds] = useState<string[]>([]);
const [shouldFetch, setShouldFetch] = useState(false);
const [shouldFetch, setShouldFetch] = useState<boolean>(false);
const [fetchedAccountsBalance, setFetchedAccountsBalance] = useState<number>(0);

const {
Expand Down
6 changes: 3 additions & 3 deletions src/dictionary/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"copiedToClipboard": "Copied to clipboard",
"copyToClipboard": "Copy to clipboard",
"httpError": "HTTP error! Status:",
"title": "Hedera airdrop helper",
"description": "Just pass a TokenId and a list of account ids that you want to airdrop to. The app will return you a list of addresses that are either associated with the token or have available auto association slots.",
"title": "Hedera Airdrop List Verifier",
"description": "Provide a list of Account IDs and a Token ID and this app will return only the accounts which can successfully receive the token as an airdrop.",
"tokenId": "TokenId",
"exampleTokenId": "0.0.1234",
"accountIds": "Account Ids list",
Expand All @@ -15,5 +15,5 @@
"successfullyFetchedData": "Successfully fetched data",
"tokenIdFormatError": "TokenId must be in the format 0.0.x",
"minAmountFormatError": "MinAmount must be a number greater than or equal to 0",
"accountIdsFormatError": "AccountIds must be a string representation of an csv. Example: 0.0.123, 0.0.124, 0.0.125, 0.0.126"
"accountIdsFormatError": "Account ids should be comma separated."
}
5 changes: 4 additions & 1 deletion src/utils/formSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ export const formSchema = z.object({
}),
accountIds: z.string().refine(
(value) => {
const splitValues = value.split(/, |\s|\n/);
const splitValues = value
.split(/\s*,\s*|\n/)
.map((item) => item.trim())
.filter((item) => item);
return splitValues.every((item) => /^0\.0\.\d*$/.test(item));
},
{
Expand Down

0 comments on commit 15c9694

Please sign in to comment.