-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/staging' into 257-metamask-snap-…
…integration
- Loading branch information
Showing
29 changed files
with
391 additions
and
240 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "pendulum-chain-portal", | ||
"private": true, | ||
"version": "1.2.1", | ||
"version": "1.3.0", | ||
"type": "module", | ||
"packageManager": "[email protected]", | ||
"scripts": { | ||
|
@@ -69,8 +69,6 @@ | |
"@babel/plugin-proposal-class-properties": "^7.18.6", | ||
"@babel/preset-env": "^7.20.2", | ||
"@babel/preset-typescript": "^7.18.6", | ||
"@esbuild-plugins/node-globals-polyfill": "^0.1.1", | ||
"@esbuild-plugins/node-modules-polyfill": "^0.1.4", | ||
"@graphql-codegen/cli": "~5.0.0", | ||
"@graphql-codegen/client-preset": "~4.1.0", | ||
"@pendulum-chain/types": "^0.2.3", | ||
|
@@ -100,6 +98,7 @@ | |
"@typescript-eslint/parser": "^5.53.0", | ||
"autoprefixer": "^10.4.13", | ||
"daisyui": "^2.52.0", | ||
"esbuild-plugin-polyfill-node": "^0.3.0", | ||
"eslint": "^8.34.0", | ||
"eslint-plugin-jest": "^27.2.1", | ||
"eslint-plugin-react": "^7.32.2", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { HTMLAttributes } from 'preact/compat'; | ||
import { useGlobalState } from '../GlobalStateProvider'; | ||
import { TenantName } from '../models/Tenant'; | ||
import AmplitudeLogo from './AmplitudeLogo'; | ||
import PendulumLogo from './PendulumLogo'; | ||
|
||
interface Props extends HTMLAttributes<SVGSVGElement> { | ||
className?: string; | ||
} | ||
|
||
const ChainLogo = (props: Props) => { | ||
const { tenantName } = useGlobalState(); | ||
if (tenantName === TenantName.Pendulum) { | ||
return <PendulumLogo {...props} />; | ||
} else { | ||
return <AmplitudeLogo {...props} />; | ||
} | ||
}; | ||
|
||
export default ChainLogo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import { Input } from 'react-daisyui'; | ||
import { UseFormRegisterReturn } from 'react-hook-form'; | ||
import { roundNumber } from '../../../shared/parseNumbers'; | ||
|
||
export interface AmountProps { | ||
className?: string; | ||
max?: number; | ||
min?: number; | ||
register: UseFormRegisterReturn; | ||
setValue: (n: number) => void; | ||
assetSuffix?: string; | ||
error?: string; | ||
} | ||
|
||
const Amount = ({ className, register, max, setValue, assetSuffix, error }: AmountProps): JSX.Element | null => { | ||
return ( | ||
<> | ||
<div | ||
className={`rounded-lg bg-base-300 px-4 py-3 ${className || ''} ${ | ||
error ? 'border border-solid border-red-400' : '' | ||
}`} | ||
> | ||
<div className="w-full flex justify-between"> | ||
<div className="flex-grow text-4xl text-accent-content font-2"> | ||
<Input | ||
className="input-ghost w-full text-4xl font-2 pl-0 focus:outline-none" | ||
type="number" | ||
step="any" | ||
onKeyPress={(e: KeyboardEvent) => { | ||
if (e.code === 'Minus' || e.code === 'KeyE') { | ||
e.preventDefault(); | ||
} | ||
}} | ||
placeholder="0.0" | ||
{...register} | ||
/> | ||
</div> | ||
<div className="flex"> | ||
<button | ||
className="text-accent-content underline hover:opacity-70 mx-1 font-semibold" | ||
onClick={() => setValue(roundNumber(Number(max) * 0.5))} | ||
type="button" | ||
> | ||
50% | ||
</button> | ||
<button | ||
className="text-accent-content underline hover:opacity-70 mx-1 font-semibold" | ||
onClick={() => setValue(roundNumber(Number(max)))} | ||
type="button" | ||
> | ||
MAX | ||
</button> | ||
</div> | ||
</div> | ||
<div className="flex justify-between items-center dark:text-neutral-400 text-neutral-500"> | ||
<div className="text-sm mt-px">Amount</div> | ||
<div className="flex gap-1 text-sm"> | ||
{max !== undefined && <span className="mr-1">Available: {max.toFixed(2)}</span>} | ||
</div> | ||
</div> | ||
</div> | ||
<label className="label">{error && <span className="label-text text-red-400">{error}</span>}</label> | ||
</> | ||
); | ||
}; | ||
export default Amount; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.