Skip to content

Commit

Permalink
Merge pull request #354 from xch-dev/login-screen
Browse files Browse the repository at this point in the history
Login screen padding rebalance
  • Loading branch information
Rigidity authored Mar 7, 2025
2 parents 0eda806 + a591e00 commit 4ff36a4
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion crates/sage-database/src/blockinfo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl Database {
}
}

impl<'a> DatabaseTx<'a> {
impl DatabaseTx<'_> {
pub async fn find_created_timestamp_null(&mut self, limit: u32) -> Result<Vec<u32>> {
find_created_timestamp_null(&mut *self.tx, limit).await
}
Expand Down
8 changes: 4 additions & 4 deletions crates/sage-database/src/coin_states.rs
Original file line number Diff line number Diff line change
Expand Up @@ -501,13 +501,13 @@ async fn get_block_heights(

query
.push("ticker LIKE ")
.push_bind(format!("%{}%", value))
.push_bind(format!("%{value}%"))
.push(" OR cat_name LIKE ")
.push_bind(format!("%{}%", value))
.push_bind(format!("%{value}%"))
.push(" OR did_name LIKE ")
.push_bind(format!("%{}%", value))
.push_bind(format!("%{value}%"))
.push(" OR nft_name LIKE ")
.push_bind(format!("%{}%", value))
.push_bind(format!("%{value}%"))
.push(")");
}

Expand Down
2 changes: 1 addition & 1 deletion crates/sage-database/src/primitives/nfts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,7 @@ async fn search_nfts(
// Add name search if present
if let Some(name_search) = &params.name {
query.push(" AND name LIKE ");
query.push_bind(format!("%{}%", name_search));
query.push_bind(format!("%{name_search}%"));
}

// Add ORDER BY clause based on sort_mode
Expand Down
30 changes: 15 additions & 15 deletions src/pages/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ import { Switch } from '@/components/ui/switch';
import { useErrors } from '@/hooks/useErrors';
import { t } from '@lingui/core/macro';
import { Trans } from '@lingui/react/macro';
import { platform } from '@tauri-apps/plugin-os';
import {
CogIcon,
EraserIcon,
EyeIcon,
FlameIcon,
Expand All @@ -32,15 +34,13 @@ import {
PenIcon,
SnowflakeIcon,
TrashIcon,
CogIcon,
} from 'lucide-react';
import { useEffect, useState } from 'react';
import { useNavigate } from 'react-router-dom';
import { commands, KeyInfo, SecretKeyInfo } from '../bindings';
import Container from '../components/Container';
import { loginAndUpdateState } from '../state';
import { platform } from '@tauri-apps/plugin-os';
import { useWallet } from '../contexts/WalletContext';
import { loginAndUpdateState } from '../state';

const isMobile = platform() === 'ios' || platform() === 'android';

Expand Down Expand Up @@ -74,7 +74,7 @@ export default function Login() {
<SafeAreaView>
<div
className={`flex-1 space-y-4 px-4 overflow-y-scroll ${
!isMobile ? 'pt-4' : ''
isMobile ? '' : 'py-2 pb-4'
}`}
>
<div className='flex items-center justify-between space-y-2'>
Expand Down Expand Up @@ -103,7 +103,7 @@ export default function Login() {
</div>
{keys !== null ? (
keys.length ? (
<div className='grid md:grid-cols-2 lg:grid-cols-3 gap-4'>
<div className='grid sm:grid-cols-2 md:grid-cols-3 gap-3'>
{keys.map((key, i) => (
<WalletItem
key={i}
Expand All @@ -127,7 +127,7 @@ export default function Login() {

function SkeletonWalletList() {
return (
<div className='grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 m-4'>
<div className='grid sm:grid-cols-2 md:grid-cols-3 gap-3 m-4'>
{Array.from({ length: 3 }).map((_, i) => (
<div key={i} className='w-full'>
<Skeleton className='h-[100px] w-full' />
Expand Down Expand Up @@ -234,7 +234,7 @@ function WalletItem({ network, info, keys, setKeys }: WalletItemProps) {
return (
<>
<Card onClick={() => loginSelf(false)} className='cursor-pointer'>
<CardHeader className='flex flex-row items-center justify-between space-y-0 pb-2'>
<CardHeader className='flex flex-row items-center justify-between p-5 pt-4 pb-2'>
<CardTitle className='text-2xl'>{info.name}</CardTitle>
<DropdownMenu>
<DropdownMenuTrigger asChild className='-mr-2.5'>
Expand Down Expand Up @@ -308,21 +308,21 @@ function WalletItem({ network, info, keys, setKeys }: WalletItemProps) {
</DropdownMenuContent>
</DropdownMenu>
</CardHeader>
<CardContent>
<div className='flex items-center mt-1 justify-between'>
<CardContent className='p-0 px-5 pb-5'>
<div className='flex items-center justify-between'>
<span className='text-muted-foreground'>{info.fingerprint}</span>
{info.has_secrets ? (
<div className='inline-flex gap-0.5 items-center rounded-full border px-2 py-1.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80'>
<FlameIcon className='h-4 w-4 pb-0.5' />
<div className='inline-flex gap-1 items-center rounded-full px-3 py-1.5 text-xs dark:bg-neutral-800'>
<FlameIcon className='h-4 w-4' />
<span>
<Trans>Hot Wallet</Trans>
<Trans>Hot</Trans>
</span>
</div>
) : (
<div className='inline-flex gap-0.5 items-center rounded-full border px-2 py-1.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80'>
<SnowflakeIcon className='h-4 w-4 pb-0.5' />
<div className='inline-flex gap-1 items-center rounded-full px-3 py-1.5 text-xs dark:bg-neutral-800'>
<SnowflakeIcon className='h-4 w-4' />
<span>
<Trans>Cold Wallet</Trans>
<Trans>Cold</Trans>
</span>
</div>
)}
Expand Down

0 comments on commit 4ff36a4

Please sign in to comment.