Skip to content

Commit b0736d2

Browse files
committed
improve card grants
1 parent c66768a commit b0736d2

File tree

6 files changed

+15
-13
lines changed

6 files changed

+15
-13
lines changed

app/views/card_grants/_actions.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<%# locals: (card_grant:) %>
22

33
<% if card_grant.active? %>
4-
<div class="mt3 flex flex-wrap align-items-center justify-start g1 justify-center">
4+
<div class="card card--breakdown flex flex-col gap-2">
55
<% if organizer_signed_in?(as: :member) %>
66
<%= render "stripe_cards/actions/freeze", stripe_card: card_grant.stripe_card if card_grant.stripe_card.present? %>
77
<%= render "card_grants/actions/convert_to_reimbursement_report", card_grant:, label: card_grant.user == current_user ? "Get reimbursed" : "Create reimbursement report" %>
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<%# locals: (card_grant:) %>
22

3-
<div class="stat mt3 mx-auto <%= "muted" if card_grant.balance == 0 %>" style="width: fit-content">
4-
<span class="stat__label">Balance remaining</span>
5-
<span class="stat__value"><%= card_grant.balance.format(symbol: false) %></span>
3+
<div class="statset mb-2">
4+
<div class="stat">
5+
<span class="stat__label">Balance remaining</span>
6+
<span class="stat__value"><%= card_grant.balance.format(symbol: false) %></span>
7+
</div>
68
</div>

app/views/card_grants/_header_banner.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
</p>
2222
</div>
2323

24-
<section class="details-horiz">
24+
<section class="details-horiz px-4">
2525
<p>
2626
<strong>Sent by</strong>
2727
<%= user_mention card_grant.sent_by %>

app/views/card_grants/actions/_convert_to_reimbursement_report.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<%= link_to convert_to_reimbursement_report_event_card_grant_path(id: card_grant.hashid, event_id: @event.slug),
77
method: :post,
88
data: { confirm: "Are you sure? This will cancel your card grant and convert it into a reimbursement report." },
9-
class: "btn bg-purple",
9+
class: "btn",
1010
disabled: !policy(card_grant).convert_to_reimbursement_report? do %>
1111
<%= inline_icon "attachment", size: 20 %> <%= label %>
1212
<% end %>

app/views/card_grants/show.html.erb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<% end %>
2727
<% end %>
2828

29-
<div class="mt4 mb4 check--form flex justify-center <%= "flex-wrap" if @frame %>" style="gap: 3rem">
29+
<div class="sm:mt-5 check--form flex justify-center <%= "flex-wrap" if @frame %>" style="gap: 3rem">
3030
<%# Grantee has pending invite %>
3131
<% if @card_grant.user == current_user && @card_grant.pending_invite? %>
3232
<% if @card_grant.canceled? %>
@@ -36,16 +36,16 @@
3636
<% end %>
3737
<%# Grantee has accepted invite %>
3838
<% elsif @card_grant.user.admin? || organizer_signed_in? || @card_grant.user == current_user %>
39-
<div class="justify-center grid grid-cols-1 <%= "md:grid-cols-2" if @card_grant.stripe_card.present? %>">
39+
<div class="justify-center flex flex-col sm:flex-row w-full gap-2">
4040
<% if @card_grant.stripe_card %>
41-
<div>
41+
<div class="sm:max-w-[300px]">
4242
<%= render "stripe_cards/stripe_card", stripe_card: @card_grant.stripe_card, headless: true %>
4343
<%= render partial: "card_grants/balance", locals: { card_grant: @card_grant } %>
4444
<%= render partial: "card_grants/canceled_warning", locals: { card_grant: @card_grant } %>
4545
<%= render partial: "card_grants/actions", locals: { card_grant: @card_grant } %>
4646
</div>
4747
<% end %>
48-
<div class="flex flex-col g2">
48+
<div class="flex flex-col flex-1 gap-2 mt-1.5">
4949
<% if @card_grant.stripe_card %>
5050
<% admin_tool_if @card_grant.user != current_user do %>
5151
<%= render partial: "card_grants/card_details", locals: { card_grant: @card_grant } %>

app/views/stripe_cards/actions/_freeze.html.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<div class="tooltipped tooltipped--n" aria-label="<%= policy(stripe_card).defrost? ? defrost_tooltip : "You don't have permission to perform this action" %>">
66
<%= link_to defrost_stripe_card_path(stripe_card),
77
method: :post,
8-
class: "btn bg-accent !text-white",
8+
class: "btn",
99
disabled: !policy(stripe_card).defrost? do %>
1010
<%= inline_icon "freeze" %> Defrost card
1111
<% end %>
@@ -15,7 +15,7 @@
1515
<div class="tooltipped tooltipped--n" aria-label="<%= policy(stripe_card).freeze? ? freeze_tooltip : "You don't have permission to perform this action" %>">
1616
<%= link_to freeze_stripe_card_path(stripe_card),
1717
method: :post,
18-
class: "btn bg-info !text-white",
18+
class: "btn",
1919
disabled: !policy(stripe_card).freeze? do %>
2020
<%= inline_icon "freeze" %> Freeze
2121
<% end %>
@@ -24,7 +24,7 @@
2424
<div class="tooltipped tooltipped--n" aria-label="This card cannot be frozen because it has not been activated">
2525
<%= link_to "#",
2626
method: :post,
27-
class: "btn bg-info",
27+
class: "btn",
2828
disabled: true do %>
2929
<%= inline_icon "freeze" %> Freeze
3030
<% end %>

0 commit comments

Comments
 (0)