Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
jlbyrne committed Oct 23, 2024
1 parent 26fdcc3 commit ab24f99
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,21 @@ import RateCardStatements from "./statementDetails/RateCardStatements";

import routes from "../../routes";

interface IStatementProps {
statement: IStatementOverview;
showPage?: boolean;
}

class StatementDetails extends React.Component<IStatementProps, any> {
class StatementDetails extends React.Component {
constructor(props) {
super(props);

this.state = { rateCardStatement: [] };
this.state = { rateCardStatement };
}

public componentDidMount() {
componentDidMount() {
if (this.props.statement.showRateCards) {
this.setState({ isLoading: true });
this.loadGroups();
}
}

public async loadGroups() {
async loadGroups() {
await fetch(
routes.publishers.statements.rate_card.path +
`?start_date=${this.props.statement.earningPeriod.startDate}&end_date=${
Expand All @@ -65,7 +60,7 @@ class StatementDetails extends React.Component<IStatementProps, any> {
"X-Requested-With": "XMLHttpRequest",
},
method: "GET",
}
},
).then((response) => {
response.json().then((json) => {
this.setState({
Expand All @@ -76,7 +71,7 @@ class StatementDetails extends React.Component<IStatementProps, any> {
});
}

public render() {
render() {
return (
<Details>
<div className="mx-5 ">
Expand Down Expand Up @@ -115,7 +110,7 @@ class StatementDetails extends React.Component<IStatementProps, any> {
name={name}
results={GetParameterCaseInsensitive(
this.props.statement.depositedTypes,
name
name,
)}
>
<Amount>
Expand Down Expand Up @@ -194,7 +189,7 @@ class StatementDetails extends React.Component<IStatementProps, any> {
<a
href={routes.publishers.statements.show.path.replace(
"{period}",
this.props.statement.earningPeriod.startDate
this.props.statement.earningPeriod.startDate,
)}
>
<FormattedMessage id="statements.overview.viewMore" />
Expand Down Expand Up @@ -266,7 +261,7 @@ export const SettlementDestinationLink = (props) => {
<a
href={intl.formatMessage(
{ id: "statements.overview.upholdCardLink" },
{ cardId: props.settlementDestination }
{ cardId: props.settlementDestination },
)}
>
{props.children}
Expand Down

0 comments on commit ab24f99

Please sign in to comment.