Rename Wallet to Lightning Network, move to Services
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

This commit is contained in:
Râu Cao 2023-05-01 16:13:41 +02:00
parent 34849b28b0
commit 67a9fc02d7
Signed by: raucao
GPG Key ID: 15E65F399D084BA9
10 changed files with 35 additions and 29 deletions

View File

@ -2,6 +2,6 @@ class DashboardController < ApplicationController
before_action :require_user_signed_in
def index
@current_section = :dashboard
@current_section = :services
end
end

View File

@ -1,6 +1,6 @@
require "rqrcode"
class WalletController < ApplicationController
class Services::LightningController < ApplicationController
before_action :require_user_signed_in
before_action :authenticate_with_lndhub
before_action :set_current_section
@ -42,7 +42,7 @@ class WalletController < ApplicationController
end
def set_current_section
@current_section = :wallet
@current_section = :services
end
def fetch_balance

View File

@ -43,9 +43,9 @@
<div class="border border-gray-300 rounded-md hover:border-gray-400
bg-cover bg-center sm:bg-[center_top_-140px] bg-no-repeat
bg-[url(/img/logos/icon_lightning.svg)]">
<%= link_to wallet_path,
<%= link_to services_lightning_index_path,
class: "block h-full px-6 py-6 rounded-md" do %>
<h3 class="mb-3.5">Wallet</h3>
<h3 class="mb-3.5">Lightning Network</h3>
<p class="text-gray-600">
Send and receive sats over the Bitcoin Lightning Network
</p>

View File

@ -1,3 +1,3 @@
You just received <%= number_with_delimiter @amount_sats %> sats in your Lightning account (<%= @user.address %>). Check your wallet app, or open the account page for details:
<%= wallet_transactions_url %>
<%= transactions_lightning_index_url %>

View File

@ -1,9 +1,9 @@
<%= render HeaderComponent.new(title: "Wallet") %>
<%= render HeaderComponent.new(title: "Lightning Network") %>
<%= render MainSimpleComponent.new do %>
<%= render WalletSummaryComponent.new(balance: @balance) %>
<%= render partial: "shared/tabnav_wallet" %>
<%= render partial: "shared/tabnav_lightning" %>
<section>
<h3>Lightning Address</h3>

View File

@ -1,9 +1,9 @@
<%= render HeaderComponent.new(title: "Wallet") %>
<%= render HeaderComponent.new(title: "Lightning Network") %>
<%= render MainSimpleComponent.new do %>
<%= render WalletSummaryComponent.new(balance: @balance) %>
<%= render partial: "shared/tabnav_wallet" %>
<%= render partial: "shared/tabnav_lightning" %>
<section>
<h3 class="hidden">Transactions</h3>

View File

@ -1,10 +1,8 @@
<%= link_to "Services", root_path,
class: main_nav_class(@current_section, :dashboard) %>
<%= link_to "Contributions", contributions_donations_path,
class: main_nav_class(@current_section, :contributions) %>
class: main_nav_class(@current_section, :services) %>
<%= link_to "Invitations", invitations_path,
class: main_nav_class(@current_section, :invitations) %>
<%= link_to "Wallet", wallet_path,
class: main_nav_class(@current_section, :wallet) %>
<%= link_to "Contributions", contributions_donations_path,
class: main_nav_class(@current_section, :contributions) %>
<%= link_to "Settings", settings_path,
class: main_nav_class(@current_section, :settings) %>

View File

@ -0,0 +1,14 @@
<section>
<div class="border-b border-gray-200">
<nav class="-mb-px flex" aria-label="Tabs">
<%= render TabnavLinkComponent.new(
name: "Info", path: services_lightning_index_path,
active: current_page?(services_lightning_index_path)
) %>
<%= render TabnavLinkComponent.new(
name: "Transactions", path: transactions_services_lightning_index_path,
active: current_page?(transactions_services_lightning_index_path)
) %>
</nav>
</div>
</section>

View File

@ -1,14 +0,0 @@
<section>
<div class="border-b border-gray-200">
<nav class="-mb-px flex" aria-label="Tabs">
<%= render TabnavLinkComponent.new(
name: "Info", path: wallet_path,
active: current_page?(wallet_path)
) %>
<%= render TabnavLinkComponent.new(
name: "Transactions", path: wallet_transactions_path,
active: current_page?(wallet_transactions_path)
) %>
</nav>
</div>
</section>

View File

@ -21,6 +21,14 @@ Rails.application.routes.draw do
get 'wallet', to: 'wallet#index'
get 'wallet/transactions', to: 'wallet#transactions'
namespace :services do
resources :lightning, only: [:index] do
collection do
get 'transactions'
end
end
end
resources :settings, param: 'section', only: ['index', 'show', 'update'] do
collection do
post 'reset_password'