iceholidays-frontend 0.12.0 → 0.14.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a3ec38ae7c3d23dd0728bb4db5695e9ce2a59be9d3ec5b4318b57b2bdef2883d
4
- data.tar.gz: 786da9eb7f5a1242153cb409a080dec4645ab22040dd0efd1af221b130fa279e
3
+ metadata.gz: '005399e8087efa7b5a58767d9db9f0b772b53d22a3c50a457abe908f4d9e72eb'
4
+ data.tar.gz: ee91e988dcc08b818e3b3e2982e151242cc735b9b912db1ff3288c0df57368a1
5
5
  SHA512:
6
- metadata.gz: 50e8ad6881de2f85f52f003517f290beabb02725320821b689236fa31cc144115d9317f6eeffe4be1cdbeac878698de10c772c29a300d8ecc4a39879cca5f951
7
- data.tar.gz: adbae28d5c2eb0a3d1e59163d21e11913592b52b45f5b2e78ade3f2f363a64e67cb81a92bc38e908a9fb54eab02b921ad4276ae67ccbac061ee7acdee3b19991
6
+ metadata.gz: 8ba234c65c677a869c0eac5ab9c5daab1e3ab98de5a9e1bc760167e9ea921d2e23c390c187c2d640768c6e98ab46f37841e616b0eb17d922dee7c9817bc1607b
7
+ data.tar.gz: 8d8e6c3817776b0247360b767ebeeb31653bc378941f394738f45e87d9656de13cd7e1191eb0feae63072e0958f22a4dd0daeb208ecc571029b5d3a8e11ea808
@@ -5,8 +5,18 @@ class ContactUsApi
5
5
 
6
6
  contactInquiry(formValues){
7
7
  const apiUrl = "/api/v1/inquiries";
8
-
9
- return axios.post(apiUrl, {inquiry: formValues})
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="/app" element={<MainLayout />}>
18
+ <Route path="/web" element={<MainLayout />}>
19
19
  <Route index element={<Homepage />} />
20
- <Route path="/app/listing" element={<ListingPage />} />
21
- <Route path="/app/itinerary/:id" element={<ShowPage />} />
22
- <Route path="/app/about-us" element={<AboutUsPage />} />
23
- <Route path="/app/countries" element={<CountriesPage />} />
24
- <Route path="/app/blog" element={<BlogPage />} />
25
- <Route path="/app/blog/:id" element={<BlogShowPage />} />
26
- <Route path="/app/contact-agents" element={<ContactAgentsPage />} />
27
- <Route path="/app/contact-us" element={<ContactUsPage />} />
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 `/app/listing?location_id=${locationId}`;
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 `/app/listing?location_id=${locationId}`;
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: "/app"
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: "/app/about-us"
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: "/app/contact-us"
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={`/app/listing?location_id=${country.id}`} target="_self"> {country.name} </a> )
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="/app/contact-agents">contact agents</a></div>
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="/app"> Home </Link>
24
+ label: <Link to="/web"> Home </Link>
25
25
  },
26
26
  {
27
27
  key: 'about-us',
28
- label: <Link to="/app/about-us"> About Us </Link>
28
+ label: <Link to="/web/about-us"> About Us </Link>
29
29
  },
30
30
  {
31
31
  key: 'countries',
32
- label: <Link to="/app/countries"> Countries </Link>
32
+ label: <Link to="/web/countries"> Countries </Link>
33
33
  },
34
34
  {
35
35
  key: 'blog',
36
- label: <Link to="/app/blog"> Blog </Link>
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="/app/contact-agents"> Contact Agents </Link>
45
+ label: <Link to="/web/contact-agents"> Contact Agents </Link>
46
46
  },
47
47
  {
48
48
  key: 'contact-us',
49
- label: <Link to="/app/contact-us"> Contact Us </Link>
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="/app"><img src="/iceholidays-assets/images/logo_mobile.png" className="logo logo_mobile"/></a>
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="/app">Home</a> },
15
- { title: <a href="/app/blog">Blog</a> }
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={`/app/blog/${blog.id}`} type="link" color="primary" variant="outlined" block>阅读更多</Button>
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>
@@ -78,7 +78,7 @@ export default class ContactUsPage extends React.Component {
78
78
  validateMessages={validateMessages}
79
79
  onFinish={(formValues)=>this.submitForm(formValues)}
80
80
  >
81
- <Form.Item label="Enter Name" name="name" required>
81
+ <Form.Item label="Enter Name" name="name">
82
82
  <Input placeholder="Enter Here" />
83
83
  </Form.Item>
84
84
 
@@ -95,7 +95,7 @@ export default class ContactUsPage extends React.Component {
95
95
  </Col>
96
96
  </Row>
97
97
 
98
- <Form.Item label="Select State" name="state" required>
98
+ <Form.Item label="Select State" name="state">
99
99
  <Select
100
100
  placeholder="Please Select"
101
101
  options={this.state?.states}
@@ -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="/app">Home</a> }],
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="/app">Home</a> }]});
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={`/app/itinerary/${itinerary.id}`}>Select</Link>
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(`/app/listing?${searchParams}`);
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(`/app/listing?keyword=${formValues.keyword}`);
29
+ // navigate(`/web/listing?keyword=${formValues.keyword}`);
30
30
  // })
31
31
  }
32
32
 
@@ -1,5 +1,5 @@
1
1
  module Iceholidays
2
2
  module Frontend
3
- VERSION = "0.12.0"
3
+ VERSION = "0.14.0"
4
4
  end
5
5
  end