Skip to content

Commit

Permalink
Arrange Invoice, Recurring Invoices and Estimate tabs for a more natu…
Browse files Browse the repository at this point in the history
…ral flow (#40)

* Update English locale to remove the capitalised 'ALL' for the invoices tab

* Arrange Invoice, Recurring Invoices and Estimate tabs for a more natural flow
  • Loading branch information
mwikala authored Apr 26, 2022
1 parent 886e9bd commit 70f2900
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"tabs": {
"draft": "Draft",
"sent": "Sent",
"all": "ALL"
"all": "All"
},
"invoice_date": "Invoice Date",
"due_date": "Due Date",
Expand Down
14 changes: 7 additions & 7 deletions src/screens/estimates/list-estimates/list-estimates.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default class Estimates extends React.Component<IProps, IStates> {
constructor(props) {
super(props);
this.state = {
activeTab: ESTIMATES_TABS.DRAFT,
activeTab: ESTIMATES_TABS.ALL,
search: ''
};
}
Expand All @@ -39,7 +39,7 @@ export default class Estimates extends React.Component<IProps, IStates> {
});
};

setActiveTab = (activeTab = ESTIMATES_TABS.DRAFT) => {
setActiveTab = (activeTab = ESTIMATES_TABS.ALL) => {
this.setState({activeTab});
const {search} = this.state;
const {formValues} = this.props;
Expand Down Expand Up @@ -177,6 +177,11 @@ export default class Estimates extends React.Component<IProps, IStates> {
};

const tabs = [
{
Title: ESTIMATES_TABS.ALL,
tabName: TAB_NAME.ALL,
render: <Tab parentProps={this} />
},
{
Title: ESTIMATES_TABS.DRAFT,
tabName: TAB_NAME.DRAFT,
Expand All @@ -186,11 +191,6 @@ export default class Estimates extends React.Component<IProps, IStates> {
Title: ESTIMATES_TABS.SENT,
tabName: TAB_NAME.SENT,
render: <Tab parentProps={this} />
},
{
Title: ESTIMATES_TABS.ALL,
tabName: TAB_NAME.ALL,
render: <Tab parentProps={this} />
}
];

Expand Down
14 changes: 7 additions & 7 deletions src/screens/invoices/list-invoices/list-invoices.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default class Invoices extends React.Component<IProps, IStates> {
constructor(props) {
super(props);
this.state = {
activeTab: INVOICES_TABS.DRAFT,
activeTab: INVOICES_TABS.ALL,
search: ''
};
}
Expand All @@ -43,7 +43,7 @@ export default class Invoices extends React.Component<IProps, IStates> {
});
};

setActiveTab = (activeTab = INVOICES_TABS.DRAFT) => {
setActiveTab = (activeTab = INVOICES_TABS.ALL) => {
this.setState({activeTab});
const {search} = this.state;
const {formValues} = this.props;
Expand Down Expand Up @@ -181,6 +181,11 @@ export default class Invoices extends React.Component<IProps, IStates> {
};

const tabs = [
{
Title: INVOICES_TABS.ALL,
tabName: TAB_NAME.all,
render: <Tab parentProps={this} />
},
{
Title: INVOICES_TABS.DRAFT,
tabName: TAB_NAME.draft,
Expand All @@ -190,11 +195,6 @@ export default class Invoices extends React.Component<IProps, IStates> {
Title: INVOICES_TABS.SENT,
tabName: TAB_NAME.sent,
render: <Tab parentProps={this} />
},
{
Title: INVOICES_TABS.ALL,
tabName: TAB_NAME.all,
render: <Tab parentProps={this} />
}
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default class RecurringInvoices extends React.Component<
constructor(props) {
super(props);
this.state = {
activeTab: RECURRING_INVOICES_TABS.ACTIVE,
activeTab: RECURRING_INVOICES_TABS.ALL,
search: ''
};
}
Expand All @@ -43,7 +43,7 @@ export default class RecurringInvoices extends React.Component<
this.setActiveTab();
};

setActiveTab = (activeTab = RECURRING_INVOICES_TABS.ACTIVE) => {
setActiveTab = (activeTab = RECURRING_INVOICES_TABS.ALL) => {
this.setState({activeTab});
const {search} = this.state;
const {formValues} = this.props;
Expand Down Expand Up @@ -178,6 +178,11 @@ export default class RecurringInvoices extends React.Component<
};

const tabs = [
{
Title: RECURRING_INVOICES_TABS.ALL,
tabName: TAB_NAME.all,
render: <Tab parentProps={this} />
},
{
Title: RECURRING_INVOICES_TABS.ACTIVE,
tabName: TAB_NAME.active,
Expand All @@ -187,11 +192,6 @@ export default class RecurringInvoices extends React.Component<
Title: RECURRING_INVOICES_TABS.ON_HOLD,
tabName: TAB_NAME.on_hold,
render: <Tab parentProps={this} />
},
{
Title: RECURRING_INVOICES_TABS.ALL,
tabName: TAB_NAME.all,
render: <Tab parentProps={this} />
}
];

Expand Down

0 comments on commit 70f2900

Please sign in to comment.