Skip to content

Commit

Permalink
Deferred rendering of NotesModalButton untill we have a note from the…
Browse files Browse the repository at this point in the history
… store

Removed previous fix
  • Loading branch information
JochemVH1 committed Jul 3, 2024
1 parent 6924f35 commit 6441bef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ export const NotesModalButton = ({claim, value, onChange, title, variant, disabl
const icon = !value ? 'far fa-comment' : 'far fa-comment-dots';
const showConfirm = !disabled && (!claim || (claim && authService.getClaims().includes(claim)));

if(!text && value){
setText(value);
}

return (
<>
<Button
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/invoice/invoice-edit/EditInvoice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ const EditInvoice = () => {
</div>
<div>
<div className={`invoice-top-buttonbar ${storeInvoice?._id ? 'invoice-edit' : 'invoice-new'}`}>
<NotesModalButton
{invoice.note && <NotesModalButton
claim={invoice.isQuotation ? Claim.ManageQuotations : Claim.ManageInvoices}
value={invoice.note}
onChange={val => updateInvoice('note', val)}
title={t('projectMonth.note')}
variant="link"
/>
/>}
{initInvoice._id && <DownloadInvoiceButton invoice={initInvoice} />}
{storeInvoice?._id && !storeInvoice?.isQuotation && <InvoiceDownloadIcon invoice={invoice} fileType='xml' style={{color: '#0062cc', marginLeft: 20}} />}
</div>
Expand Down

0 comments on commit 6441bef

Please sign in to comment.