Skip to content

Commit

Permalink
fix: add new search button when no result for searching developer (#284)
Browse files Browse the repository at this point in the history
* chore: bump elements version

* fix: add button new search when no result

* fix: change from info text to helper info
  • Loading branch information
duong-se authored Jan 21, 2020
1 parent efdac73 commit cd4a88a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/components/pages/admin-dev-management.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as React from 'react'
import { History } from 'history'
import { connect } from 'react-redux'
import { Link } from 'react-router-dom'
import { withRouter, RouteComponentProps, match } from 'react-router'
import { ReduxState } from '@/types/core'
import { REVISIONS_PER_PAGE } from '@/constants/paginator'
Expand All @@ -14,7 +15,8 @@ import {
Button,
Loader,
Section,
setQueryParams
setQueryParams,
Helper
} from '@reapit/elements'
import Routes from '@/constants/routes'
import AdminDevManagementFilterForm, {
Expand All @@ -24,6 +26,7 @@ import AdminSetDeveloperStatusModal from '@/components/ui/developer-set-status'
import { DeveloperModel } from '@reapit/foundations-ts-definitions'
import { adminDevManagementRequestData, AdminDevManagementRequestDataValues } from '@/actions/admin-dev-management'
import qs from 'querystring'
import styles from '@/styles/pages/admin-dev-management.scss?mod'

export interface AdminDevManagementMappedActions {
fetchData: (requestdata: AdminDevManagementRequestDataValues) => void
Expand Down Expand Up @@ -99,7 +102,18 @@ export const AdminDevManagement: React.FC<AdminDevManagementProps> = ({
}

if (!loading && data?.data?.length === 0) {
return <Info infoType="DEVELOPER_EMPTY" />
return (
<React.Fragment>
<Helper variant="info">
Unfortunately, there are no results that match your search criteria, please try again
</Helper>
<Link className={styles.textCenter} to="/admin/dev-management">
<Button variant="primary" type="button">
New Search
</Button>
</Link>
</React.Fragment>
)
}

return (
Expand Down
4 changes: 4 additions & 0 deletions src/styles/pages/admin-dev-management.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
margin-left: 0;
margin-right: 0;
}

.textCenter {
text-align: center;
}

0 comments on commit cd4a88a

Please sign in to comment.