-
Notifications
You must be signed in to change notification settings - Fork 685
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Group order confirmation page code by file types
- Loading branch information
1 parent
ffe5986
commit 447bb9d
Showing
43 changed files
with
9,710 additions
and
9,628 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,47 @@ | ||
import React from 'react'; | ||
import { Provider as ReduxProvider } from 'react-redux'; | ||
import createStore from '../store'; | ||
import MagentoRouter from '../Router'; | ||
|
||
/** | ||
* | ||
* @param {string} apiBase Absolute URL pointing to the GraphQL endpoint | ||
* @param {string} __tmp_webpack_public_path__ Temporary hack. Expects the `__webpack_public_path__` value | ||
* @returns {{ store: Store, Provider: () => JSX.Element }} | ||
*/ | ||
export default function bootstrap({ | ||
apiBase, | ||
renderRoutes, | ||
__tmp_webpack_public_path__ | ||
}) { | ||
// Remove deprecation warning after 2 version bumps | ||
if (process.env.NODE_ENV !== 'production' && this instanceof bootstrap) { | ||
throw new Error( | ||
'The API for Peregrine has changed. ' + | ||
'Please see the Release Notes on Github ' + | ||
'for instructions to update your application' | ||
); | ||
} | ||
|
||
const store = createStore(); | ||
const routerProps = { | ||
apiBase, | ||
renderRoutes, | ||
__tmp_webpack_public_path__: ensureDirURI(__tmp_webpack_public_path__) | ||
}; | ||
const Provider = () => ( | ||
<ReduxProvider store={store}> | ||
<MagentoRouter {...routerProps} /> | ||
</ReduxProvider> | ||
); | ||
|
||
return { store, Provider }; | ||
} | ||
|
||
/** | ||
* Given a URI, will always return the same URI with a trailing slash | ||
* @param {string} uri | ||
*/ | ||
function ensureDirURI(uri) { | ||
return uri.endsWith('/') ? uri : uri + '/'; | ||
} | ||
import React from 'react'; | ||
import { Provider as ReduxProvider } from 'react-redux'; | ||
import createStore from '../store'; | ||
import MagentoRouter from '../Router'; | ||
|
||
/** | ||
* | ||
* @param {string} apiBase Absolute URL pointing to the GraphQL endpoint | ||
* @param {string} __tmp_webpack_public_path__ Temporary hack. Expects the `__webpack_public_path__` value | ||
* @returns {{ store: Store, Provider: () => JSX.Element }} | ||
*/ | ||
export default function bootstrap({ | ||
apiBase, | ||
renderRoutes, | ||
__tmp_webpack_public_path__ | ||
}) { | ||
// Remove deprecation warning after 2 version bumps | ||
if (process.env.NODE_ENV !== 'production' && this instanceof bootstrap) { | ||
throw new Error( | ||
'The API for Peregrine has changed. ' + | ||
'Please see the Release Notes on Github ' + | ||
'for instructions to update your application' | ||
); | ||
} | ||
|
||
const store = createStore(); | ||
const routerProps = { | ||
apiBase, | ||
renderRoutes, | ||
__tmp_webpack_public_path__: ensureDirURI(__tmp_webpack_public_path__) | ||
}; | ||
const Provider = () => ( | ||
<ReduxProvider store={store}> | ||
<MagentoRouter {...routerProps} /> | ||
</ReduxProvider> | ||
); | ||
|
||
return { store, Provider }; | ||
} | ||
|
||
/** | ||
* Given a URI, will always return the same URI with a trailing slash | ||
* @param {string} uri | ||
*/ | ||
function ensureDirURI(uri) { | ||
return uri.endsWith('/') ? uri : uri + '/'; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,51 @@ | ||
import React, { Component } from 'react'; | ||
import { BrowserRouter, Route } from 'react-router-dom'; | ||
import { string, func, object } from 'prop-types'; | ||
import MagentoRouteHandler from './MagentoRouteHandler'; | ||
|
||
export default class MagentoRouter extends Component { | ||
static propTypes = { | ||
/* Can be BrowserRouter, MemoryRouter, HashRouter, etc */ | ||
using: func, | ||
routerProps: object, | ||
apiBase: string.isRequired, | ||
renderRoutes: func, | ||
__tmp_webpack_public_path__: string.isRequired | ||
}; | ||
|
||
static defaultProps = { | ||
using: BrowserRouter, | ||
routerProps: {}, | ||
renderRoutes: ({ magentoRoute }) => magentoRoute | ||
}; | ||
|
||
render() { | ||
const { | ||
using: Router, | ||
routerProps, | ||
apiBase, | ||
renderRoutes, | ||
__tmp_webpack_public_path__ | ||
} = this.props; | ||
|
||
return ( | ||
<Router {...routerProps}> | ||
{renderRoutes({ | ||
magentoRoute: ( | ||
<Route | ||
render={({ location }) => ( | ||
<MagentoRouteHandler | ||
location={location} | ||
apiBase={apiBase} | ||
__tmp_webpack_public_path__={ | ||
__tmp_webpack_public_path__ | ||
} | ||
/> | ||
)} | ||
/> | ||
) | ||
})} | ||
</Router> | ||
); | ||
} | ||
} | ||
import React, { Component } from 'react'; | ||
import { BrowserRouter, Route } from 'react-router-dom'; | ||
import { string, func, object } from 'prop-types'; | ||
import MagentoRouteHandler from './MagentoRouteHandler'; | ||
|
||
export default class MagentoRouter extends Component { | ||
static propTypes = { | ||
/* Can be BrowserRouter, MemoryRouter, HashRouter, etc */ | ||
using: func, | ||
routerProps: object, | ||
apiBase: string.isRequired, | ||
renderRoutes: func, | ||
__tmp_webpack_public_path__: string.isRequired | ||
}; | ||
|
||
static defaultProps = { | ||
using: BrowserRouter, | ||
routerProps: {}, | ||
renderRoutes: ({ magentoRoute }) => magentoRoute | ||
}; | ||
|
||
render() { | ||
const { | ||
using: Router, | ||
routerProps, | ||
apiBase, | ||
renderRoutes, | ||
__tmp_webpack_public_path__ | ||
} = this.props; | ||
|
||
return ( | ||
<Router {...routerProps}> | ||
{renderRoutes({ | ||
magentoRoute: ( | ||
<Route | ||
render={({ location }) => ( | ||
<MagentoRouteHandler | ||
location={location} | ||
apiBase={apiBase} | ||
__tmp_webpack_public_path__={ | ||
__tmp_webpack_public_path__ | ||
} | ||
/> | ||
)} | ||
/> | ||
) | ||
})} | ||
</Router> | ||
); | ||
} | ||
} |
44 changes: 22 additions & 22 deletions
44
...pwa-devdocs/src/_drafts/venia-pwa-concept/component/order-confirmation/index.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
--- | ||
title: OrderConfirmation component | ||
--- | ||
|
||
| Description | Reference image | | ||
| -------------------------- | :-------------------------------------------: | | ||
| Order confirmation | ![Order confirmation]{:width="300px"} | | ||
| **Order number** link | ![Order number]{:width="300px"} | | ||
| **Continue shopping** button | ![Continue shopping button]{:width="300px"} | | ||
| **Create an account** button | ![Create an account button]{:width="300px"} | | ||
{:style="table-layout:auto"} | ||
|
||
[Order confirmation]: {{site.baseurl}}{% link venia-pwa-concept/images/order-confirmation.png %} | ||
[Order number]: {{site.baseurl}}{% link venia-pwa-concept/images/order-number.png %} | ||
[Continue shopping button]: {{site.baseurl}}{% link venia-pwa-concept/images/continue-shopping-button.png %} | ||
[Create an account button]: {{site.baseurl}}{% link venia-pwa-concept/images/create-an-account-button.png %} | ||
|
||
## Interactions | ||
|
||
* **Continue shopping** button - On tap navigates the user to the page he came from. | ||
* **Create an account** button - On tap navigates the user to the account creation page. | ||
* **Order number** link - On tap navigates the user to the page of purchase he just made. | ||
--- | ||
title: OrderConfirmation component | ||
--- | ||
|
||
| Description | Reference image | | ||
| -------------------------- | :-------------------------------------------: | | ||
| Order confirmation | ![Order confirmation]{:width="300px"} | | ||
| **Order number** link | ![Order number]{:width="300px"} | | ||
| **Continue shopping** button | ![Continue shopping button]{:width="300px"} | | ||
| **Create an account** button | ![Create an account button]{:width="300px"} | | ||
{:style="table-layout:auto"} | ||
|
||
[Order confirmation]: {{site.baseurl}}{% link venia-pwa-concept/images/order-confirmation.png %} | ||
[Order number]: {{site.baseurl}}{% link venia-pwa-concept/images/order-number.png %} | ||
[Continue shopping button]: {{site.baseurl}}{% link venia-pwa-concept/images/continue-shopping-button.png %} | ||
[Create an account button]: {{site.baseurl}}{% link venia-pwa-concept/images/create-an-account-button.png %} | ||
|
||
## Interactions | ||
|
||
* **Continue shopping** button - On tap navigates the user to the page he came from. | ||
* **Create an account** button - On tap navigates the user to the account creation page. | ||
* **Order number** link - On tap navigates the user to the page of purchase he just made. |
38 changes: 19 additions & 19 deletions
38
...s/pwa-devdocs/src/_drafts/venia-pwa-concept/component/purchase-history/index.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
--- | ||
title: PurchaseHistory component | ||
--- | ||
|
||
| Description | Reference image | | ||
| -------------------------- | :-------------------------------------------: | | ||
| Purchase history | ![Purchase history]{:width="300px"} | | ||
| Filter | ![Filter]{:width="300px"} | | ||
| Purchase history list item | ![Purchase history list item]{:width="300px"} | | ||
{:style="table-layout:auto"} | ||
|
||
[Purchase history]: {{site.baseurl}}{% link venia-pwa-concept/images/purchase-history.png %} | ||
[Filter]: {{site.baseurl}}{% link venia-pwa-concept/images/purchase-history-filter.png %} | ||
[Purchase history list item]: {{site.baseurl}}{% link venia-pwa-concept/images/purchase-history-item.png %} | ||
|
||
## Interactions | ||
|
||
* **Tap Item** - Navigates the user away from the purchase history and into the particular purchase history item page. | ||
* **Tap Filter** - Shows up filter adjustments menu | ||
--- | ||
title: PurchaseHistory component | ||
--- | ||
|
||
| Description | Reference image | | ||
| -------------------------- | :-------------------------------------------: | | ||
| Purchase history | ![Purchase history]{:width="300px"} | | ||
| Filter | ![Filter]{:width="300px"} | | ||
| Purchase history list item | ![Purchase history list item]{:width="300px"} | | ||
{:style="table-layout:auto"} | ||
|
||
[Purchase history]: {{site.baseurl}}{% link venia-pwa-concept/images/purchase-history.png %} | ||
[Filter]: {{site.baseurl}}{% link venia-pwa-concept/images/purchase-history-filter.png %} | ||
[Purchase history list item]: {{site.baseurl}}{% link venia-pwa-concept/images/purchase-history-item.png %} | ||
|
||
## Interactions | ||
|
||
* **Tap Item** - Navigates the user away from the purchase history and into the particular purchase history item page. | ||
* **Tap Filter** - Shows up filter adjustments menu |
Oops, something went wrong.