mirror of
https://github.com/sakaljurgis/best-choice.git
synced 2026-07-08 21:47:40 +00:00
prices edit
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import { Fragment } from 'react';
|
import { Fragment } from 'react';
|
||||||
import { ExternalLink, Pencil } from 'lucide-react';
|
import { ExternalLink } from 'lucide-react';
|
||||||
import type { Item } from '@shared/models/item';
|
import type { Item } from '@shared/models/item';
|
||||||
import { ItemPricesPanel } from './item-prices-panel';
|
import { ItemPricesPanel } from './item-prices-panel';
|
||||||
import { formatAttributeValue, getPriceSummaryDisplay } from './project-items-utils';
|
import { formatAttributeValue, getPriceSummaryDisplay } from './project-items-utils';
|
||||||
@@ -97,24 +97,24 @@ export function ProjectItemsDesktopTable({
|
|||||||
))}
|
))}
|
||||||
<td className="px-4 py-3 align-top">
|
<td className="px-4 py-3 align-top">
|
||||||
<div className="flex flex-col gap-0.5 text-xs">
|
<div className="flex flex-col gap-0.5 text-xs">
|
||||||
<div className="flex items-center gap-2">
|
|
||||||
<span className="text-sm font-semibold text-slate-900">
|
|
||||||
{priceDisplay.primary}
|
|
||||||
</span>
|
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => onTogglePrices(item.id)}
|
onClick={() => onTogglePrices(item.id)}
|
||||||
className="inline-flex h-8 w-8 items-center justify-center rounded-md text-slate-500 transition hover:text-slate-400 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 focus-visible:ring-offset-white"
|
className="inline-flex items-center gap-2 self-start rounded-md text-left text-sm font-semibold text-slate-900 transition hover:text-blue-600 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 focus-visible:ring-offset-white"
|
||||||
aria-label="Edit Prices"
|
title={isExpanded ? 'Close Prices' : 'View Prices'}
|
||||||
title="Edit Prices"
|
|
||||||
aria-expanded={isExpanded}
|
aria-expanded={isExpanded}
|
||||||
aria-controls={panelId}
|
aria-controls={panelId}
|
||||||
>
|
>
|
||||||
<Pencil aria-hidden className="h-4 w-4" />
|
<span>{priceDisplay.primary}</span>
|
||||||
<span hidden={!isExpanded}>Close</span>
|
{isExpanded ? (
|
||||||
<span className="sr-only">Edit Prices</span>
|
<span className="text-xs font-medium uppercase tracking-wide text-slate-500">
|
||||||
|
Close
|
||||||
|
</span>
|
||||||
|
) : null}
|
||||||
|
<span className="sr-only">
|
||||||
|
{isExpanded ? 'Close price list' : 'View price list'}
|
||||||
|
</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
|
||||||
{priceDisplay.secondary ? (
|
{priceDisplay.secondary ? (
|
||||||
<span className="text-slate-500">{priceDisplay.secondary}</span>
|
<span className="text-slate-500">{priceDisplay.secondary}</span>
|
||||||
) : null}
|
) : null}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { ExternalLink, Pencil } from 'lucide-react';
|
import { ExternalLink } from 'lucide-react';
|
||||||
import type { Item } from '@shared/models/item';
|
import type { Item } from '@shared/models/item';
|
||||||
import { ItemPricesPanel } from './item-prices-panel';
|
import { ItemPricesPanel } from './item-prices-panel';
|
||||||
import { formatAttributeValue, getPriceSummaryDisplay } from './project-items-utils';
|
import { formatAttributeValue, getPriceSummaryDisplay } from './project-items-utils';
|
||||||
@@ -74,21 +74,24 @@ export function ProjectItemsMobileList({
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
<div className="mt-3 flex flex-col gap-0.5 text-xs">
|
<div className="mt-3 flex flex-col gap-0.5 text-xs">
|
||||||
<div className="flex items-center gap-2">
|
|
||||||
<span className="text-sm font-semibold text-slate-900">{priceDisplay.primary}</span>
|
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => onTogglePrices(item.id)}
|
onClick={() => onTogglePrices(item.id)}
|
||||||
className="inline-flex h-9 w-9 items-center justify-center rounded-md text-slate-500 transition hover:text-slate-400 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 focus-visible:ring-offset-white"
|
className="inline-flex items-center gap-2 self-start rounded-md text-left text-sm font-semibold text-slate-900 transition hover:text-blue-600 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 focus-visible:ring-offset-white"
|
||||||
aria-label="Edit Prices"
|
title={isExpanded ? 'Close Prices' : 'View Prices'}
|
||||||
title="Edit Prices"
|
|
||||||
aria-expanded={isExpanded}
|
aria-expanded={isExpanded}
|
||||||
aria-controls={panelId}
|
aria-controls={panelId}
|
||||||
>
|
>
|
||||||
<Pencil aria-hidden className="h-4 w-4" />
|
<span>{priceDisplay.primary}</span>
|
||||||
<span className="sr-only">Edit Prices</span>
|
{isExpanded ? (
|
||||||
|
<span className="text-xs font-medium uppercase tracking-wide text-slate-500">
|
||||||
|
Close
|
||||||
|
</span>
|
||||||
|
) : null}
|
||||||
|
<span className="sr-only">
|
||||||
|
{isExpanded ? 'Close price list' : 'View price list'}
|
||||||
|
</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
|
||||||
{priceDisplay.secondary ? (
|
{priceDisplay.secondary ? (
|
||||||
<span className="text-slate-500">{priceDisplay.secondary}</span>
|
<span className="text-slate-500">{priceDisplay.secondary}</span>
|
||||||
) : null}
|
) : null}
|
||||||
|
|||||||
Reference in New Issue
Block a user