-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #139 from ChtiJS/feat/mastodon
feat(mastodon): Switched from X to mastodon
- Loading branch information
Showing
6 changed files
with
368 additions
and
103 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,62 @@ | ||
import Heading2 from './h2'; | ||
import { renderMarkdown } from '../utils/markdown'; | ||
import Paragraph from './p'; | ||
import Anchor from './a'; | ||
import type { MarkdownRootNode } from '../utils/markdown'; | ||
|
||
export type Toots = { | ||
id: string; | ||
text: MarkdownRootNode; | ||
createdAt: string; | ||
url: string; | ||
}[]; | ||
|
||
const TootList = ({ toots }: { toots: Toots }) => ( | ||
<aside className="root"> | ||
<Heading2>Derniers messages Mastodon :</Heading2> | ||
<div className="tootList"> | ||
{toots.map((toot) => ( | ||
<div key={toot.id} className="toot"> | ||
{renderMarkdown({ index: 0 }, toot.text)} | ||
<Paragraph> | ||
Publié le{" "} | ||
<Anchor href={toot.url}> | ||
{new Date(toot.createdAt).toLocaleString()}. | ||
</Anchor> | ||
</Paragraph> | ||
</div> | ||
))} | ||
</div> | ||
<style jsx>{` | ||
.root { | ||
margin: 0 0 var(--vRythm) 0; | ||
} | ||
.toot :global(a) { | ||
color: #205370; | ||
} | ||
.toot :global(p) { | ||
margin-left: 2%; | ||
} | ||
.toot :global(a):hover { | ||
color: #14171a; | ||
} | ||
.tootList { | ||
margin-top: var(--vRythm); | ||
display: flex; | ||
flex-direction: row; | ||
gap: var(--gutter); | ||
} | ||
.toot { | ||
border-style: solid; | ||
border-color: var(--grey); | ||
border-size: var(--borderSize); | ||
border-radius: var(--borderRadius); | ||
width: var(--block); | ||
padding: calc(var(--vRythm) / 2) calc(var(--gutter) / 2); | ||
} | ||
`}</style> | ||
</aside> | ||
); | ||
|
||
export default TootList; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.