mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-18 20:59:39 +02:00
* New onboarding, trials, Stripe integration * Fix tests * Lint fixes * Fix subscription endpoints
59 lines
2.2 KiB
Text
59 lines
2.2 KiB
Text
<%= content_for :page_title, t(".page_title") %>
|
|
|
|
<%= settings_section title: t(".subscription_title"), subtitle: t(".subscription_subtitle") do %>
|
|
<div class="space-y-4">
|
|
<div class="p-3 shadow-border-xs bg-container rounded-lg flex justify-between items-center">
|
|
<div class="flex items-center gap-3">
|
|
<%= render FilledIconComponent.new(
|
|
icon: "gem",
|
|
rounded: true,
|
|
size: "lg"
|
|
) %>
|
|
|
|
<div class="text-sm space-y-1">
|
|
<% if subscription_pending? %>
|
|
<p class="text-primary">
|
|
Your subscription is pending. You can still use Maybe+ while we process your subscription.
|
|
</p>
|
|
<% elsif @user.family.trialing? %>
|
|
<p class="text-primary">
|
|
You are currently trialing <span class="font-medium">Maybe+</span>
|
|
<span class="text-secondary">
|
|
(<%= @user.family.trial_remaining_days %> days remaining)
|
|
</span>
|
|
</p>
|
|
<% elsif @user.family.subscribed? %>
|
|
<p class="text-primary">You are currently subscribed to <span class="font-medium">Maybe+</span></p>
|
|
<% else %>
|
|
<p class="text-primary">You are currently <span class="font-medium">not subscribed</span></p>
|
|
<p class="text-secondary">Once you subscribe to Maybe+, you'll see your billing settings here.</p>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
|
|
<% if @user.family.subscribed? %>
|
|
<%= render LinkComponent.new(
|
|
text: "Manage",
|
|
icon: "external-link",
|
|
variant: "primary",
|
|
icon_position: "right",
|
|
href: subscription_path,
|
|
rel: "noopener"
|
|
) %>
|
|
<% elsif @user.family.trialing? && !subscription_pending? %>
|
|
<%= render LinkComponent.new(
|
|
text: "Choose plan",
|
|
variant: "primary",
|
|
icon: "plus",
|
|
icon_position: "right",
|
|
href: upgrade_subscription_path(view: "upgrade"),
|
|
rel: "noopener") %>
|
|
<% end %>
|
|
</div>
|
|
|
|
<div class="flex items-center gap-2">
|
|
<%= image_tag "stripe-logo.svg", class: "w-5 h-5 shrink-0" %>
|
|
<p class="text-secondary text-sm">Billing via Stripe</p>
|
|
</div>
|
|
</div>
|
|
<% end %>
|