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
type FiveCardModular = { | |
name: 'FiveCardModular', | |
} | |
type FourCardModular = { | |
name: 'FourCardModular', | |
} | |
type HorizontalList = { | |
name: 'HorizontalList', |
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
type SideHeader = { | |
type: 'SideHeader', | |
title: string, | |
useLogo? : boolean, | |
description? : string, | |
customImage: SimpleImage, | |
links: Array <{ | |
url: string, | |
text: string | |
}> |
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
// Here is the proposed data structure for the new home page, which consists entirely of these modules. | |
// Here is a wip doc for the modules: https://docs.google.com/document/d/1eA8CZmEVfwge3oNBOyD1YCiK1UIz2HXLbnBmdRzPYps/edit# | |
// A single blog would have an array of these modules | |
// HELP WANTED: help us find a freakin name for these CurationBlocks that make sense and doesn't conflict with anything | |
// we have currently. | |
type CurationBlock = { | |
id: CurationBlockId, // We store an id for each one so when you edit it, we can save based on id and not index | |
layout: string, // enum, each layout has its own name | |
autofill?: { // If this is not undefined, the module will autofill and ignore the cards array (for now) |
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
export type DeletedEmbedJSON = {| | |
type: 'DeletedEmbed', | |
originalContent: {type?: string}, | |
deletedReason: ?DeletedReason | |
|}; |
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
export type DeletedEmbedJSON = { | |
type: 'DeletedEmbed', | |
originalContent: {type?: string}, | |
deletedReason: ?DeletedReason | |
}; |
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
export type DeletedEmbedJSON = { | |
type: 'DeletedEmbed', | |
originalContent: {type?: string}, | |
deletedReason: ?DeletedReason | |
}; |
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
get featuredVideoUrl(): ?string { | |
if (this.featuredMedia && this.featuredMedia.id) { | |
let videoParams; | |
switch (this.featuredMedia.type) { | |
case 'YoutubeVideo': | |
videoParams = { | |
id: `youtube-video-${this.featuredMedia.id}`, | |
start: this.featuredMedia.start | |
}; | |
break; |
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
function getKinjaVideoForPost(post: Post): Array<string> { | |
const videoNodes = post.body.reduce<Array<KinjaVideoJSON>>((acc, n) => { | |
if (n.type === 'KinjaVideo') { | |
return [...acc, n]; | |
} | |
return acc; | |
}, []); | |
return videoNodes.map(vn => vn.id); | |
} |
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
function isKinjaVideo(blockNode: BlockNodeJSON): boolean { | |
return blockNode.type === 'KinjaVideo'; | |
} | |
export default function getKinjaVideoForPost(post: Post): Array<string> { | |
const videoNodes = post.body.filter(n => isKinjaVideo(n)); | |
return videoNodes.map(vn => vn.id); | |
} |
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
function isKinjaVideo(blockNode: BlockNodeJSON): boolean { | |
return blockNode.type === 'KinjaVideo'; | |
} | |
export default function getKinjaVideoForPost(post: Post): Array<string> { | |
const videoNodes = post.body.filter(n => isKinjaVideo(n)); | |
return videoNodes.map(vn => vn.id); | |
} |
NewerOlder