diff --git a/src/App.tsx b/src/App.tsx index 194ce2be..94bc2646 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -4,8 +4,10 @@ import { EventStore } from 'applesauce-core' import { AccountManager } from 'applesauce-accounts' import { RelayPool } from 'applesauce-relay' import { createAddressLoader } from 'applesauce-loaders/loaders' +import { faRightFromBracket } from '@fortawesome/free-solid-svg-icons' import Login from './components/Login' import Bookmarks from './components/Bookmarks' +import IconButton from './components/IconButton' function App() { const [eventStore, setEventStore] = useState(null) @@ -63,13 +65,21 @@ function App() {
+ {isAuthenticated && ( +
+ setIsAuthenticated(false)} + title="Logout" + ariaLabel="Logout" + variant="ghost" + /> +
+ )} {!isAuthenticated ? ( setIsAuthenticated(true)} /> ) : ( - setIsAuthenticated(false)} - /> + )}
diff --git a/src/components/BookmarkList.tsx b/src/components/BookmarkList.tsx index 74f8f293..d931bbce 100644 --- a/src/components/BookmarkList.tsx +++ b/src/components/BookmarkList.tsx @@ -1,15 +1,13 @@ import React from 'react' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' -import { faChevronLeft, faChevronRight, faRightFromBracket } from '@fortawesome/free-solid-svg-icons' +import { faChevronLeft, faChevronRight } from '@fortawesome/free-solid-svg-icons' import { Bookmark, ActiveAccount } from '../types/bookmarks' import { BookmarkItem } from './BookmarkItem' import { formatDate, renderParsedContent } from '../utils/bookmarkUtils' -import IconButton from './IconButton' interface BookmarkListProps { bookmarks: Bookmark[] activeAccount: ActiveAccount | null - onLogout: () => void formatUserDisplay: () => string onSelectUrl?: (url: string) => void isCollapsed: boolean @@ -19,7 +17,6 @@ interface BookmarkListProps { export const BookmarkList: React.FC = ({ bookmarks, activeAccount, - onLogout, formatUserDisplay, onSelectUrl, isCollapsed, @@ -57,13 +54,6 @@ export const BookmarkList: React.FC = ({ > - diff --git a/src/components/Bookmarks.tsx b/src/components/Bookmarks.tsx index 74653c97..b1fb801f 100644 --- a/src/components/Bookmarks.tsx +++ b/src/components/Bookmarks.tsx @@ -3,20 +3,17 @@ import { Hooks } from 'applesauce-react' import { useEventModel } from 'applesauce-react/hooks' import { Models } from 'applesauce-core' import { RelayPool } from 'applesauce-relay' -import { faRightFromBracket } from '@fortawesome/free-solid-svg-icons' import { Bookmark } from '../types/bookmarks' import { BookmarkList } from './BookmarkList' import { fetchBookmarks } from '../services/bookmarkService' import ContentPanel from './ContentPanel' import { fetchReadableContent, ReadableContent } from '../services/readerService' -import IconButton from './IconButton' interface BookmarksProps { relayPool: RelayPool | null - onLogout: () => void } -const Bookmarks: React.FC = ({ relayPool, onLogout }) => { +const Bookmarks: React.FC = ({ relayPool }) => { const [bookmarks, setBookmarks] = useState([]) const [loading, setLoading] = useState(true) const [selectedUrl, setSelectedUrl] = useState(undefined) @@ -106,13 +103,6 @@ const Bookmarks: React.FC = ({ relayPool, onLogout }) => {

Logged in as: {formatUserDisplay()}

)} -
Loading bookmarks...
@@ -125,7 +115,6 @@ const Bookmarks: React.FC = ({ relayPool, onLogout }) => {