Skip to content

Commit

Permalink
fix(ui): #2053: after review
Browse files Browse the repository at this point in the history
  • Loading branch information
VanishMax committed Feb 17, 2025
1 parent f12c232 commit 57d6e25
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
6 changes: 4 additions & 2 deletions packages/ui/src/ActionView/actions/output.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { OutputView } from '@penumbra-zone/protobuf/penumbra/core/component/shielded_pool/v1/shielded_pool_pb';
import { getNote } from '@penumbra-zone/getters/output-view';
import { getAddress } from '@penumbra-zone/getters/note-view';
import { Density } from '../../Density';
import { useDensity } from '../../utils/density';
import { ActionWrapper } from './wrapper';
Expand All @@ -19,9 +21,9 @@ export const OutputAction = ({ value }: OutputActionProps) => {
<ValueViewComponent
signed='positive'
priority={density === 'sparse' ? 'primary' : 'tertiary'}
valueView={value.outputView.value.note?.value}
valueView={getNote(value).value}
/>
<AddressViewComponent addressView={value.outputView.value.note?.address} />
<AddressViewComponent addressView={getAddress(getNote(value))} />
</Density>
)}
</ActionWrapper>
Expand Down
19 changes: 13 additions & 6 deletions packages/ui/src/ActionView/actions/wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import cn from 'clsx';
import { ReactNode } from 'react';
import { Text } from '../../Text';
import { IncognitoIcon } from './incognito-icon';
import { useDensity } from '../../utils/density';
import { Density, useDensity } from '../../utils/density';

export interface ActionWrapperProps {
title: string;
Expand All @@ -12,7 +12,11 @@ export interface ActionWrapperProps {
infoRows?: ReactNode;
}

const ActionWrapperHeader = ({ opaque, children, title }: ActionWrapperProps) => {
export interface ActionWrapperHeaderProps extends ActionWrapperProps {
density: Density;
}

const ActionWrapperHeader = ({ opaque, children, title, density }: ActionWrapperHeaderProps) => {
return (
<>
{opaque && (
Expand All @@ -21,8 +25,11 @@ const ActionWrapperHeader = ({ opaque, children, title }: ActionWrapperProps) =>
</i>
)}

<div className='grow truncate'>
<Text smallTechnical color={opaque ? 'text.secondary' : 'text.primary'}>
<div className='flex grow items-center truncate'>
<Text
variant={density === 'sparse' ? 'smallTechnical' : 'detailTechnical'}
color={opaque ? 'text.secondary' : 'text.primary'}
>
{title}
</Text>
</div>
Expand All @@ -39,7 +46,7 @@ export const ActionWrapper = (props: ActionWrapperProps) => {
if (!infoRows) {
return (
<div className='flex h-10 w-full items-center justify-between gap-1 rounded-sm bg-other-tonalFill5 px-3 py-2'>
<ActionWrapperHeader {...props} />
<ActionWrapperHeader density={density} {...props} />
</div>
);
}
Expand All @@ -52,7 +59,7 @@ export const ActionWrapper = (props: ActionWrapperProps) => {
)}
>
<div className='flex w-full items-center justify-between gap-1'>
<ActionWrapperHeader {...props} />
<ActionWrapperHeader density={density} {...props} />
</div>

{infoRows}
Expand Down

0 comments on commit 57d6e25

Please sign in to comment.