-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
10e4017
commit f0a33a0
Showing
37 changed files
with
4,784 additions
and
4,687 deletions.
There are no files selected for viewing
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
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,20 +1,20 @@ | ||
/* eslint-disable global-require */ | ||
import { startApp } from '@quintype/framework/client/start' | ||
import { renderApplication } from './render' | ||
import '../../app/assets/stylesheets/app.scss' | ||
import wretch from 'wretch' | ||
import { startApp } from "@quintype/framework/client/start"; | ||
import { renderApplication } from "./render"; | ||
import "../../app/assets/stylesheets/app.scss"; | ||
import wretch from "wretch"; | ||
|
||
function enableHotReload (store) { | ||
if (process.env.NODE_ENV === 'development' && module.hot) { | ||
module.hot.accept('./render', () => renderApplication(store)) | ||
function enableHotReload(store) { | ||
if (process.env.NODE_ENV === "development" && module.hot) { | ||
module.hot.accept("./render", () => renderApplication(store)); | ||
} | ||
} | ||
|
||
const CUSTOM_REDUCERS = {} | ||
const CUSTOM_REDUCERS = {}; | ||
|
||
global.wretch = wretch | ||
global.wretch = wretch; | ||
|
||
startApp(renderApplication, CUSTOM_REDUCERS, { | ||
enableServiceWorker: process.env.NODE_ENV === 'production', | ||
appVersion: require('../isomorphic/app-version') | ||
}).then(enableHotReload) | ||
enableServiceWorker: process.env.NODE_ENV === "production", | ||
appVersion: require("../isomorphic/app-version") | ||
}).then(enableHotReload); |
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,14 +1,14 @@ | ||
import { | ||
renderIsomorphicComponent, | ||
renderBreakingNews | ||
} from '@quintype/framework/client/start' | ||
import { pickComponent } from '../isomorphic/pick-component' | ||
import { BreakingNewsView } from '../isomorphic/components/breaking-news-view' | ||
} from "@quintype/framework/client/start"; | ||
import { pickComponent } from "../isomorphic/pick-component"; | ||
import { BreakingNewsView } from "../isomorphic/components/breaking-news-view"; | ||
|
||
// This is a separate file as everything from here on is hot reloaded when the app changes | ||
export function renderApplication (store) { | ||
renderIsomorphicComponent('container', store, pickComponent, { | ||
export function renderApplication(store) { | ||
renderIsomorphicComponent("container", store, pickComponent, { | ||
hydrate: !global.qtLoadedFromShell | ||
}) | ||
renderBreakingNews('breaking-news-container', store, BreakingNewsView) | ||
}); | ||
renderBreakingNews("breaking-news-container", store, BreakingNewsView); | ||
} |
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 +1 @@ | ||
module.exports = 1 | ||
module.exports = 1; |
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,7 +1,7 @@ | ||
export { HomePage } from '../components/pages/home' | ||
export { SectionPage } from '../components/pages/section' | ||
export { TagPage } from '../components/pages/tag' | ||
export { SearchPage } from '../components/pages/search' | ||
export { CatalogPage } from '../components/pages/catalog' | ||
export { HomePagePreview } from '../components/pages/home-preview' | ||
export { NotFoundPage } from '../components/pages/not-found' | ||
export { HomePage } from "../components/pages/home"; | ||
export { SectionPage } from "../components/pages/section"; | ||
export { TagPage } from "../components/pages/tag"; | ||
export { SearchPage } from "../components/pages/search"; | ||
export { CatalogPage } from "../components/pages/catalog"; | ||
export { HomePagePreview } from "../components/pages/home-preview"; | ||
export { NotFoundPage } from "../components/pages/not-found"; |
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,2 +1,2 @@ | ||
export { StoryPage } from '../components/pages/story' | ||
export { StoryPagePreview } from '../components/pages/story-preview' | ||
export { StoryPage } from "../components/pages/story"; | ||
export { StoryPagePreview } from "../components/pages/story-preview"; |
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,14 +1,14 @@ | ||
import React from 'react' | ||
import renderer from 'react-test-renderer' | ||
import React from "react"; | ||
import renderer from "react-test-renderer"; | ||
|
||
function Component ({ page, children }) { | ||
return <a href={page}>{children}</a> | ||
function Component({ page, children }) { | ||
return <a href={page}>{children}</a>; | ||
} | ||
|
||
test('adds 1 + 2 to equal 3', () => { | ||
test("adds 1 + 2 to equal 3", () => { | ||
const component = renderer.create( | ||
<Component page="http://www.facebook.com">Facebook</Component> | ||
) | ||
const tree = component.toJSON() | ||
expect(tree).toMatchSnapshot() | ||
}) | ||
); | ||
const tree = component.toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); |
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 @@ | ||
import React from 'react' | ||
import React from "react"; | ||
|
||
function breakingNewsItem (story) { | ||
return <li key={story.id}>{story.headline}</li> | ||
function breakingNewsItem(story) { | ||
return <li key={story.id}>{story.headline}</li>; | ||
} | ||
|
||
function BreakingNewsView (props) { | ||
function BreakingNewsView(props) { | ||
if (props.breakingNews.length === 0) { | ||
return <span /> | ||
return <span />; | ||
} | ||
|
||
return ( | ||
<ul className="breaking-news"> | ||
{props.breakingNews.map(story => breakingNewsItem(story))} | ||
</ul> | ||
) | ||
); | ||
} | ||
|
||
export { BreakingNewsView } | ||
export { BreakingNewsView }; |
10 changes: 5 additions & 5 deletions
10
app/isomorphic/components/collection-templates/four-col-grid.js
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,14 +1,14 @@ | ||
// Implement more logic here | ||
|
||
import React from 'react' | ||
import { StoryGrid } from '../story-grid' | ||
import './four-col-grid.m.css' | ||
import React from "react"; | ||
import { StoryGrid } from "../story-grid"; | ||
import "./four-col-grid.m.css"; | ||
|
||
export function FourColGrid ({ collection, stories }) { | ||
export function FourColGrid({ collection, stories }) { | ||
return ( | ||
<div> | ||
<h3 styleName="heading">{collection.name}</h3> | ||
<StoryGrid stories={stories} /> | ||
</div> | ||
) | ||
); | ||
} |
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,7 +1,7 @@ | ||
import { wrapCollectionLayout } from '@quintype/components' | ||
import { FourColGrid } from './four-col-grid' | ||
import { wrapCollectionLayout } from "@quintype/components"; | ||
import { FourColGrid } from "./four-col-grid"; | ||
|
||
export default { | ||
FourColGrid: wrapCollectionLayout(FourColGrid), | ||
defaultTemplate: wrapCollectionLayout(FourColGrid) | ||
} | ||
}; |
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,31 +1,31 @@ | ||
/* eslint-disable object-shorthand */ | ||
import { createDfpAdComponent } from '@quintype/components' | ||
import get from 'lodash/get' | ||
import { createDfpAdComponent } from "@quintype/components"; | ||
import get from "lodash/get"; | ||
|
||
export const CONFIG = { | ||
'homepage-banner': { adUnit: 'Rio_Story_LB1', sizes: [[728, 90]] } | ||
} | ||
"homepage-banner": { adUnit: "Rio_Story_LB1", sizes: [[728, 90]] } | ||
}; | ||
|
||
export const DfpAd = createDfpAdComponent({ | ||
defaultNetworkID: '60988533', | ||
defaultNetworkID: "60988533", | ||
config: CONFIG, | ||
targeting: function (state) { | ||
const params = {} | ||
targeting: function(state) { | ||
const params = {}; | ||
|
||
if ( | ||
get(state, ['qt', 'pageType']) === 'story-page' && | ||
get(state, ['qt', 'data', 'story', 'metadata', 'sponsored-by']) | ||
get(state, ["qt", "pageType"]) === "story-page" && | ||
get(state, ["qt", "data", "story", "metadata", "sponsored-by"]) | ||
) { | ||
params.sponsor = get(state, [ | ||
'qt', | ||
'data', | ||
'story', | ||
'metadata', | ||
'sponsored-by' | ||
]) | ||
return params.sponsor | ||
"qt", | ||
"data", | ||
"story", | ||
"metadata", | ||
"sponsored-by" | ||
]); | ||
return params.sponsor; | ||
} | ||
|
||
return params | ||
return params; | ||
} | ||
}) | ||
}); |
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,5 +1,5 @@ | ||
import templates from './collection-templates' | ||
import templates from "./collection-templates"; | ||
|
||
export function getCollectionTemplate (designTemplate) { | ||
return templates[designTemplate] || templates.defaultTemplate | ||
export function getCollectionTemplate(designTemplate) { | ||
return templates[designTemplate] || templates.defaultTemplate; | ||
} |
Oops, something went wrong.