1
1
import React from "react" ;
2
2
import { FormattedMessage } from "react-intl" ;
3
- import styled from "styled-components" ;
4
3
import { useResource } from "rest-hooks" ;
5
4
6
- import { Button } from "components" ;
5
+ import { Button , MainPageWithScroll } from "components" ;
7
6
import { Routes } from "../../../routes" ;
8
7
import PageTitle from "components/PageTitle" ;
9
8
import useRouter from "components/hooks/useRouterHook" ;
10
9
import DestinationsTable from "./components/DestinationsTable" ;
11
10
import config from "config" ;
12
- import ContentCard from "components/ContentCard" ;
13
- import EmptyResource from "components/EmptyResourceBlock" ;
14
11
import DestinationResource from "core/resources/Destination" ;
15
12
import HeadTitle from "components/HeadTitle" ;
16
-
17
- const Content = styled ( ContentCard ) `
18
- margin: 0 32px 0 27px;
19
- ` ;
13
+ import Placeholder , { ResourceTypes } from "components/Placeholder" ;
20
14
21
15
const AllDestinationsPage : React . FC = ( ) => {
22
16
const { push } = useRouter ( ) ;
@@ -29,26 +23,25 @@ const AllDestinationsPage: React.FC = () => {
29
23
push ( `${ Routes . Destination } ${ Routes . DestinationNew } ` ) ;
30
24
31
25
return (
32
- < >
33
- < HeadTitle titles = { [ { id : "admin.destinations" } ] } />
34
- < PageTitle
35
- title = { < FormattedMessage id = "admin.destinations" /> }
36
- endComponent = {
37
- < Button onClick = { onCreateDestination } data-id = "new-destination" >
38
- < FormattedMessage id = "destination.newDestination" />
39
- </ Button >
40
- }
41
- />
26
+ < MainPageWithScroll
27
+ headTitle = { < HeadTitle titles = { [ { id : "admin.destinations" } ] } /> }
28
+ pageTitle = {
29
+ < PageTitle
30
+ title = { < FormattedMessage id = "admin.destinations" /> }
31
+ endComponent = {
32
+ < Button onClick = { onCreateDestination } data-id = "new-destination" >
33
+ < FormattedMessage id = "destination.newDestination" />
34
+ </ Button >
35
+ }
36
+ />
37
+ }
38
+ >
42
39
{ destinations . length ? (
43
40
< DestinationsTable destinations = { destinations } />
44
41
) : (
45
- < Content >
46
- < EmptyResource
47
- text = { < FormattedMessage id = "destinations.noDestinations" /> }
48
- />
49
- </ Content >
42
+ < Placeholder resource = { ResourceTypes . Destinations } />
50
43
) }
51
- </ >
44
+ </ MainPageWithScroll >
52
45
) ;
53
46
} ;
54
47
0 commit comments