+
+
{
+ if (e.target === e.currentTarget) {
+ scrollableRef.current?.scrollTo({
+ top: 0,
+ behavior: 'smooth',
+ });
+ }
+ }}
+ >
+
+ {title}
+
+
+ {!!items.length ? (
+ <>
+
+ {items.map((status) => (
+ -
+
+
+
+
+ ))}
+
+ {showMore && (
+
+ )}
+ >
+ ) : uiState === 'loading' ? (
+
+ {Array.from({ length: 5 }).map((_, i) => (
+ -
+
+
+ ))}
+
+ ) : (
+ uiState !== 'loading' &&
{emptyText}
+ )}
+ {uiState === 'error' ? (
+
+ {errorText}
+
+
+
+
+ ) : (
+ uiState !== 'loading' &&
+ !!items.length &&
+ !showMore &&
The end.
+ )}
+
+
+ );
+}
+
+export default Timeline;
diff --git a/src/compose.jsx b/src/compose.jsx
index 8c5e0a41..8a339378 100644
--- a/src/compose.jsx
+++ b/src/compose.jsx
@@ -2,7 +2,7 @@ import './index.css';
import './app.css';
-import { login } from 'masto';
+import { createClient } from 'masto';
import { render } from 'preact';
import { useEffect, useState } from 'preact/hooks';
@@ -14,12 +14,12 @@ if (window.opener) {
console = window.opener.console;
}
-(async () => {
+(() => {
if (window.masto) return;
console.warn('window.masto not found. Trying to log in...');
try {
const { instanceURL, accessToken } = getCurrentAccount();
- window.masto = await login({
+ window.masto = createClient({
url: `https://${instanceURL}`,
accessToken,
disableVersionCheck: true,
diff --git a/src/pages/404.jsx b/src/pages/404.jsx
new file mode 100644
index 00000000..42bef41a
--- /dev/null
+++ b/src/pages/404.jsx
@@ -0,0 +1,15 @@
+import Link from '../components/link';
+
+export default function NotFound() {
+ return (
+
-
-
{
- if (e.target === e.currentTarget) {
- scrollableRef.current?.scrollTo({
- top: 0,
- behavior: 'smooth',
- });
- }
- }}
- onDblClick={(e) => {
- loadBookmarks(true);
- }}
- >
-
- Bookmarks
-
-
- {!!bookmarks.length ? (
- <>
-
- {bookmarks.map((status) => (
- -
-
-
-
-
- ))}
-
- {showMore && (
-
- )}
- >
- ) : (
- uiState !== 'loading' && (
-
No bookmarks yet. Go bookmark something!
- )
- )}
- {uiState === 'loading' ? (
-
- {Array.from({ length: 5 }).map((_, i) => (
- -
-
-
- ))}
-
- ) : uiState === 'error' ? (
-
- Unable to load bookmarks.
-
-
-
-
- ) : (
- bookmarks.length &&
- !showMore &&
The end.
- )}
-
-
+