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

Color status badge #177

Closed
creo-code opened this issue Jul 29, 2022 · 2 comments
Closed

Color status badge #177

creo-code opened this issue Jul 29, 2022 · 2 comments
Labels
enhancement New feature or request feature request

Comments

@creo-code
Copy link

It would be nice if the status badges for invoices would have colors like the flutter interface..
I am not handy enough to create a good pull request ;) but I thought of something like a case switch in the StatusBadge.tsx

Something like...

  ...
  let className = 'inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium';

  // colors
  switch(props.code) { 
     case '1': { 
        //draft 
        className += ' bg-gray-100 text-gray-800';
        break; 
     }
     case '2': {
        //send
        className += ' bg-blue-100 text-blue-800';
        break; 
     }
     case '3': { 
        //partial/paid 
        className += ' bg-orange-100 text-orange-800';
        break; 
     }
     case '4': { 
        //paid
        className += ' bg-green-100 text-green-800';
        break; 
     }
     default: { 
        //default 
        className += ' bg-gray-100 text-gray-800';
        break; 
     } 
  } 
  ...

https://github.com/invoiceninja/ui/blob/main/src/components/StatusBadge.tsx

I think there is also missing a status code for invoices due over the date.

@beganovich
Copy link
Member

Thanks for suggestion! I will leave it open with feature request label.

@beganovich
Copy link
Member

This has been implemented in #192.

Thanks once again for suggestion 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature request
Projects
None yet
Development

No branches or pull requests

2 participants