this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Move notifications link from Following to Home

+24 -20
+2 -19
src/pages/following.jsx
··· 1 1 import { useEffect, useRef } from 'preact/hooks'; 2 2 import { useSnapshot } from 'valtio'; 3 3 4 - import Icon from '../components/icon'; 5 - import Link from '../components/link'; 6 4 import Timeline from '../components/timeline'; 7 5 import { api } from '../utils/api'; 8 6 import states from '../utils/states'; ··· 11 9 12 10 const LIMIT = 20; 13 11 14 - function Following({ title, path, id, headerStart }) { 12 + function Following({ title, path, id, ...props }) { 15 13 useTitle(title || 'Following', path, '/l/f'); 16 14 const { masto, instance } = api(); 17 15 const snapStates = useSnapshot(states); ··· 109 107 }; 110 108 }, []); 111 109 112 - const headerEnd = ( 113 - <Link 114 - to="/notifications" 115 - class={`button plain ${ 116 - snapStates.notificationsShowNew ? 'has-badge' : '' 117 - }`} 118 - onClick={(e) => { 119 - e.stopPropagation(); 120 - }} 121 - > 122 - <Icon icon="notification" size="l" alt="Notifications" /> 123 - </Link> 124 - ); 125 - 126 110 return ( 127 111 <Timeline 128 112 title={title || 'Following'} ··· 132 116 fetchItems={fetchHome} 133 117 checkForUpdates={checkForUpdates} 134 118 useItemID 135 - headerStart={headerStart} 136 - headerEnd={headerEnd} 137 119 boostsCarousel={snapStates.settings.boostsCarousel} 120 + {...props} 138 121 /> 139 122 ); 140 123 }
+22 -1
src/pages/home.jsx
··· 1 1 import { useEffect } from 'preact/hooks'; 2 + import { useSnapshot } from 'valtio'; 2 3 3 4 import Icon from '../components/icon'; 5 + import Link from '../components/link'; 4 6 import db from '../utils/db'; 5 7 import openCompose from '../utils/open-compose'; 6 8 import states from '../utils/states'; ··· 9 11 import Following from './following'; 10 12 11 13 function Home() { 14 + const snapStates = useSnapshot(states); 12 15 useEffect(() => { 13 16 (async () => { 14 17 const keys = await db.drafts.keys(); ··· 24 27 25 28 return ( 26 29 <> 27 - <Following title="Home" path="/" id="home" headerStart={false} /> 30 + <Following 31 + title="Home" 32 + path="/" 33 + id="home" 34 + headerStart={false} 35 + headerEnd={ 36 + <Link 37 + to="/notifications" 38 + class={`button plain ${ 39 + snapStates.notificationsShowNew ? 'has-badge' : '' 40 + }`} 41 + onClick={(e) => { 42 + e.stopPropagation(); 43 + }} 44 + > 45 + <Icon icon="notification" size="l" alt="Notifications" /> 46 + </Link> 47 + } 48 + /> 28 49 <button 29 50 // hidden={scrollDirection === 'end' && !nearReachStart} 30 51 type="button"