Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jarryd/242/buttons for governance txs #302

Merged
merged 4 commits into from
Mar 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
### Features
- Add message type gas statistics #260
- Add calls to getAssetMetadata where explicitly needed #283
- Add buttons for governance voting #242

## 2.6.0

Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"private": false,
"sideEffects": false,
"dependencies": {
"@provenanceio/wallet-lib": "0.14.0",
"@provenanceio/wallet-lib": "2.1.0",
"axios": "0.21.2",
"bech32": "2.0.0",
"big.js": "6.1.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React from 'react';
import PropTypes from 'prop-types';
import styled, { useTheme } from 'styled-components';
// @ts-ignore
import useOnEscape from 'react-tiny-hooks/use-on-escape';
import { breakpoints } from 'consts';
import OgSprite from 'Components/Sprite';

const Wrapper = styled.div`
const Wrapper = styled.div<{ isOpen: boolean}>`
display: ${({ isOpen }) => (isOpen ? 'flex' : 'none')};
position: fixed;
top: 0;
Expand Down Expand Up @@ -63,7 +63,13 @@ const Body = styled.div`
flex: 1 1 auto;
`;

const Modal = React.memo(({ children, isOpen, onClose }) => {
interface ModalProps {
children: React.ReactElement;
isOpen?: boolean;
onClose: () => void;
}

const Modal = React.memo(({ children, isOpen = false, onClose }: ModalProps) => {
const theme = useTheme();
useOnEscape(onClose);

Expand All @@ -80,14 +86,4 @@ const Modal = React.memo(({ children, isOpen, onClose }) => {
);
});

Modal.propTypes = {
children: PropTypes.any.isRequired,
isOpen: PropTypes.bool,
onClose: PropTypes.func.isRequired,
};

Modal.defaultProps = {
isOpen: false,
};

export default Modal;
3 changes: 3 additions & 0 deletions src/Components/Sprite/Sprite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ interface SpriteTypes extends SvgProps {
height?: string;
icon: string;
width?: string;
onClick?: () => void;
}

const Svg =
Expand All @@ -39,6 +40,7 @@ const Sprite = ({
secondaryColor = 'WHITE',
size = '100%',
spin = 0,
onClick,
...svgIcons
}: SpriteTypes) => {

Expand All @@ -59,6 +61,7 @@ const Sprite = ({
size={size}
spin={spin}
secondaryColor={secondaryColorValue}
onClick={onClick}
>
<use href={`#${icon}`} />
</Svg>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ const AccountUnbondings = () => {
{ displayName: 'End Time', dataName: 'endTime' },
];

const totalAmount = formatDenom(rAmount + uAmount, uDenom, { decimal: 2 });
const totalAmount = formatDenom(parseFloat(rAmount) + parseFloat(uAmount), uDenom, {
decimal: 2,
});

return (
<ButtonWrapper>
Expand Down
Loading