Skip to content

Commit

Permalink
Merge pull request #30 from burrowHQ/fix-pool-unclaims
Browse files Browse the repository at this point in the history
Fix pool unclaims
  • Loading branch information
aidai524 authored Nov 23, 2023
2 parents 2490994 + ff7007d commit 90f1dba
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 13 deletions.
2 changes: 1 addition & 1 deletion components/CustomModal/CustomModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const CustomModal = ({
<Portal>
<StyledWrapper
className={twMerge("modal fade", show && "show", className)}
style={show ? { display: "block" } : {}}
// style={show ? { display: "block" } : {}}
>
<div className="overlay" onClick={onOutsideClick} />
<div className={twMerge("modal-dialog background-paper", size && `modal-${size}`)}>
Expand Down
13 changes: 8 additions & 5 deletions components/Modal/Controls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ export default function Controls({
const dispatch = useAppDispatch();

const handleInputChange = (e) => {
const value = e.target.value || 0;
if (new Decimal(value).gt(available)) return;
const { value } = e.target;
const numRegex = /^([0-9]*\.?[0-9]*$)/;
if (!numRegex.test(value) || Number(value) > Number(available)) {
e.preventDefault();
return;
}
dispatch(updateAmount({ isMax: false, amount: value }));
};

Expand Down Expand Up @@ -65,11 +69,10 @@ export default function Controls({
<input
type="number"
placeholder="0.0"
step="0.01"
step="any"
value={inputAmount}
onChange={handleInputChange}
onFocus={handleFocus}
className="text-white"
className="text-white noselect"
/>
</div>
<TokenBox asset={asset} action={action} />
Expand Down
10 changes: 8 additions & 2 deletions screens/Staking/modalStaking.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ const ModalStaking = ({ isOpen, onClose }) => {

const handleInputChange = (e) => {
let { value } = e?.target || {};
const numRegex = /^([0-9]*\.?[0-9]*$)/;
if (!numRegex.test(value)) {
e.preventDefault();
return;
}

if (Number(value) > Number(total)) {
value = total;
}
Expand Down Expand Up @@ -120,9 +126,9 @@ const ModalStaking = ({ isOpen, onClose }) => {
<input
value={inputAmount}
type="number"
step="0.01"
step="any"
onChange={handleInputChange}
onFocus={handleFocus}
className="noselect"
/>
<div className="btn-sm cursor-pointer" onClick={handleMaxClick}>
Max
Expand Down
28 changes: 23 additions & 5 deletions styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ body {
color: #fff;
}

#__next{
background: #14162b;
height: 100%;
}

.sans-bold {
font-family: "work-sans-bold";
}
Expand Down Expand Up @@ -107,14 +112,18 @@ body,
position: fixed;
top: 0;
left: 0;
/*z-index: 1055;*/
/*display: none;*/
/* z-index: 1055; */
/* display: none; */
z-index: -99;
width: 100%;
height: 100%;
overflow-x: hidden;
overflow-y: auto;
outline: 0;
display: flex;
align-items: center;
justify-content: center;
padding: 10px 0;
}

.modal.show {
Expand All @@ -123,8 +132,8 @@ body,

.modal-dialog {
position: relative;
width: auto;
margin: 0.5rem;
width: 100%;
margin: auto 0;
pointer-events: none;
}

Expand Down Expand Up @@ -274,7 +283,6 @@ body,
@media (min-width: 576px) {
.modal-dialog {
max-width: 800px;
margin: 10% auto;
}

.modal-dialog-scrollable {
Expand Down Expand Up @@ -722,3 +730,13 @@ options-list::-webkit-scrollbar {
.nws-modal-wrapper .nws-modal .connecting-details span {
color: #fff;
}

.noselect {
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Safari */
-khtml-user-select: none; /* Konqueror HTML */
-moz-user-select: none; /* Old versions of Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently
supported by Chrome, Edge, Opera and Firefox */
}

0 comments on commit 90f1dba

Please sign in to comment.