-
-
- {activities?.length < 1 ? (
-
-
🎉
-
- Yo!, no new activities around you in the last 24 hours
-
+
+ {!activities ? (
+
+
- ) : (
- activities.map((event) => renderItem(event))
- )}
-
+
+ ) : activities.length < 1 ? (
+
+
🎉
+
+ Yo!, no new activities around you in the last 24 hours
+
+
+ ) : (
+ activities.map((event) => renderItem(event))
+ )}
diff --git a/src/app/space/index.tsx b/src/app/space/index.tsx
index b3de3e62..927f23d6 100644
--- a/src/app/space/index.tsx
+++ b/src/app/space/index.tsx
@@ -21,6 +21,7 @@ import {
XfeedsWidget,
XhashtagWidget,
} from '@shared/widgets';
+import { LocalFollowsWidget } from '@shared/widgets/local/follows';
import { WidgetKinds, useWidgets } from '@stores/widgets';
@@ -40,6 +41,8 @@ export function SpaceScreen() {
switch (widget.kind) {
case WidgetKinds.local.network:
return
;
+ case WidgetKinds.local.follows:
+ return
;
case WidgetKinds.local.feeds:
return
;
case WidgetKinds.local.files:
diff --git a/src/app/splash.tsx b/src/app/splash.tsx
index 46be95fe..c1b76ff2 100644
--- a/src/app/splash.tsx
+++ b/src/app/splash.tsx
@@ -7,17 +7,14 @@ import { useStorage } from '@libs/storage/provider';
import { LoaderIcon } from '@shared/icons';
-import { useActivities } from '@stores/activities';
-
import { useNostr } from '@utils/hooks/useNostr';
export function SplashScreen() {
const { db } = useStorage();
const { ndk } = useNDK();
- const { fetchUserData, fetchActivities, prefetchEvents } = useNostr();
+ const { fetchUserData, prefetchEvents } = useNostr();
const [isLoading, setIsLoading] = useState
(true);
- const setActivities = useActivities((state) => state.setActivities);
const skip = async () => {
await invoke('close_splashscreen');
@@ -27,11 +24,8 @@ export function SplashScreen() {
try {
const user = await fetchUserData();
const data = await prefetchEvents();
- const activities = await fetchActivities();
if (user.status === 'ok' && data.status === 'ok') {
- // set activities
- setActivities(activities);
// update last login = current time
await db.updateLastLogin();
// close splash screen and open main app screen
diff --git a/src/shared/navigation.tsx b/src/shared/navigation.tsx
index 8dd7e886..0f0bfb30 100644
--- a/src/shared/navigation.tsx
+++ b/src/shared/navigation.tsx
@@ -11,10 +11,15 @@ import { ComposerModal } from '@shared/composer';
import { Frame } from '@shared/frame';
import { BellIcon, NavArrowDownIcon, SpaceIcon } from '@shared/icons';
+import { useActivities } from '@stores/activities';
import { useSidebar } from '@stores/sidebar';
+import { compactNumber } from '@utils/number';
+
export function Navigation() {
const { db } = useStorage();
+
+ const [totalNewActivities] = useActivities((state) => [state.totalNewActivities]);
const [chats, toggleChats] = useSidebar((state) => [state.chats, state.toggleChats]);
return (
@@ -47,17 +52,26 @@ export function Navigation() {
preventScrollReset={true}
className={({ isActive }) =>
twMerge(
- 'flex h-10 items-center gap-2.5 rounded-r-lg border-l-2 pl-4 pr-2',
+ 'flex h-10 items-center justify-between rounded-r-lg border-l-2 pl-4 pr-2',
isActive
? 'border-fuchsia-500 bg-white/5 text-white'
: 'border-transparent text-white/80'
)
}
>
-
-
-
- Notifications
+
+
+
+
+ Notifications
+
+ {totalNewActivities > 0 ? (
+
+
+ {compactNumber.format(totalNewActivities)}
+
+
+ ) : null}