-
Notifications
You must be signed in to change notification settings - Fork 441
fix(web-client): resolve all Biome lint errors in web client source #249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
39671ed
b280663
3ddb0bb
b495e5a
cb9fbbb
39f8a0c
6dcfe53
28d4c71
d4b4281
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -17,16 +17,16 @@ function ItemRow({ | |||||||||||||||||||||||||
| onClick?: () => void; | ||||||||||||||||||||||||||
| }) { | ||||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||||
| <div | ||||||||||||||||||||||||||
| <button | ||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changing this element to a |
||||||||||||||||||||||||||
| className={`item-card ${onClick ? 'clickable' : ''} ${selected ? 'selected' : ''}`} | ||||||||||||||||||||||||||
| role="button" | ||||||||||||||||||||||||||
| tabIndex={0} | ||||||||||||||||||||||||||
| type="button" | ||||||||||||||||||||||||||
| onClick={onClick} | ||||||||||||||||||||||||||
| onKeyDown={(e) => (e.key === 'Enter' || e.key === ' ') && onClick?.()}> | ||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The closing bracket
Suggested change
|
||||||||||||||||||||||||||
| <div className="row-content"> | ||||||||||||||||||||||||||
| {selected && ( | ||||||||||||||||||||||||||
| <div className="selected-icon"> | ||||||||||||||||||||||||||
| <svg width="8" height="8" viewBox="0 0 8 8"> | ||||||||||||||||||||||||||
| <title>Selected</title> | ||||||||||||||||||||||||||
| <path | ||||||||||||||||||||||||||
| d="M1.5 4l2 2 3-3" | ||||||||||||||||||||||||||
| stroke="white" | ||||||||||||||||||||||||||
|
|
@@ -49,7 +49,7 @@ function ItemRow({ | |||||||||||||||||||||||||
| <div className="item-stock">{item.stock} in stock</div> | ||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||
| </button> | ||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
|
|
@@ -66,6 +66,7 @@ export function InventoryOptionsCard({inventory, onSelect}: Props) { | |||||||||||||||||||||||||
| <div className="header-wrapper"> | ||||||||||||||||||||||||||
| <div className="icon-wrapper"> | ||||||||||||||||||||||||||
| <svg width="10" height="10" viewBox="0 0 10 10"> | ||||||||||||||||||||||||||
| <title>Inventory available</title> | ||||||||||||||||||||||||||
| <path | ||||||||||||||||||||||||||
| d="M2 5l2 2 4-4" | ||||||||||||||||||||||||||
| stroke="#34d399" | ||||||||||||||||||||||||||
|
|
@@ -114,6 +115,7 @@ export function InventoryOptionsCard({inventory, onSelect}: Props) { | |||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||
| {canConfirm && ( | ||||||||||||||||||||||||||
| <button | ||||||||||||||||||||||||||
| type="button" | ||||||||||||||||||||||||||
| onClick={() => { | ||||||||||||||||||||||||||
| setHasConfirmed(true); | ||||||||||||||||||||||||||
| onSelect?.(selected); | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -68,6 +68,7 @@ export function MandateApproval({ | |||||
| <div className="mandate-header"> | ||||||
| <div className="icon-wrapper"> | ||||||
| <svg width="16" height="16" viewBox="0 0 16 16" fill="none"> | ||||||
| <title>Mandate</title> | ||||||
| <path | ||||||
| d="M8 2L10.5 6.5H14L10.5 9L12 13.5L8 11L4 13.5L5.5 9L2 6.5H5.5L8 2Z" | ||||||
| strokeLinejoin="round" | ||||||
|
|
@@ -133,7 +134,7 @@ export function MandateApproval({ | |||||
|
|
||||||
| {hasCurrentPrice && ( | ||||||
| <div className="reference-price-note"> | ||||||
| Reference price: ${current!.toFixed(2)} (list) | ||||||
| Reference price: ${current?.toFixed(2) ?? "0.00"} (list) | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The use of double quotes for the string literal
Suggested change
|
||||||
| </div> | ||||||
| )} | ||||||
| </> | ||||||
|
|
@@ -148,7 +149,7 @@ export function MandateApproval({ | |||||
| }, | ||||||
| { | ||||||
| label: 'Current', | ||||||
| value: hasCurrentPrice ? `$${current!.toFixed(2)}` : '—', | ||||||
| value: hasCurrentPrice ? `$${current?.toFixed(2) ?? "0.00"}` : '—', | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||
| accent: '#f87171', | ||||||
| }, | ||||||
| {label: 'Qty', value: String(qty), accent: '#94a3b8'}, | ||||||
|
|
@@ -187,6 +188,7 @@ export function MandateApproval({ | |||||
| {/* Payment method row */} | ||||||
| <div className="fop-row"> | ||||||
| <svg width="32" height="20" viewBox="0 0 32 20" fill="none"> | ||||||
| <title>Payment card</title> | ||||||
| <rect | ||||||
| width="32" | ||||||
| height="20" | ||||||
|
|
@@ -243,8 +245,9 @@ export function MandateApproval({ | |||||
|
|
||||||
| {state === 'idle' && ( | ||||||
| <div className="action-buttons"> | ||||||
| <button className="approve-button" onClick={handleSign}> | ||||||
| <button type="button" className="approve-button" onClick={handleSign}> | ||||||
| <svg width="14" height="14" viewBox="0 0 14 14" fill="none"> | ||||||
| <title>Approve</title> | ||||||
| <path | ||||||
| d="M7 1L8.8 4.8L13 5.3L10 8.2L10.7 12.4L7 10.5L3.3 12.4L4 8.2L1 5.3L5.2 4.8L7 1Z" | ||||||
| stroke="white" | ||||||
|
|
@@ -255,7 +258,7 @@ export function MandateApproval({ | |||||
| </svg> | ||||||
| Approve & Sign | ||||||
| </button> | ||||||
| <button className="reject-button" onClick={onReject}> | ||||||
| <button type="button" className="reject-button" onClick={onReject}> | ||||||
| Reject | ||||||
| </button> | ||||||
| </div> | ||||||
|
|
@@ -272,6 +275,7 @@ export function MandateApproval({ | |||||
| <div className="signed-state"> | ||||||
| <div className="success-badge"> | ||||||
| <svg width="10" height="10" viewBox="0 0 10 10"> | ||||||
| <title>Signed</title> | ||||||
| <path | ||||||
| d="M2 5l2 2 4-4" | ||||||
| stroke="white" | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While destructuring
messageshere satisfies theuseExhaustiveDependencieslint rule for theuseEffectbelow, the rest of the component continues to usechatState.messages(e.g., lines 169, 171). For better consistency and readability, consider destructuring all the properties used fromchatStateat the top of the component, or use the destructuredmessagesvariable throughout.