renderHeader({
openIssue,
paging,
- selectedIndex,
}: {
openIssue: Issue | undefined;
paging: Paging | undefined;
- selectedIndex: number | undefined;
}) {
return openIssue ? (
<A11ySkipTarget anchor="issues_main" />
canSetHome={!this.props.component}
effortTotal={this.state.effortTotal}
paging={this.props.component?.needIssueSync ? undefined : paging}
- selectedIndex={selectedIndex}
/>
</div>
</>
loadingRule,
} = this.state;
- const selectedIndex = this.getSelectedIndex();
-
return (
<ScreenPositionHelper>
{({ top }) => (
})}
style={{ height: `calc((100vh - ${top + LAYOUT_FOOTER_HEIGHT}px)` }}
>
- {this.renderHeader({ openIssue, paging, selectedIndex })}
+ {this.renderHeader({ openIssue, paging })}
<Spinner loading={loadingRule}>
{/* eslint-disable-next-line local-rules/no-conditional-rendering-of-deferredspinner */}
import { translate } from '../../../helpers/l10n';
interface Props {
- current: number | undefined;
total: number;
}
export default function IssuesCounter(props: Props) {
return (
- <PageCounter
- className="spacer-left"
- current={props.current}
- label={translate('issues.issues')}
- total={props.total}
- />
+ <PageCounter className="spacer-left" label={translate('issues.issues')} total={props.total} />
);
}
canSetHome: boolean;
effortTotal: number | undefined;
paging?: Paging;
- selectedIndex?: number;
}
export default function PageActions(props: PageActionsProps) {
- const { canSetHome, effortTotal, paging, selectedIndex } = props;
+ const { canSetHome, effortTotal, paging } = props;
return (
<div className="sw-body-sm sw-flex sw-items-center sw-gap-6 sw-justify-end sw-flex-1">
<KeyboardHint title={translate('issues.to_select_issues')} command="ArrowUp ArrowDown" />
<KeyboardHint title={translate('issues.to_navigate')} command="ArrowLeft ArrowRight" />
- {paging != null && <IssuesCounter current={selectedIndex} total={paging.total} />}
+ {paging != null && <IssuesCounter total={paging.total} />}
{effortTotal !== undefined && <TotalEffort effort={effortTotal} />}
{canSetHome && <HomePageSelect currentPage={{ type: 'ISSUES' }} />}
selectedLocationIndex,
} = props;
- let selectedIndex: number | undefined = issues.findIndex((issue) => issue.key === selected);
- selectedIndex = selectedIndex === -1 ? undefined : selectedIndex;
-
return (
<StyledWrapper>
- <SubnavigationIssuesListHeader
- loading={loading}
- paging={paging}
- selectedIndex={selectedIndex}
- />
+ <SubnavigationIssuesListHeader loading={loading} paging={paging} />
<StyledList>
{issues.map((issue, index) => {
const previousIssue = index > 0 ? issues[index - 1] : undefined;
interface Props {
loading: boolean;
paging: Paging | undefined;
- selectedIndex: number | undefined;
}
export default function SubnavigationIssuesListHeader(props: Props) {
- const { loading, paging, selectedIndex } = props;
+ const { loading, paging } = props;
return (
<StyledHeader>
- <Spinner loading={loading}>
- {paging && <IssuesCounter current={selectedIndex} total={paging.total} />}
- </Spinner>
+ <Spinner loading={loading}>{paging && <IssuesCounter total={paging.total} />}</Spinner>
</StyledHeader>
);
}