Skip to content

Commit

Permalink
feat: show subscription usage in a progress bar
Browse files Browse the repository at this point in the history
  • Loading branch information
kunish committed Sep 1, 2023
1 parent f5d65eb commit 24bfadd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/components/SubscriptionInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,12 @@ export default (props: { subscriptionInfo: SubscriptionInfo }) => {

return (
<>
<progress class="progress" value={info.percentage} max="100" />

<div class="text-sm text-slate-500">
{`${info.used}`} / {`${info.total}`} ( {info.percentage}% )
</div>

<div class="text-sm text-slate-500">Expire: {info.expireStr()} </div>
</>
)
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Proxies.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export default () => {
{(proxyProvider) => {
const title = (
<div class="flex items-center justify-between">
<div class="flex flex-col">
<div class="flex flex-col gap-1">
<span>{proxyProvider.name}</span>
<SubscriptionInfo
subscriptionInfo={proxyProvider.subscriptionInfo}
Expand All @@ -135,7 +135,7 @@ export default () => {
</div>
</div>

<div>
<div class="flex flex-nowrap">
<button
class="btn btn-circle btn-sm mr-2"
onClick={(e) =>
Expand Down

0 comments on commit 24bfadd

Please sign in to comment.