Skip to content

Commit

Permalink
fix: use lender name if there is no logo
Browse files Browse the repository at this point in the history
  • Loading branch information
yolile committed Sep 15, 2023
1 parent 4e126d7 commit 481ccf8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/components/CreditLinesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Text from 'src/stories/text/Text';
import { ICreditProduct } from '../schemas/application';
import Button from '../stories/button/Button';
import { formatCurrency } from '../util';
import { DataTableCell, DataTableHeadCell, TransparentDataTableCell } from './DataTable';
import { DataTableCell, DataTableHeadCell, DataTableHeadLabel, TransparentDataTableCell } from './DataTable';
import DataWithDetail from './DataWithDetail';

export interface CreditLinesTableProps {
Expand Down Expand Up @@ -34,7 +34,10 @@ export function CreditLinesTable({ rows, currency, isLoading, selectOption }: Cr
</DataTableHeadCell>
{rows.map((row) => (
<DataTableHeadCell key={`header-${row.id}`}>
<img src={`/images/lenders/${row.lender.logo_filename}`} alt="lender-logo" style={{ width: '8rem'}}/>
{row.lender.logo_filename
? <img src={`/images/lenders/${row.lender.logo_filename}`} alt="lender-logo" style={{ width: '8rem'}}/>
: <DataTableHeadLabel label={row.lender.name} />
}
</DataTableHeadCell>
))}
</TableRow>
Expand Down
8 changes: 6 additions & 2 deletions src/components/LoansTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Text from 'src/stories/text/Text';
import { ICreditProduct } from '../schemas/application';
import Button from '../stories/button/Button';
import { formatCurrency } from '../util';
import { DataTableCell, DataTableHeadCell, TransparentDataTableCell } from './DataTable';
import { DataTableCell, DataTableHeadCell, DataTableHeadLabel, TransparentDataTableCell } from './DataTable';
import DataWithDetail from './DataWithDetail';

export interface LoansTableProps {
Expand Down Expand Up @@ -35,7 +35,11 @@ export function LoansTable({ rows, amountRequested, currency, isLoading, selectO
</DataTableHeadCell>
{rows.map((row) => (
<DataTableHeadCell key={`header-${row.id}`}>
<img src={`/images/lenders/${row.lender.logo_filename}`} alt="lender-logo" style={{ width: '8rem'}}/>

{row.lender.logo_filename
? <img src={`/images/lenders/${row.lender.logo_filename}`} alt="lender-logo" style={{ width: '8rem'}}/>
: <DataTableHeadLabel label={row.lender.name} />
}
</DataTableHeadCell>
))}
</TableRow>
Expand Down

0 comments on commit 481ccf8

Please sign in to comment.