Rename section placeholders
This commit is contained in:
parent
54ce62cf62
commit
4121de9db4
|
@ -44,10 +44,11 @@ export default ({ menuOpened, location }) => {
|
|||
}}>
|
||||
<SmartLink to="/">hyperapp</SmartLink>
|
||||
<SmartLink to="/tutorial">tutorial</SmartLink>
|
||||
<SmartLink to="/ecosystem">ecosystem</SmartLink>
|
||||
<SmartLink to="/sponsor">sponsor</SmartLink>
|
||||
<SmartLink to="/guides">guides</SmartLink>
|
||||
<SmartLink to="/api">api</SmartLink>
|
||||
<SmartLink to="/guides">guides</SmartLink>
|
||||
<SmartLink to="/ecosystem">ecosystem</SmartLink>
|
||||
{/* <SmartLink to="/examples">examples</SmartLink> */}
|
||||
|
||||
<form
|
||||
class="search-form"
|
||||
onsubmit={OnSearch}
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
var fx = function(a) {
|
||||
return function(b) {
|
||||
return [a, b]
|
||||
}
|
||||
}
|
||||
|
||||
export var request = fx((dispatch, props) => {
|
||||
var url = props.url
|
||||
var action = props.action
|
||||
var options = props.options || {}
|
||||
var expect = props.expect || 'text'
|
||||
|
||||
return fetch(url, options)
|
||||
.then(function(response) {
|
||||
if (!response.ok) {
|
||||
throw response
|
||||
}
|
||||
return response
|
||||
})
|
||||
.then(function(body) {
|
||||
return body[expect]()
|
||||
})
|
||||
.then(function(result) {
|
||||
dispatch(action, result)
|
||||
})
|
||||
.catch(function(error) {
|
||||
dispatch(action, error)
|
||||
})
|
||||
})
|
|
@ -1,7 +1,7 @@
|
|||
/* eslint-disable indent */
|
||||
import { app } from 'hyperapp'
|
||||
|
||||
import { request } from '../../lib/http/src/index'
|
||||
import { request } from './fx/http'
|
||||
|
||||
// App init imports
|
||||
import { WindowScrolled, PopState } from './subscriptions'
|
||||
|
@ -29,6 +29,7 @@ app({
|
|||
ParseUrl({
|
||||
menuOpened: false,
|
||||
showPreview: false,
|
||||
searchText: "",
|
||||
count: 0
|
||||
},
|
||||
window.location.pathname + window.location.search
|
||||
|
@ -53,10 +54,9 @@ app({
|
|||
state.location.path === '/' ? <Home {...state} />
|
||||
: state.location.path === '/page' ? <Page />
|
||||
: state.location.path === '/tutorial' ? <Tutorial />
|
||||
: state.location.path === '/ecosystem' ? <Ecosystem />
|
||||
: state.location.path === '/sponsor' ? <Sponsor />
|
||||
: state.location.path === '/guides' ? <Guides />
|
||||
: state.location.path === '/api' ? <Api />
|
||||
: state.location.path === '/guides' ? <Guides />
|
||||
: state.location.path === '/ecosystem' ? <Ecosystem />
|
||||
: state.location.path === '/search' ? <Search {...state} />
|
||||
: <FourOhFour />
|
||||
}
|
||||
|
|
|
@ -123,7 +123,7 @@ export default (state) => (
|
|||
|
||||
<form id="join-us" class="join-us" method="post" onsubmit={OnSubmit}>
|
||||
<h2>join us</h2>
|
||||
<p class="join-us-text">We love to talk javascript and hyperapp. if you've hit a stumbling block or got stuck, hop on the hyperapp slack to get help.</p>
|
||||
<p class="join-us-text">We love to talk JavaScript and Hyperapp. If you've hit a stumbling block or got stuck, hop on the hyperapp slack to get help.</p>
|
||||
<div class={{
|
||||
'nice-input': true,
|
||||
error: !!state.joinFormError
|
||||
|
|
|
@ -17,7 +17,7 @@ export const getPathInfo = (path) => {
|
|||
const url = new URL(path, 'http://localhost')
|
||||
const { search, pathname, searchParams } = url
|
||||
|
||||
// Ignore trailing slashes EXPEPT for home page
|
||||
// Ignore trailing slashes except for home page
|
||||
const withoutTrailingSlash = pathname !== '/' ? pathname.replace(/\/$/, '') : pathname
|
||||
|
||||
return {
|
||||
|
|
Loading…
Reference in New Issue