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

fixed withdraw ui #1058

Merged
merged 1 commit into from
Dec 7, 2023
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
2 changes: 1 addition & 1 deletion frontend/app/src/people/widgetViews/WidgetSwitchViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ function WidgetSwitchViewer(props: any) {
) : (
<NoResults />
);
const showLoadMore = totalBounties > currentItems && activeList.length > 1;
const showLoadMore = totalBounties > currentItems && activeList.length >= queryLimit;
return (
<>
{listItems}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import Invoice from '../summaries/wantedSummaries/Invoice';
import { AddBudgetModalProps, InvoiceState, Toast } from './interface';
import ExpiredInvoice from './ExpiredInvoice';
import PaidInvoice from './PaidInvoice';
import { BudgetButton } from './style';

const color = colors['light'];

Expand Down Expand Up @@ -100,29 +101,6 @@ const UsdValue = styled.p`
margin-bottom: 0;
`;

const Button = styled.button`
width: 100%;
padding: 1rem;
border-radius: 0.375rem;
margin-top: 1.25rem;
font-family: 'Barlow';
font-size: 0.9375rem;
font-style: normal;
font-weight: 500;
letter-spacing: 0.00938rem;
background: #49c998;
box-shadow: 0px 2px 10px 0px rgba(73, 201, 152, 0.5);
border: none;
color: #fff;
&:disabled {
border: 1px solid rgba(0, 0, 0, 0.07);
background: rgba(0, 0, 0, 0.04);
color: rgba(142, 150, 156, 0.85);
cursor: not-allowed;
box-shadow: none;
}
`;

const InvoiceQrWrapper = styled.div`
width: 13.5rem;
margin-left: 4.75rem;
Expand Down Expand Up @@ -272,9 +250,9 @@ const AddBudgetModal = (props: AddBudgetModalProps) => {
</InvoiceInputWrapper>
<UsdValue>{satToUsd(Number(amount))} USD</UsdValue>
</InvoiceWrapper>
<Button disabled={!Number(amount) || isLoading} onClick={generateInvoice}>
<BudgetButton disabled={!Number(amount) || isLoading} onClick={generateInvoice}>
{isLoading ? <EuiLoadingSpinner size="m" /> : 'Generate Invoice'}
</Button>
</BudgetButton>
</InvoiceForm>
</>
)}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { useState } from 'react';
import { Wrap } from 'components/form/style';
import { useIsMobile } from 'hooks/uiHooks';
import { InvoiceForm, InvoiceInput, InvoiceLabel } from 'people/utils/style';
import { useStores } from 'store';
Expand All @@ -14,7 +13,7 @@ import { colors } from '../../../config/colors';
import successIcon from '../../../public/static/withdraw_success.svg';
import errorIcon from '../../../public/static/error.svg';
import { WithdrawModalProps } from './interface';
import { Grey } from './style';
import { BudgetButton, Grey } from './style';

const color = colors['light'];

Expand Down Expand Up @@ -74,6 +73,13 @@ const ErrorText = styled(SuccessText)`
text-align: center;
`;

const Wrapper = styled.div`
width: 100%;
display: flex;
flex-direction: column;
padding: 40px 50px;
`;

const WithdrawBudgetModal = (props: WithdrawModalProps) => {
const [paymentRequest, setPaymentRequest] = useState('');
const [amountInSats, setAmountInSats] = useState(0);
Expand Down Expand Up @@ -128,7 +134,11 @@ const WithdrawBudgetModal = (props: WithdrawModalProps) => {
envStyle={{
marginTop: isMobile ? 64 : 0,
background: color.pureWhite,
zIndex: 20
zIndex: 20,
maxHeight: '100%',
borderRadius: '10px',
minWidth: '22rem',
minHeight: '20rem'
}}
overlayClick={close}
bigCloseImage={close}
Expand All @@ -139,7 +149,7 @@ const WithdrawBudgetModal = (props: WithdrawModalProps) => {
borderRadius: '50%'
}}
>
<Wrap newDesign={true}>
<Wrapper>
{paymentSettled && (
<PaymentDetailsWrap>
<SuccessImage src={successIcon} />
Expand Down Expand Up @@ -211,22 +221,21 @@ const WithdrawBudgetModal = (props: WithdrawModalProps) => {
onChange={(e: any) => setPaymentRequest(e.target.value)}
/>
</InvoiceForm>
<Button
text={'Confirm'}
<BudgetButton
disabled={!paymentRequest ? true : false}
style={{
borderRadius: '8px',
marginTop: '12px',
color: paymentRequest ? '#FFF' : 'rgba(142, 150, 156, 0.85)',
background: paymentRequest ? '#9157F6' : 'rgba(0, 0, 0, 0.04)'
}}
height={48}
width={'100%'}
onClick={() => getInvoiceDetails(paymentRequest)}
/>
>
Confirm
</BudgetButton>
</>
)}
</Wrap>
</Wrapper>
</Modal>
);
};
Expand Down
23 changes: 23 additions & 0 deletions frontend/app/src/people/widgetViews/organization/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -760,3 +760,26 @@ export const AssingUserBtn = styled.button`
box-shadow: none;
}
`;

export const BudgetButton = styled.button`
width: 100%;
padding: 1rem;
border-radius: 0.375rem;
margin-top: 1.25rem;
font-family: 'Barlow';
font-size: 0.9375rem;
font-style: normal;
font-weight: 500;
letter-spacing: 0.00938rem;
background: #49c998;
box-shadow: 0px 2px 10px 0px rgba(73, 201, 152, 0.5);
border: none;
color: #fff;
&:disabled {
border: 1px solid rgba(0, 0, 0, 0.07);
background: rgba(0, 0, 0, 0.04);
color: rgba(142, 150, 156, 0.85);
cursor: not-allowed;
box-shadow: none;
}
`;
Loading