This commit is contained in:
2023-11-30 17:24:07 +07:00
parent 80f675cb54
commit 5318f6c4cb
31 changed files with 71 additions and 99 deletions

View File

@@ -11,18 +11,12 @@ import { useProfile } from '@utils/hooks/useProfile';
export function ActiveAccount() {
const { db } = useStorage();
const { status, user } = useProfile(db.account.pubkey);
const { user } = useProfile(db.account.pubkey);
const svgURI =
'data:image/svg+xml;utf8,' +
encodeURIComponent(minidenticon(db.account.pubkey, 90, 50));
if (status === 'pending') {
return (
<div className="aspect-square h-auto w-full animate-pulse rounded-lg bg-neutral-300 dark:bg-neutral-700" />
);
}
return (
<div className="flex flex-col gap-1 rounded-lg bg-neutral-100 p-1 ring-1 ring-transparent hover:bg-neutral-200 hover:ring-blue-500 dark:bg-neutral-900 dark:hover:bg-neutral-800">
<Link to="/settings/" className="relative inline-block">

View File

@@ -7,8 +7,7 @@ import { NoteReaction } from '@shared/notes/actions/reaction';
import { NoteRepost } from '@shared/notes/actions/repost';
import { NoteZap } from '@shared/notes/actions/zap';
import { WIDGET_KIND } from '@stores/constants';
import { WIDGET_KIND } from '@utils/constants';
import { useWidget } from '@utils/hooks/useWidget';
export function NoteActions({

View File

@@ -1,5 +1,4 @@
import { WIDGET_KIND } from '@stores/constants';
import { WIDGET_KIND } from '@utils/constants';
import { useWidget } from '@utils/hooks/useWidget';
export function Hashtag({ tag }: { tag: string }) {

View File

@@ -9,8 +9,7 @@ import {
} from '@shared/notes';
import { User } from '@shared/user';
import { WIDGET_KIND } from '@stores/constants';
import { WIDGET_KIND } from '@utils/constants';
import { useEvent } from '@utils/hooks/useEvent';
import { useWidget } from '@utils/hooks/useWidget';

View File

@@ -1,7 +1,6 @@
import { memo } from 'react';
import { WIDGET_KIND } from '@stores/constants';
import { WIDGET_KIND } from '@utils/constants';
import { useProfile } from '@utils/hooks/useProfile';
import { useWidget } from '@utils/hooks/useWidget';

View File

@@ -5,8 +5,7 @@ import { ReplyIcon, RepostIcon } from '@shared/icons';
import { ChildNote, TextKind } from '@shared/notes';
import { User } from '@shared/user';
import { WIDGET_KIND } from '@stores/constants';
import { WIDGET_KIND } from '@utils/constants';
import { formatCreatedAt } from '@utils/createdAt';
import { useNostr } from '@utils/hooks/useNostr';
import { useWidget } from '@utils/hooks/useWidget';

View File

@@ -4,8 +4,7 @@ import { memo } from 'react';
import { ChildNote, NoteActions } from '@shared/notes';
import { User } from '@shared/user';
import { WIDGET_KIND } from '@stores/constants';
import { WIDGET_KIND } from '@utils/constants';
import { useNostr } from '@utils/hooks/useNostr';
import { useRichContent } from '@utils/hooks/useRichContent';
import { useWidget } from '@utils/hooks/useWidget';

View File

@@ -12,8 +12,7 @@ import { MemoizedArticleNote } from '@shared/notes';
import { TitleBar } from '@shared/titleBar';
import { WidgetWrapper } from '@shared/widgets';
import { FETCH_LIMIT } from '@stores/constants';
import { FETCH_LIMIT } from '@utils/constants';
import { Widget } from '@utils/types';
export function ArticleWidget({ widget }: { widget: Widget }) {

View File

@@ -12,8 +12,7 @@ import { MemoizedFileNote } from '@shared/notes';
import { TitleBar } from '@shared/titleBar';
import { WidgetWrapper } from '@shared/widgets';
import { FETCH_LIMIT } from '@stores/constants';
import { FETCH_LIMIT } from '@utils/constants';
import { Widget } from '@utils/types';
export function FileWidget({ widget }: { widget: Widget }) {

View File

@@ -15,8 +15,7 @@ import {
import { TitleBar } from '@shared/titleBar';
import { WidgetWrapper } from '@shared/widgets';
import { FETCH_LIMIT } from '@stores/constants';
import { FETCH_LIMIT } from '@utils/constants';
import { Widget } from '@utils/types';
export function GroupWidget({ widget }: { widget: Widget }) {

View File

@@ -10,8 +10,7 @@ import { MemoizedRepost, MemoizedTextNote, UnknownNote } from '@shared/notes';
import { TitleBar } from '@shared/titleBar';
import { WidgetWrapper } from '@shared/widgets';
import { FETCH_LIMIT } from '@stores/constants';
import { FETCH_LIMIT } from '@utils/constants';
import { Widget } from '@utils/types';
export function HashtagWidget({ widget }: { widget: Widget }) {

View File

@@ -16,7 +16,7 @@ import {
import { TitleBar } from '@shared/titleBar';
import { LiveUpdater, WidgetWrapper } from '@shared/widgets';
import { FETCH_LIMIT } from '@stores/constants';
import { FETCH_LIMIT } from '@utils/constants';
export function NewsfeedWidget() {
const { db } = useStorage();

View File

@@ -11,8 +11,7 @@ import { MemoizedNotifyNote, NoteSkeleton } from '@shared/notes';
import { TitleBar } from '@shared/titleBar';
import { WidgetWrapper } from '@shared/widgets';
import { FETCH_LIMIT } from '@stores/constants';
import { FETCH_LIMIT } from '@utils/constants';
import { useNostr } from '@utils/hooks/useNostr';
import { sendNativeNotification } from '@utils/notification';

View File

@@ -12,8 +12,7 @@ import {
} from '@shared/icons';
import { User } from '@shared/user';
import { WIDGET_KIND } from '@stores/constants';
import { WIDGET_KIND } from '@utils/constants';
import { useWidget } from '@utils/hooks/useWidget';
export function AddGroupFeeds({ currentWidgetId }: { currentWidgetId: string }) {

View File

@@ -3,8 +3,7 @@ import { Resolver, useForm } from 'react-hook-form';
import { CancelIcon, GroupFeedsIcon, PlusIcon } from '@shared/icons';
import { HASHTAGS, WIDGET_KIND } from '@stores/constants';
import { HASHTAGS, WIDGET_KIND } from '@utils/constants';
import { useWidget } from '@utils/hooks/useWidget';
type FormValues = {

View File

@@ -1,8 +1,7 @@
import { PlusIcon } from '@shared/icons';
import { WidgetWrapper } from '@shared/widgets';
import { WIDGET_KIND } from '@stores/constants';
import { WIDGET_KIND } from '@utils/constants';
import { useWidget } from '@utils/hooks/useWidget';
export function ToggleWidgetList() {

View File

@@ -2,8 +2,7 @@ import { ArticleIcon, MediaIcon, PlusIcon } from '@shared/icons';
import { TitleBar } from '@shared/titleBar';
import { AddGroupFeeds, AddHashtagFeeds, WidgetWrapper } from '@shared/widgets';
import { TOPICS, WIDGET_KIND } from '@stores/constants';
import { TOPICS, WIDGET_KIND } from '@utils/constants';
import { useWidget } from '@utils/hooks/useWidget';
import { Widget } from '@utils/types';

View File

@@ -16,8 +16,7 @@ import {
import { TitleBar } from '@shared/titleBar';
import { WidgetWrapper } from '@shared/widgets';
import { FETCH_LIMIT } from '@stores/constants';
import { FETCH_LIMIT } from '@utils/constants';
import { Widget } from '@utils/types';
export function TopicWidget({ widget }: { widget: Widget }) {