From 9b03971b923799ff176c913243ebef03df0da591 Mon Sep 17 00:00:00 2001 From: theborakompanioni Date: Tue, 6 Jan 2026 21:50:08 +0100 Subject: [PATCH] refactor: import lucide icons with -Icon postfix name --- src/components/CurrencySymbol.tsx | 6 +++-- src/components/JamLanding.tsx | 13 +++++++++-- src/components/Login.tsx | 10 ++++----- src/components/Navbar.tsx | 4 ++-- src/components/Orderbook.tsx | 18 +++++++++------ src/components/OrderbookDialog.tsx | 4 ++-- src/components/layout/display-mode-context.ts | 6 ++--- src/components/receive/BitcoinAmountInput.tsx | 4 ++-- src/components/receive/Receive.tsx | 10 ++++----- .../settings/CollaboratorFeesForm.tsx | 4 ++-- src/components/settings/LanguageSelector.tsx | 4 ++-- src/components/settings/RescanChain.tsx | 8 +++---- src/components/ui/FeeConfigErrorAlert.tsx | 4 ++-- src/components/ui/pagination.tsx | 6 ++--- src/hooks/useDisplaySettings.ts | 6 +++-- src/hooks/useWalletDisplay.ts | 9 ++++---- src/lib/utils.ts | 4 ++-- src/stories/Alert.stories.tsx | 22 ++++++++++++++----- src/stories/Navbar.stories.tsx | 4 ++-- 19 files changed, 86 insertions(+), 60 deletions(-) diff --git a/src/components/CurrencySymbol.tsx b/src/components/CurrencySymbol.tsx index f6a88068..0eb28dbf 100644 --- a/src/components/CurrencySymbol.tsx +++ b/src/components/CurrencySymbol.tsx @@ -1,5 +1,5 @@ import type { SVGAttributes } from 'react' -import { EyeOff } from 'lucide-react' +import { EyeOffIcon } from 'lucide-react' import { cn } from '@/lib/utils' import type { Currency } from '@/types/global' @@ -11,7 +11,9 @@ type CurrencySymbolProps = { export function CurrencySymbol({ currency, isPrivate, size = 'lg' }: CurrencySymbolProps) { if (isPrivate) { - return + return ( + + ) } if (currency === 'btc') { diff --git a/src/components/JamLanding.tsx b/src/components/JamLanding.tsx index 106ad924..936ca33c 100644 --- a/src/components/JamLanding.tsx +++ b/src/components/JamLanding.tsx @@ -102,8 +102,17 @@ export default function JamLanding({ walletFileName }: JamLandingProps) { onClick={() => refetchWalletData()} className="flex items-center gap-2 text-gray-500" > - - {t('global.refresh')} + {isLoading ? ( + <> + + {t('global.refresh')} + + ) : ( + <> + + {t('global.refresh')} + + )} diff --git a/src/components/Login.tsx b/src/components/Login.tsx index 4f807284..f04270d1 100644 --- a/src/components/Login.tsx +++ b/src/components/Login.tsx @@ -1,7 +1,7 @@ import React, { useMemo, useState } from 'react' import { listwalletsOptions, unlockwalletMutation } from '@joinmarket-webui/joinmarket-api-ts/@tanstack/react-query' import { useMutation, useQuery } from '@tanstack/react-query' -import { AlertCircle, Eye, EyeOff, Loader2Icon, Lock, RefreshCwIcon, Wallet } from 'lucide-react' +import { AlertCircleIcon, EyeIcon, EyeOffIcon, Loader2Icon, LockIcon, RefreshCwIcon, WalletIcon } from 'lucide-react' import { useTranslation } from 'react-i18next' import { useNavigate } from 'react-router-dom' import { toast } from 'sonner' @@ -100,7 +100,7 @@ const LoginForm = ({ wallets, isSubmitting, onSubmit }: LoginFormProps) => {
- + { className="absolute top-1/2 right-1 -translate-y-1/2 transform" onClick={() => setShowPassword((val) => !val)} > - {showPassword ? : } + {showPassword ? : }
@@ -214,7 +214,7 @@ const LoginPage = () => { {isLoadingWallets ? ( ) : ( - await listwalletsQuery.refetch()} /> + await listwalletsQuery.refetch()} /> )} Welcome to Jam @@ -232,7 +232,7 @@ const LoginPage = () => { {listwalletsError ? ( - + {listwalletsError.message} {listwalletsError.error_description} diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index eee371fb..a9c9b1e4 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -1,5 +1,5 @@ import type { PropsWithChildren } from 'react' -import { Loader2Icon, LogOutIcon, MoonIcon, Settings, SunIcon, WalletIcon } from 'lucide-react' +import { Loader2Icon, LogOutIcon, MoonIcon, SettingsIcon, SunIcon, WalletIcon } from 'lucide-react' import { useTranslation } from 'react-i18next' import { Link, useNavigate } from 'react-router-dom' import { useStore } from 'zustand' @@ -143,7 +143,7 @@ export function Navbar({ variant="ghost" size="icon" > - + @@ -519,7 +519,7 @@ export const Orderbook = ({ isModal = false }: OrderbookProps) => { className="relative" > Generate Demo Entry - + )} @@ -534,7 +534,7 @@ export const Orderbook = ({ isModal = false }: OrderbookProps) => { disabled={isLoadingData} > {t('orderbook.button_reload_title')} - +
)} @@ -618,7 +618,11 @@ export const Orderbook = ({ isModal = false }: OrderbookProps) => { disabled={isLoadingData} > {t('orderbook.button_reload_title')} - +
diff --git a/src/components/layout/display-mode-context.ts b/src/components/layout/display-mode-context.ts index 5000b996..3932f7c7 100644 --- a/src/components/layout/display-mode-context.ts +++ b/src/components/layout/display-mode-context.ts @@ -16,11 +16,9 @@ export const jarTemplates: Array<{ { name: 'Elderberry', color: '#7c3fa6' }, ] -export interface Jar { - name: string - color: JarColor +export type Jar = Pick<(typeof jarTemplates)[number], 'name' | 'color'> & { balance: AmountSats - account?: string + account: string } export interface DisplayModeContextType { diff --git a/src/components/receive/BitcoinAmountInput.tsx b/src/components/receive/BitcoinAmountInput.tsx index 2c20d5b2..077ce209 100644 --- a/src/components/receive/BitcoinAmountInput.tsx +++ b/src/components/receive/BitcoinAmountInput.tsx @@ -1,4 +1,4 @@ -import { ArrowUpDown } from 'lucide-react' +import { ArrowUpDownIcon } from 'lucide-react' import type { Currency } from '@/types/global' import { CurrencySymbol } from '../CurrencySymbol' import { Button } from '../ui/button' @@ -51,7 +51,7 @@ export const BitcoinAmountInput = ({
diff --git a/src/components/receive/Receive.tsx b/src/components/receive/Receive.tsx index bf77f612..befc6dd3 100644 --- a/src/components/receive/Receive.tsx +++ b/src/components/receive/Receive.tsx @@ -1,7 +1,7 @@ import { useState, useEffect, useCallback } from 'react' import { getaddressOptions } from '@joinmarket-webui/joinmarket-api-ts/@tanstack/react-query' import { useQuery } from '@tanstack/react-query' -import { Copy, CopyCheck, RefreshCw, Share } from 'lucide-react' +import { CopyCheckIcon, CopyIcon, RefreshCwIcon, ShareIcon } from 'lucide-react' import { useTranslation } from 'react-i18next' import { toast } from 'sonner' import { useApiClient } from '@/hooks/useApiClient' @@ -171,12 +171,12 @@ export const Receive = ({ walletFileName }: ReceiveProps) => { @@ -199,7 +199,7 @@ export const Receive = ({ walletFileName }: ReceiveProps) => { onClick={shareAddress} disabled={getAddressQuery.isFetching || !bitcoinAddress} > - + {t('receive.button_share_address')} )} diff --git a/src/components/settings/CollaboratorFeesForm.tsx b/src/components/settings/CollaboratorFeesForm.tsx index 50432cbe..cd1a1d19 100644 --- a/src/components/settings/CollaboratorFeesForm.tsx +++ b/src/components/settings/CollaboratorFeesForm.tsx @@ -1,5 +1,5 @@ import { useState, useEffect, forwardRef, useImperativeHandle, useCallback } from 'react' -import { Info } from 'lucide-react' +import { InfoIcon } from 'lucide-react' import { useTranslation } from 'react-i18next' import { Input } from '@/components/ui/input' import { Label } from '@/components/ui/label' @@ -103,7 +103,7 @@ export const CollaboratorFeesForm = forwardRef{t('settings.fees.description_max_cj_fee_settings')}

- + {t('settings.fees.subtitle_max_cj_fee')} diff --git a/src/components/settings/LanguageSelector.tsx b/src/components/settings/LanguageSelector.tsx index e60dbc5d..a4f916f9 100644 --- a/src/components/settings/LanguageSelector.tsx +++ b/src/components/settings/LanguageSelector.tsx @@ -1,4 +1,4 @@ -import { Globe } from 'lucide-react' +import { GlobeIcon } from 'lucide-react' import { useTranslation } from 'react-i18next' import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select' import languages from '@/i18n/languages' @@ -19,7 +19,7 @@ export const LanguageSelector = () => {
- +

{t('settings.label_select_language')}

diff --git a/src/components/settings/RescanChain.tsx b/src/components/settings/RescanChain.tsx index 14fa5b98..1cc98b5d 100644 --- a/src/components/settings/RescanChain.tsx +++ b/src/components/settings/RescanChain.tsx @@ -1,7 +1,7 @@ import { yupResolver } from '@hookform/resolvers/yup' import { rescanblockchain } from '@joinmarket-webui/joinmarket-api-ts/jm' import { useMutation } from '@tanstack/react-query' -import { ArrowLeft, RefreshCw } from 'lucide-react' +import { ArrowLeftIcon, RefreshCwIcon } from 'lucide-react' import { useForm } from 'react-hook-form' import type { SubmitHandler } from 'react-hook-form' import { useTranslation } from 'react-i18next' @@ -62,7 +62,7 @@ function RescanChainForm({ rescanInfo, onSubmit, disabled }: RescanChainFormProp

{t('rescan_chain.description_blockheight')}

- +
{ onClick={() => navigate(routes.settings)} className="hover:bg-muted/50 h-8 w-8 p-0" > - +

{t('rescan_chain.title')}

@@ -180,7 +180,7 @@ export const RescanChain = ({ walletFileName }: RescanChainProps) => { {rescanInfo.rescanning && (
- + {rescanInfo?.progress === undefined ? t('app.alert_rescan_in_progress') diff --git a/src/components/ui/FeeConfigErrorAlert.tsx b/src/components/ui/FeeConfigErrorAlert.tsx index f724ba69..aed5f764 100644 --- a/src/components/ui/FeeConfigErrorAlert.tsx +++ b/src/components/ui/FeeConfigErrorAlert.tsx @@ -1,4 +1,4 @@ -import { Settings } from 'lucide-react' +import { SettingsIcon } from 'lucide-react' import { useTranslation } from 'react-i18next' import { Alert, AlertDescription } from '@/components/ui/alert' import { Button } from '@/components/ui/button' @@ -16,7 +16,7 @@ export const FeeConfigErrorAlert = ({ onOpenFeeConfig, className }: FeeConfigErr {t('send.taker_error_message_max_fees_config_missing')} diff --git a/src/components/ui/pagination.tsx b/src/components/ui/pagination.tsx index 49028546..eec090b5 100644 --- a/src/components/ui/pagination.tsx +++ b/src/components/ui/pagination.tsx @@ -1,4 +1,4 @@ -import { ChevronLeft, ChevronRight, ChevronsLeftIcon, ChevronsRightIcon } from 'lucide-react' +import { ChevronLeftIcon, ChevronRightIcon, ChevronsLeftIcon, ChevronsRightIcon } from 'lucide-react' import { Button } from '@/components/ui/button' import { cn } from '@/lib/utils' @@ -75,7 +75,7 @@ const Pagination = ({ onClick={() => handlePageChange(currentPage - 1)} disabled={currentPage === 1} > - +
{currentPage}
@@ -86,7 +86,7 @@ const Pagination = ({ onClick={() => handlePageChange(currentPage + 1)} disabled={currentPage === totalPages} > - +