This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Widget for a Recent Posts | |
*/ | |
// Register and load the widget | |
function load_custom_widget() { | |
register_widget('Custom_Recent_Posts_Widget'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// /components/pages/LocationsPage/index.js | |
import { useEffect, useState } from 'react'; | |
import InfiniteScroll from 'react-infinite-scroller'; | |
import { sortBy, uniqBy } from 'lodash'; | |
import replaceall from 'replaceall'; | |
import { useForm } from 'react-hook-form'; | |
import { BiSearch } from 'react-icons/bi'; | |
import { getLocations, setUserGeo } from '../../../lib/services'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// /lib/services/userGeo.js | |
// Set user lat/lng in localStorage | |
export const setUserGeo = async (userGeo) => { | |
if (typeof window !== 'undefined') { | |
await localStorage.setItem('userGeo', JSON.stringify(userGeo)); | |
return true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// /lib/services/index.js | |
import jwtDecode from 'jwt-decode'; | |
import AuthService from '../services/auth' | |
import { wpgraph } from '../../api/wp'; | |
import server from '../../api/server'; | |
import { getUserGeo } from './userGeo'; | |
const AUTH_URL = process.env.APP_AUTH_ENDPOINT; | |
const auth = new AuthService(AUTH_URL); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// /components/pages/LocationsPage/components/AutoSuggestInput.js | |
import Autosuggest from 'react-autosuggest'; | |
import { FaMapPin } from 'react-icons/fa'; | |
import { getAutocomplete } from '../../../../lib/services'; | |
import Address from '../../../global/Address'; | |
import TermIcon from '../../../../components/global/TermIcon'; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// pages/locations/[country]/[state]/index.js | |
import { getLocations } from '../../../../lib/services'; | |
import Layout from '../../../../components/layout/Layout'; | |
import SeoHead from '../../../../components/global/SeoHead'; | |
import StateDetailPage from '../../../../components/pages/StateDetailPage'; | |
import { getAdventures, getLocationTypes, getStatePageBySlug, getStates } from '../../../../lib/services/wpQueries'; | |
function State(props) { | |
const { page } = props; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// components/global/SeoHead/index.js | |
import { NextSeo } from 'next-seo'; | |
import React, { Fragment } from 'react'; | |
import { uniqBy } from 'lodash'; | |
import Head from 'next/head'; | |
import replaceall from 'replaceall'; | |
import parse from 'html-react-parser'; | |
import { removeTrailingSlash, replaceWithAppUrl } from '../../../lib/utils'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// components/layout/Layout.js | |
import { Fragment} from 'react'; | |
import Header from './Header'; | |
import Footer from './Footer'; | |
const Layout = ({ children }) => { | |
return ( | |
<Fragment> | |
<Header /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// components/pages/StateDetailPage/index.js | |
import { filter, map, remove, lowerCase } from 'lodash'; | |
import PageMain from '../../../components/layout/PageMain'; | |
import LocationsList from '../../../components/global/LocationsList'; | |
import globals from '../../../lib/globals'; | |
import PageHeader from '../../global/PageHeader/PageHeader'; | |
import styles from './StateDetailPage.module.scss'; | |
import Button from '../../global/buttons/Button'; | |
import SectionAdventures from './components/SectionAdventures'; | |
import { ButtonContainer } from '../../global/buttons'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ====================================== | |
// StateDetailPage | |
// ====================================== | |
@import '../../../scss/utilities/_variables.scss'; | |
@import '../../../scss/utilities/_mixins.scss'; | |
.page-content { | |
flex-direction: column; | |
display: flex; |
OlderNewer