Rename section placeholders

This commit is contained in:
Jorge Bucaran 2020-04-22 21:24:11 +09:00
parent 54ce62cf62
commit 4121de9db4
No known key found for this signature in database
GPG Key ID: E54BA3C0E646DB30
5 changed files with 39 additions and 9 deletions

View File

@ -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}

29
docs/src/fx/http.js Normal file
View File

@ -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)
})
})

View File

@ -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 />
}

View File

@ -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

View File

@ -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 {