Skip to content

Instantly share code, notes, and snippets.

@borlaym
Last active December 16, 2019 14:28
Show Gist options
  • Save borlaym/f87a63f950bfa11fc12e792ce58e5812 to your computer and use it in GitHub Desktop.
Save borlaym/f87a63f950bfa11fc12e792ce58e5812 to your computer and use it in GitHub Desktop.
Final type of data structure for curated front page
type SideHeader = {
type: 'SideHeader',
title: string,
useLogo? : boolean,
description? : string,
customImage: SimpleImage,
links: Array <{
url: string,
text: string
}>
}
type TopHeader = {
type: 'TopHeader',
title: string,
useLogo? : boolean,
links? : Array <{
url: string,
text: string
}>
}
type FourEqualWithSidebar = {
name: 'FourEqualWithSidebar',
header: SideHeader
}
type Feed = {
name: 'Feed',
header: TopHeader,
numberOfCards: number
};
type CurationBlockLayout = FourEqualWithSidebar | Feed;
type Autofill = {
type: 'BlogAutofill',
blogId: BlogId
} | {
type: 'TagAutofill',
tagCanonical: string,
blogId: BlogId
} | {
type: 'StoryTypeAutofill',
storyTypeId: StoryTypeId,
} | {
type: 'CategoryAutofill',
categoryId: CategoryId
}
type StandardBlock = {
type: 'Standard',
layout: CurationBlockLayout,
autofill? : Autofill,
cards: Array <{
postId: PostId
}>
}
type VideoBlock = {
type: 'Video'
}
type CurationBlock = StandardBlock | VideoBlock
@vtanyi-gmg
Copy link

The MVP layouts are:

type Layout = FiveCardModular | FourCardModular | HorizontalList

type FiveCardModular = {
	type: 'FiveCardModular'
}

type FourCardModular = {
	type: 'FourCardModular'
}

type HorizontalList = {
	type: 'HorizontalList',
	header: TopHeader
};

type TopHeader = {
	type: 'TopHeader',
	title: string,
	useLogo: boolean,
	links: Array<{
		url: string,
		text: string
	}>
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment