Skip to content

Commit

Permalink
Merge pull request #139 from ChtiJS/feat/mastodon
Browse files Browse the repository at this point in the history
feat(mastodon): Switched from X to mastodon
  • Loading branch information
nfroidure authored Nov 21, 2023
2 parents 9c9aedd + 570aaa1 commit de369c0
Show file tree
Hide file tree
Showing 6 changed files with 368 additions and 103 deletions.
165 changes: 133 additions & 32 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
"front-matter": "^4.0.2",
"lunr": "^2.3.9",
"next": "14.0.3",
"node-html-markdown": "^1.3.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"remark-parse": "^11.0.0",
"swr": "^2.2.4",
"twitter-api-sdk": "^1.2.1",
"typescript": "5.3.2",
"unified": "^11.0.4",
"yerror": "^6.2.1"
Expand Down
62 changes: 62 additions & 0 deletions src/components/tootList.tsx
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&nbsp;:</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;
51 changes: 0 additions & 51 deletions src/components/tweetList.tsx

This file was deleted.

Loading

0 comments on commit de369c0

Please sign in to comment.