Skip to content

Commit

Permalink
Merge pull request #822 from the-hideout/sell-to-trader-total
Browse files Browse the repository at this point in the history
Small fixes
  • Loading branch information
Razzmatazzz authored Jan 16, 2024
2 parents 839f7c7 + 70d8ec0 commit e0c24b0
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 31 deletions.
3 changes: 2 additions & 1 deletion src/components/data-table/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,9 @@ function DataTable({
<tr>
{columns.map((col, colIndex) => (<th key={`col-sum-${colIndex}`}>{col.summable ? formatPrice(rows.map(row => {
const val = row.cells[colIndex].value;
const count = row.original?.count ? row.original.count : 1;
if (isNaN(val)) return false;
return val;
return val * count;
}).filter(Boolean).reduce((previousValue, currentValue) => previousValue + currentValue, 0)) : ''}</th>))}
</tr>
</tfoot>
Expand Down
2 changes: 2 additions & 0 deletions src/components/filter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import './index.css';
import { Fab } from '@mui/material';
import { mdiTune } from '@mdi/js';
import { Icon } from '@mdi/react';
import { t } from 'i18next';

const ConditionalWrapper = ({ condition, wrapper, children }) => {
return condition ? wrapper(children) : children;
Expand Down Expand Up @@ -271,6 +272,7 @@ function SelectFilter({
options={options}
ref={parentRef}
styles={selectFilterStyle}
noOptionsMessage={() => { return t('All options already selected');}}
/>
</ConditionalWrapper>
</ConditionalWrapper>
Expand Down
5 changes: 5 additions & 0 deletions src/pages/item/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@
font-size: x-large;
}

.filter-content-wrapper.compact {
padding-top: 0px;
padding-bottom: 0px;
}

.main-information-grid h1 {
align-items: center;
display: flex;
Expand Down
60 changes: 31 additions & 29 deletions src/pages/item/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -673,41 +673,43 @@ The max profitable price is impacted by the intel center and hideout management
<h2>
{t('Barters with {{itemName}}', {itemName: currentItemData.name})}
</h2>
<ToggleFilter
checked={showAllBarters}
label={t('Ignore settings')}
onChange={(e) =>
setShowAllBarters(!showAllBarters)
}
tooltipContent={
<>
{t('Shows all barters regardless of your settings')}
</>
}
/>
{dogtagToggle}
<ButtonGroupFilter>
<ButtonGroupFilterButton
tooltipContent={
<>
{t('Use barters for item sources')}
</>
<div className="filter-content-wrapper compact">
<ToggleFilter
checked={showAllBarters}
label={t('Ignore settings')}
onChange={(e) =>
setShowAllBarters(!showAllBarters)
}
selected={includeBarterIngredients}
content={<Icon path={mdiCached} size={1} className="icon-with-text"/>}
onClick={setIncludeBarterIngredients.bind(undefined, !includeBarterIngredients)}
/>
<ButtonGroupFilterButton
tooltipContent={
<>
{t('Use crafts for item sources')}
{t('Shows all barters regardless of your settings')}
</>
}
selected={includeCraftIngredients}
content={<Icon path={mdiProgressWrench} size={1} className="icon-with-text"/>}
onClick={setIncludeCraftIngredients.bind(undefined, !includeCraftIngredients)}
/>
</ButtonGroupFilter>
{dogtagToggle}
<ButtonGroupFilter>
<ButtonGroupFilterButton
tooltipContent={
<>
{t('Use barters for item sources')}
</>
}
selected={includeBarterIngredients}
content={<Icon path={mdiCached} size={1} className="icon-with-text"/>}
onClick={setIncludeBarterIngredients.bind(undefined, !includeBarterIngredients)}
/>
<ButtonGroupFilterButton
tooltipContent={
<>
{t('Use crafts for item sources')}
</>
}
selected={includeCraftIngredients}
content={<Icon path={mdiProgressWrench} size={1} className="icon-with-text"/>}
onClick={setIncludeCraftIngredients.bind(undefined, !includeCraftIngredients)}
/>
</ButtonGroupFilter>
</div>
</div>
<BartersTable
itemFilter={currentItemData.id}
Expand Down
3 changes: 2 additions & 1 deletion src/translations/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -571,5 +571,6 @@
"{{count}} days_other": "{{count}} days",
"Wipe Length": "Wipe Length",
"wipe-length-description": "Get the latest information on the average wipe length in Escape from Tarkov. Find out how long wipes typically last, and prepare for the next wipe.",
"Average Wipe Length among last 6 wipes:": "Average Wipe Length among last 6 wipes:"
"Average Wipe Length among last 6 wipes:": "Average Wipe Length among last 6 wipes:",
"All options already selected": "All options already selected"
}

0 comments on commit e0c24b0

Please sign in to comment.