Remove identity card from HomeScreen — redundant with subtitle and profile list
This commit is contained in:
parent
07977d4d16
commit
269f0c0230
3 changed files with 4 additions and 79 deletions
|
|
@ -76,29 +76,6 @@ export function HomeScreen({ onNavigate, onCreateProfile }: HomeScreenProps) {
|
|||
</Button>
|
||||
</header>
|
||||
|
||||
{active && (
|
||||
<section className="card home-identity-card">
|
||||
<div className="home-identity-content">
|
||||
<Avatar npub={active.npub} label={active.label} size="lg" picture={active.picture} />
|
||||
<div className="home-identity-copy">
|
||||
<strong className="home-identity-name" aria-label="Active profile name">
|
||||
{active.label}
|
||||
</strong>
|
||||
<code className="mono" title={active.npub}>
|
||||
{shortenNpub(active.npub, shorten)}
|
||||
</code>
|
||||
<p className="hint">
|
||||
Notes will be signed as this profile. Private keys never leave this computer.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<Button variant="secondary" onClick={() => onNavigate('profiles')}>
|
||||
<Icon name="users" size={16} />
|
||||
Switch profile
|
||||
</Button>
|
||||
</section>
|
||||
)}
|
||||
|
||||
<div className="home-grid">
|
||||
<section className="card">
|
||||
<header className="card-header">
|
||||
|
|
|
|||
|
|
@ -1468,57 +1468,6 @@ select {
|
|||
gap: 10px;
|
||||
}
|
||||
|
||||
.home-identity-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 20px;
|
||||
border-color: var(--success);
|
||||
background: var(--surface);
|
||||
}
|
||||
|
||||
.home-identity-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.home-identity-copy {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.home-identity-name {
|
||||
margin: 0 0 4px;
|
||||
color: var(--text);
|
||||
font-size: 16px;
|
||||
font-weight: 650;
|
||||
}
|
||||
|
||||
.home-identity-copy .mono {
|
||||
display: inline-block;
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
.home-identity-copy .hint {
|
||||
max-width: 58ch;
|
||||
margin: 8px 0 0;
|
||||
}
|
||||
|
||||
@media (max-width: 620px) {
|
||||
.home-identity-card {
|
||||
align-items: stretch;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.home-identity-card .btn {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.home-profile-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
|
|
|||
|
|
@ -23,11 +23,10 @@ describe('HomeScreen', () => {
|
|||
const { onNavigate } = renderHome(backend);
|
||||
renderWithApp(<HomeScreen onNavigate={onNavigate} onCreateProfile={vi.fn()} />);
|
||||
|
||||
// Wait for the identity card to appear after state loads.
|
||||
const switchBtn = await screen.findByRole('button', { name: 'Switch profile' });
|
||||
const identityCard = switchBtn.closest('.home-identity-card') as HTMLElement;
|
||||
expect(within(identityCard).getByText('Alice')).toBeInTheDocument();
|
||||
expect(within(identityCard).getByText(/npub1alice\.\.\./)).toBeInTheDocument();
|
||||
// The active profile appears in the profile list with its shortened npub.
|
||||
const profileList = await screen.findByRole('listbox');
|
||||
expect(within(profileList).getByText('Alice')).toBeInTheDocument();
|
||||
expect(within(profileList).getByText(/npub1alice\.\.\./)).toBeInTheDocument();
|
||||
|
||||
const compose = screen.getByRole('button', { name: 'Compose' });
|
||||
await userEvent.setup().click(compose);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue