forked from ChilliCream/graphql-platform
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
15 changed files
with
207 additions
and
222 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
require("prismjs/themes/prism-tomorrow.css"); | ||
require("prismjs/plugins/line-numbers/prism-line-numbers.css"); |
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,32 +0,0 @@ | ||
// const React = require("react"); | ||
|
||
// exports.onRenderBody = ({ setPostBodyComponents }) => { | ||
// setPostBodyComponents([ | ||
// <script | ||
// dangerouslySetInnerHTML={{ | ||
// __html: ` | ||
// window.addEventListener("scroll", function() { | ||
// console.log("TESTSTSTSTS"); | ||
// const content = document.getElementById("content"); | ||
// const header = document.getElementById("header"); | ||
// const className = "test"; | ||
// const classNames = header.className.split(/\s+/); | ||
|
||
// if (content.scrollTop > 5) { | ||
// if (classNames.indexOf(className) === -1) { | ||
// header.className += " " + className; | ||
// } | ||
// } else { | ||
// const index = classNames.indexOf(className); | ||
|
||
// if (index !== -1) { | ||
// classNames.splice(index, 1); | ||
// header.className = classNames.join(" "); | ||
// } | ||
// } | ||
// }); | ||
// `, | ||
// }} | ||
// />, | ||
// ]); | ||
// }; | ||
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import styled from "styled-components"; | ||
|
||
export const ArticleTitle = styled.h1` | ||
margin-top: 20px; | ||
margin-right: 20px; | ||
margin-left: 20px; | ||
font-size: 2em; | ||
@media only screen and (min-width: 800px) { | ||
margin-right: 50px; | ||
margin-left: 50px; | ||
} | ||
`; |
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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import React, { FunctionComponent } from "react"; | ||
import styled from "styled-components"; | ||
import { Link } from "../misc/link"; | ||
|
||
interface BlogArticleMetadataProperties { | ||
author: string; | ||
authorImageUrl: string; | ||
authorUrl: string; | ||
date: string; | ||
readingTime: string; | ||
} | ||
|
||
export const BlogArticleMetadata: FunctionComponent<BlogArticleMetadataProperties> = ({ | ||
author, | ||
authorImageUrl, | ||
authorUrl, | ||
date, | ||
readingTime, | ||
}) => { | ||
return ( | ||
<Metadata> | ||
<AuthorLink to={authorUrl}> | ||
<AuthorImage src={authorImageUrl} /> | ||
{author} | ||
</AuthorLink>{" "} | ||
・ {date} ・ {readingTime} | ||
</Metadata> | ||
); | ||
}; | ||
|
||
const Metadata = styled.div` | ||
display: flex; | ||
flex-direction: row; | ||
align-items: center; | ||
margin: 0 20px 20px; | ||
font-size: 0.778em; | ||
@media only screen and (min-width: 800px) { | ||
margin: 0 50px 20px; | ||
} | ||
`; | ||
|
||
const AuthorLink = styled(Link)` | ||
display: flex; | ||
flex: 0 0 auto; | ||
flex-direction: row; | ||
align-items: center; | ||
color: #666; | ||
`; | ||
|
||
const AuthorImage = styled.img` | ||
flex: 0 0 auto; | ||
margin-right: 0.5em; | ||
border-radius: 15px; | ||
width: 30px; | ||
`; |
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import React, { FunctionComponent } from "react"; | ||
import styled from "styled-components"; | ||
import { Link } from "./link"; | ||
|
||
interface BlogArticleTagsProperties { | ||
tags: string[]; | ||
} | ||
|
||
export const BlogArticleTags: FunctionComponent<BlogArticleTagsProperties> = ({ | ||
tags, | ||
}) => { | ||
return ( | ||
<> | ||
{tags.length > 0 && ( | ||
<Tags> | ||
{tags.map(tag => ( | ||
<Tag key={tag}> | ||
<TagLink to={`/blog/tags/${tag}`}>{tag}</TagLink> | ||
</Tag> | ||
))} | ||
</Tags> | ||
)} | ||
</> | ||
); | ||
}; | ||
|
||
const Tags = styled.ul` | ||
margin: 0 20px 20px; | ||
list-style-type: none; | ||
@media only screen and (min-width: 800px) { | ||
margin: 0 50px 20px; | ||
} | ||
`; | ||
|
||
const Tag = styled.li` | ||
display: inline-block; | ||
margin: 0 5px 5px 0; | ||
border-radius: 4px; | ||
padding: 0; | ||
background-color: #f40010; | ||
font-size: 0.722em; | ||
letter-spacing: 0.05em; | ||
color: #fff; | ||
`; | ||
|
||
const TagLink = styled(Link)` | ||
display: block; | ||
padding: 5px 15px; | ||
color: #fff; | ||
`; |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import styled from "styled-components"; | ||
|
||
export const IconContainer = styled.span<{ size?: 16 | 24 | 32 }>` | ||
display: inline-flex; | ||
align-items: center; | ||
justify-content: center; | ||
width: ${props => props.size || 24}px; | ||
height: ${props => props.size || 24}px; | ||
font-size: 24px; | ||
line-height: 24px; | ||
vertical-align: middle; | ||
`; |
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
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
Oops, something went wrong.