Skip to content

Commit

Permalink
Merge pull request #40 from Agoric/ta/import-types
Browse files Browse the repository at this point in the history
use TypeScript
  • Loading branch information
turadg authored Nov 4, 2022
2 parents 9028b67 + 1bba84e commit 83a0fc8
Show file tree
Hide file tree
Showing 15 changed files with 663 additions and 1,208 deletions.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@agoric/casting": "dev",
"@agoric/ertp": "^0.14.2",
"@agoric/ui-components": "^0.2.33",
"@agoric/web-components": "0.5.1-dev-a4976a7.0",
"@agoric/zoe": "0.24.0",
"@agoric/casting": "^0.3.3-dev-f5341af.0",
"@agoric/ertp": "^0.15.4-dev-f5341af.0",
"@agoric/ui-components": "^0.3.4-dev-f5341af.0",
"@agoric/web-components": "^0.5.1-dev-f5341af.0",
"@agoric/zoe": "^0.25.4-dev-f5341af.0",
"@endo/eventual-send": "^0.16.0",
"@endo/init": "0.5.43",
"@endo/init": "^0.5.43",
"@headlessui/react": "^1.6.6",
"@types/node": "^18.7.13",
"@types/react": "^18.0.17",
Expand Down
4 changes: 3 additions & 1 deletion src/components/AssetDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { Brand } from '@agoric/ertp';
import { useAtomValue } from 'jotai';

import AssetListItem from 'components/AssetListItem';
import ListItem from 'components/ListItem';
import SkeletonListItem from 'components/SkeletonListItem';
import { displayFunctionsAtom } from 'store/app';

// Ambient
import '@agoric/ertp/src/types.js';

const AssetDialog = ({
brands,
handleBrandSelected,
Expand Down
4 changes: 3 additions & 1 deletion src/components/AssetListItem.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { useAtomValue } from 'jotai';

import { Brand } from '@agoric/ertp';
import { displayFunctionsAtom } from 'store/app';

// Ambient
import '@agoric/ertp/src/types';

const AssetListItem = ({ brand }: { brand: Brand }) => {
const { displayBrandIcon, displayBrandPetname } =
useAtomValue(displayFunctionsAtom);
Expand Down
5 changes: 4 additions & 1 deletion src/components/CustomInput.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { AmountMath, AssetKind, Brand } from '@agoric/ertp';
import { AmountMath, AssetKind } from '@agoric/ertp';
import { useState } from 'react';
import { parseAsValue, stringifyValue } from '@agoric/ui-components';
import { useAtomValue } from 'jotai';
import { displayFunctionsAtom } from 'store/app';
import { PursesJSONState } from '@agoric/wallet-backend';
import { calcSignificantDecimalPlaces } from 'utils/displayFunctions';

// Ambient
import '@agoric/ertp/src/types';

const DEFAULT_PLACES_TO_SHOW = 2;

const CustomInput = ({
Expand Down
4 changes: 3 additions & 1 deletion src/components/DialogSwap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
import { AnimatePresence, motion } from 'framer-motion';
import { FiX, FiExternalLink } from 'react-icons/fi';

import { Brand } from '@agoric/ertp';
import AssetDialog from 'components/AssetDialog';

// Ambient
import '@agoric/ertp/src/types';

const DialogSwap = ({
open,
handleClose,
Expand Down
5 changes: 4 additions & 1 deletion src/components/SectionSwap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { useState } from 'react';
import { motion } from 'framer-motion';
import { FiChevronDown } from 'react-icons/fi';
import { useAtomValue, useAtom } from 'jotai';
import { AmountMath, Brand } from '@agoric/ertp';
import clsx from 'clsx';

import CustomInput from 'components/CustomInput';
Expand All @@ -22,6 +21,10 @@ import {
selectedAnchorPetnameAtom,
} from 'store/swap';

// Ambient
import '@agoric/ertp/src/types';
import { AmountMath } from '@agoric/ertp';

export enum SectionSwapType {
FROM = 'FROM',
TO = 'TO',
Expand Down
Loading

0 comments on commit 83a0fc8

Please sign in to comment.