-
Couldn't load subscription status.
- Fork 9
feat: Enhance Status Column with Colors for Better Readability #219
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
Merged
sstefdev
merged 5 commits into
main
from
161-colorize-the-status-column-in-the-invoice-dashboard
Nov 27, 2024
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
bb29371
feat: added status label component
sstefdev 72dc654
fix: added missing functions, updated styles for every status
sstefdev 6d91db2
Merge branch 'main' of github.com:RequestNetwork/web-components into …
sstefdev 30f3bba
Merge branch 'main' of github.com:RequestNetwork/web-components into …
sstefdev edb065f
Merge branch 'main' into 161-colorize-the-status-column-in-the-invoic…
sstefdev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| <script lang="ts"> | ||
| import { capitalize } from "../utils/capitalize"; | ||
|
|
||
| export let status: string; | ||
|
|
||
| let statusClass = ""; | ||
|
|
||
| $: { | ||
| switch (status.toLowerCase()) { | ||
| case "paid": | ||
| statusClass = "status-paid"; | ||
| break; | ||
| case "partially paid": | ||
| statusClass = "status-partially-paid"; | ||
| break; | ||
| case "accepted": | ||
| statusClass = "status-accepted"; | ||
| break; | ||
| case "awaiting payment": | ||
| statusClass = "status-created"; | ||
| break; | ||
| case "canceled": | ||
| statusClass = "status-canceled"; | ||
| break; | ||
| case "rejected": | ||
| statusClass = "status-rejected"; | ||
| break; | ||
| case "overdue": | ||
| statusClass = "status-overdue"; | ||
| break; | ||
| case "pending": | ||
| statusClass = "status-pending"; | ||
| break; | ||
| default: | ||
| statusClass = "status-created"; | ||
| } | ||
| } | ||
sstefdev marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| </script> | ||
|
|
||
| <div class={`status-indicator ${statusClass}`}> | ||
| {capitalize(status)} | ||
| </div> | ||
|
|
||
| <style> | ||
| .status-indicator { | ||
| text-align: center; | ||
| padding: 6px 12px; | ||
| text-align: center; | ||
| width: fit-content; | ||
| border-radius: 8px; | ||
| font-weight: 500; | ||
| } | ||
|
|
||
| .status-paid { | ||
| color: #328965; | ||
| background-color: rgba(88, 225, 165, 0.15); | ||
| } | ||
|
|
||
| .status-partially-paid { | ||
| color: #328965; | ||
| background: linear-gradient( | ||
| 135deg, | ||
| rgba(88, 225, 165, 0.2) 25%, | ||
| white 25%, | ||
| white 50%, | ||
| rgba(88, 225, 165, 0.2) 50%, | ||
| rgba(88, 225, 165, 0.2) 75%, | ||
| white 75%, | ||
| white 100% | ||
| ); | ||
| background-size: 20px 20px; | ||
| } | ||
|
|
||
| .status-accepted { | ||
| color: #006ebe; | ||
| background-color: rgba(90, 186, 255, 0.15); | ||
| } | ||
|
|
||
| .status-created { | ||
| color: #c99101; | ||
| background-color: rgba(255, 197, 49, 0.15); | ||
| } | ||
|
|
||
| .status-canceled { | ||
| color: #212121; | ||
| background-color: rgba(37, 37, 37, 0.15); | ||
| } | ||
|
|
||
| .status-rejected { | ||
| color: #d9601c; | ||
| background-color: rgba(255, 135, 67, 0.15); | ||
| } | ||
|
|
||
| .status-overdue { | ||
| color: #d91c1c; | ||
| background-color: rgba(255, 49, 49, 0.15); | ||
| } | ||
|
|
||
| .status-pending { | ||
| color: #7b7b7b; | ||
| background-color: rgba(224, 224, 224, 0.15); | ||
| } | ||
| </style> | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.