iceholidays-frontend 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/javascript/api-services/contact-us-api.service.ts +12 -2
- data/app/javascript/react/App.tsx +9 -9
- data/app/javascript/react/components/Destinations.tsx +1 -1
- data/app/javascript/react/components/shared/LocationPostcards.tsx +11 -13
- data/app/javascript/react/layouts/MainFooter.tsx +5 -5
- data/app/javascript/react/layouts/MainHeader.tsx +7 -7
- data/app/javascript/react/pages/BlogPage.tsx +3 -3
- data/app/javascript/react/pages/ListingPage.tsx +3 -3
- data/app/javascript/react/widgets/SearchBarWidget.tsx +2 -2
- data/lib/iceholidays/frontend/version.rb +1 -1
- data/public/iceholidays-assets/application.js +60 -60
- data/public/iceholidays-assets/application.js.map +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 136d050f210efcff32751ee80c8099c596704f0824dcb8bd77b6ba9877988d45
|
|
4
|
+
data.tar.gz: d3787e03aa547be81ff6f061b1ec577d198377bcf57f347c7c5689a425a2de28
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e18e8800b9fa3bc7d3b526b83fc9d265ccec3c79527462796452e8779c04ced9b80460043aa42e36af54726e177466f3301e1ff62486b4eb516f32b781a045b8
|
|
7
|
+
data.tar.gz: d67d2b77a7e6d5800572ab99ed532f2d9e4fa409d5be0ab82dcede2990e557f3f7b970534d44e2b28a79990473c02c772e53234633b5186a29ba8a21a58ed124
|
|
@@ -5,8 +5,18 @@ class ContactUsApi
|
|
|
5
5
|
|
|
6
6
|
contactInquiry(formValues){
|
|
7
7
|
const apiUrl = "/api/v1/inquiries";
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
const csrfToken = document.head.querySelector('meta[name="csrf-token"]')?.getAttribute("content");
|
|
9
|
+
|
|
10
|
+
return axios.post(
|
|
11
|
+
apiUrl,
|
|
12
|
+
{inquiry: formValues},
|
|
13
|
+
{
|
|
14
|
+
headers: {
|
|
15
|
+
'Content-Type': 'application/json',
|
|
16
|
+
'X-CSRF-Token': csrfToken
|
|
17
|
+
},
|
|
18
|
+
}
|
|
19
|
+
)
|
|
10
20
|
.then(response => {
|
|
11
21
|
const ok = response.status == 200;
|
|
12
22
|
return Promise.resolve(ok);
|
|
@@ -15,16 +15,16 @@ export default function App() {
|
|
|
15
15
|
return (
|
|
16
16
|
<BrowserRouter>
|
|
17
17
|
<Routes>
|
|
18
|
-
<Route path="/
|
|
18
|
+
<Route path="/web" element={<MainLayout />}>
|
|
19
19
|
<Route index element={<Homepage />} />
|
|
20
|
-
<Route path="/
|
|
21
|
-
<Route path="/
|
|
22
|
-
<Route path="/
|
|
23
|
-
<Route path="/
|
|
24
|
-
<Route path="/
|
|
25
|
-
<Route path="/
|
|
26
|
-
<Route path="/
|
|
27
|
-
<Route path="/
|
|
20
|
+
<Route path="/web/listing" element={<ListingPage />} />
|
|
21
|
+
<Route path="/web/itinerary/:id" element={<ShowPage />} />
|
|
22
|
+
<Route path="/web/about-us" element={<AboutUsPage />} />
|
|
23
|
+
<Route path="/web/countries" element={<CountriesPage />} />
|
|
24
|
+
<Route path="/web/blog" element={<BlogPage />} />
|
|
25
|
+
<Route path="/web/blog/:id" element={<BlogShowPage />} />
|
|
26
|
+
<Route path="/web/contact-agents" element={<ContactAgentsPage />} />
|
|
27
|
+
<Route path="/web/contact-us" element={<ContactUsPage />} />
|
|
28
28
|
</Route>
|
|
29
29
|
</Routes>
|
|
30
30
|
</BrowserRouter>
|
|
@@ -47,7 +47,7 @@ export default class Destinations extends React.Component {
|
|
|
47
47
|
`${count} ${noun}${count > 1 ? suffix : ''}`;
|
|
48
48
|
|
|
49
49
|
const listingLink = (locationId: number) => {
|
|
50
|
-
return `/
|
|
50
|
+
return `/web/listing?location_id=${locationId}`;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
|
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { FC } from "react";
|
|
2
2
|
import { Link } from "react-router-dom";
|
|
3
3
|
import { mdiMenuRight } from "@mdi/js";
|
|
4
4
|
import Icon from "@mdi/react";
|
|
5
|
-
import { Location } from "../../../interfaces/country.interface";
|
|
5
|
+
import { City, Location } from "../../../interfaces/country.interface";
|
|
6
6
|
|
|
7
|
+
interface PostcardProps {
|
|
8
|
+
link: string;
|
|
9
|
+
image: string | undefined;
|
|
10
|
+
name: string;
|
|
11
|
+
tourCount: number | undefined;
|
|
12
|
+
}
|
|
7
13
|
|
|
8
|
-
const Postcard = (
|
|
9
|
-
props: {
|
|
10
|
-
link: string;
|
|
11
|
-
image: string;
|
|
12
|
-
name: string;
|
|
13
|
-
tourCount: number;
|
|
14
|
-
}
|
|
15
|
-
) => {
|
|
16
|
-
const { link, image, name, tourCount } = props;
|
|
14
|
+
const Postcard: FC<PostcardProps> = ( {tourCount = 0, link, image, name}) => {
|
|
17
15
|
|
|
18
16
|
const pluralize = (count: number, noun: string, suffix = 's') =>
|
|
19
17
|
`${count} ${noun}${count > 1 ? suffix : ''}`;
|
|
@@ -37,13 +35,13 @@ const LocationPostcards = (
|
|
|
37
35
|
const { locations } = props;
|
|
38
36
|
|
|
39
37
|
const listingLink = (locationId: number) => {
|
|
40
|
-
return `/
|
|
38
|
+
return `/web/listing?location_id=${locationId}`;
|
|
41
39
|
}
|
|
42
40
|
|
|
43
41
|
return (
|
|
44
42
|
<div className="postcards">
|
|
45
43
|
{
|
|
46
|
-
locations.map((city, index)=><Postcard key={index} link={listingLink(city.id)} image={city.cover} name={city.name} tourCount={city.tourCount}/>)
|
|
44
|
+
locations.map((city:City, index)=><Postcard key={index} link={listingLink(city.id)} image={city.cover} name={city.name} tourCount={city.tourCount}/>)
|
|
47
45
|
}
|
|
48
46
|
</div>
|
|
49
47
|
)
|
|
@@ -20,7 +20,7 @@ export default class MainFooter extends React.Component<IMainFooterProps> {
|
|
|
20
20
|
menus = [
|
|
21
21
|
{
|
|
22
22
|
label: "Home",
|
|
23
|
-
link: "/
|
|
23
|
+
link: "/web"
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
label: "pdpa",
|
|
@@ -29,7 +29,7 @@ export default class MainFooter extends React.Component<IMainFooterProps> {
|
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
31
|
label: "about us",
|
|
32
|
-
link: "/
|
|
32
|
+
link: "/web/about-us"
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
label: "privacy policy",
|
|
@@ -38,7 +38,7 @@ export default class MainFooter extends React.Component<IMainFooterProps> {
|
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
label: "contact us",
|
|
41
|
-
link: "/
|
|
41
|
+
link: "/web/contact-us"
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
label: "terms & conditions",
|
|
@@ -66,7 +66,7 @@ export default class MainFooter extends React.Component<IMainFooterProps> {
|
|
|
66
66
|
<div className="link-group-title">Countries</div>
|
|
67
67
|
<div className="link-group-items">
|
|
68
68
|
{
|
|
69
|
-
this.state.countries.map((country: Country)=> <a key={country.id} href={`/
|
|
69
|
+
this.state.countries.map((country: Country)=> <a key={country.id} href={`/web/listing?location_id=${country.id}`} target="_self"> {country.name} </a> )
|
|
70
70
|
}
|
|
71
71
|
</div>
|
|
72
72
|
</Space>
|
|
@@ -84,7 +84,7 @@ export default class MainFooter extends React.Component<IMainFooterProps> {
|
|
|
84
84
|
<Space direction="vertical" align="center">
|
|
85
85
|
<Flex vertical gap="20px" align="center">
|
|
86
86
|
<div className="link-group-title">Contact Us</div>
|
|
87
|
-
<div><a href="/
|
|
87
|
+
<div><a href="/web/contact-agents">contact agents</a></div>
|
|
88
88
|
<div className="link-group-title">Follow us on</div>
|
|
89
89
|
<Flex gap={20} justify="space-between" className="social-icons">
|
|
90
90
|
<a target="_blank" href="https://www.facebook.com/thesignaturetour"><img src="/iceholidays-assets/images/social/ico_fb.png"/></a>
|
|
@@ -21,19 +21,19 @@ class MainHeader extends React.Component <{location}> {
|
|
|
21
21
|
items: MenuItem[] = [
|
|
22
22
|
{
|
|
23
23
|
key: 'app',
|
|
24
|
-
label: <Link to="/
|
|
24
|
+
label: <Link to="/web"> Home </Link>
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
key: 'about-us',
|
|
28
|
-
label: <Link to="/
|
|
28
|
+
label: <Link to="/web/about-us"> About Us </Link>
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
31
|
key: 'countries',
|
|
32
|
-
label: <Link to="/
|
|
32
|
+
label: <Link to="/web/countries"> Countries </Link>
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
key: 'blog',
|
|
36
|
-
label: <Link to="/
|
|
36
|
+
label: <Link to="/web/blog"> Blog </Link>
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
key: 'logo',
|
|
@@ -42,11 +42,11 @@ class MainHeader extends React.Component <{location}> {
|
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
key: 'contact-agents',
|
|
45
|
-
label: <Link to="/
|
|
45
|
+
label: <Link to="/web/contact-agents"> Contact Agents </Link>
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
key: 'contact-us',
|
|
49
|
-
label: <Link to="/
|
|
49
|
+
label: <Link to="/web/contact-us"> Contact Us </Link>
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
52
|
key: 'brochure',
|
|
@@ -115,7 +115,7 @@ class MainHeader extends React.Component <{location}> {
|
|
|
115
115
|
<div id="main-header">
|
|
116
116
|
<Menu mode="horizontal" items={this.items} onClick={this.onClick} selectedKeys={[current]} className="nav-menu"/>
|
|
117
117
|
|
|
118
|
-
<a href="/
|
|
118
|
+
<a href="/web"><img src="/iceholidays-assets/images/logo_mobile.png" className="logo logo_mobile"/></a>
|
|
119
119
|
|
|
120
120
|
<div id="nav-buttons">
|
|
121
121
|
<Button onClick={()=>this.downloadBrochure()} className="get-brochure" id="get-brochure-mobile" type="primary"><Icon path={mdiFileDownload} size="18px" /> get brochure</Button>
|
|
@@ -11,8 +11,8 @@ const { Meta } = Card;
|
|
|
11
11
|
|
|
12
12
|
const bannerPath = '/iceholidays-assets/images/blog.png';
|
|
13
13
|
const _breadcrumbs = [
|
|
14
|
-
{ title: <a href="/
|
|
15
|
-
{ title: <a href="/
|
|
14
|
+
{ title: <a href="/web">Home</a> },
|
|
15
|
+
{ title: <a href="/web/blog">Blog</a> }
|
|
16
16
|
]
|
|
17
17
|
|
|
18
18
|
const types = [ {type: "News", label: "News"},{type: "Blogs", label:"Blogs"} ];
|
|
@@ -80,7 +80,7 @@ export default class BlogPage extends React.Component {
|
|
|
80
80
|
<Markdown remarkPlugins={[remarkGfm]} rehypePlugins={[rehypeRaw]}>{blog.content}</Markdown>
|
|
81
81
|
</div>
|
|
82
82
|
|
|
83
|
-
<Button className="view-blog" href={`/
|
|
83
|
+
<Button className="view-blog" href={`/web/blog/${blog.id}`} type="link" color="primary" variant="outlined" block>阅读更多</Button>
|
|
84
84
|
</>
|
|
85
85
|
} />
|
|
86
86
|
</Card>
|
|
@@ -48,7 +48,7 @@ class ListingPage extends React.Component <{searchParams}> {
|
|
|
48
48
|
searchParamsObj: {keyword: "", year: "", month: "", location_id: null},
|
|
49
49
|
itineraries: [],
|
|
50
50
|
location: {name: "", cover: ""},
|
|
51
|
-
breadcrumbs: [{ title: <a href="/
|
|
51
|
+
breadcrumbs: [{ title: <a href="/web">Home</a> }],
|
|
52
52
|
descriptionModalOpen: false,
|
|
53
53
|
itineraryModalOpen: false,
|
|
54
54
|
dateModalOpen: false,
|
|
@@ -103,7 +103,7 @@ class ListingPage extends React.Component <{searchParams}> {
|
|
|
103
103
|
|
|
104
104
|
getLocation(locationId){
|
|
105
105
|
//resets the breadcrumbs
|
|
106
|
-
this.setState({breadcrumbs: [{ title: <a href="/
|
|
106
|
+
this.setState({breadcrumbs: [{ title: <a href="/web">Home</a> }]});
|
|
107
107
|
|
|
108
108
|
this.locationsApi.getLocation(locationId)
|
|
109
109
|
.then(locationData => {
|
|
@@ -272,7 +272,7 @@ class ListingPage extends React.Component <{searchParams}> {
|
|
|
272
272
|
<span className="price">{itinerary.priceCurrency} {itinerary.price}</span>
|
|
273
273
|
<span>All In</span>
|
|
274
274
|
</Flex>
|
|
275
|
-
<Link className="select-tour" to={`/
|
|
275
|
+
<Link className="select-tour" to={`/web/itinerary/${itinerary.id}`}>Select</Link>
|
|
276
276
|
</Space>
|
|
277
277
|
</div>
|
|
278
278
|
</Col>
|
|
@@ -21,12 +21,12 @@ function SearchBarWidget() {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const searchParams = new URLSearchParams(searchObj).toString();
|
|
24
|
-
navigate(`/
|
|
24
|
+
navigate(`/web/listing?${searchParams}`);
|
|
25
25
|
navigate(0);
|
|
26
26
|
|
|
27
27
|
// searchApi.search(formValues.keyword, formValues.month)
|
|
28
28
|
// .then(result => {
|
|
29
|
-
// navigate(`/
|
|
29
|
+
// navigate(`/web/listing?keyword=${formValues.keyword}`);
|
|
30
30
|
// })
|
|
31
31
|
}
|
|
32
32
|
|