Skip to content

Commit

Permalink
cleanup imports
Browse files Browse the repository at this point in the history
  • Loading branch information
hzrd149 committed Oct 16, 2023
1 parent c5b90c1 commit c7124b4
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 28 deletions.
28 changes: 14 additions & 14 deletions src/app.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Suspense } from "react";
import { lazy, Suspense } from "react";
import { createHashRouter, Outlet, RouterProvider, ScrollRestoration } from "react-router-dom";
import { Spinner } from "@chakra-ui/react";
import { css, Global } from "@emotion/react";
Expand All @@ -19,7 +19,8 @@ import NotificationsView from "./views/notifications";
import DirectMessagesView from "./views/messages";
import DirectMessageChatView from "./views/messages/chat";

import LoginView from "./views/signin";
import SigninView from "./views/signin";
import SignupView from "./views/signup";
import LoginStartView from "./views/signin/start";
import LoginNpubView from "./views/signin/npub";
import LoginNip05View from "./views/signin/nip05";
Expand Down Expand Up @@ -66,20 +67,19 @@ import RelaysView from "./views/relays";
import RelayView from "./views/relays/relay";
import RelayReviewsView from "./views/relays/reviews";
import PopularRelaysView from "./views/relays/popular";
import UserTracksTab from "./views/user/tracks";
import SignupView from "./views/signup";
const UserTracksTab = lazy(() => import("./views/user/tracks"));

const ToolsHomeView = React.lazy(() => import("./views/tools"));
const NetworkView = React.lazy(() => import("./views/tools/network"));
const StreamModerationView = React.lazy(() => import("./views/tools/stream-moderation"));
const NetworkGraphView = React.lazy(() => import("./views/tools/network-mute-graph"));
const ToolsHomeView = lazy(() => import("./views/tools"));
const NetworkView = lazy(() => import("./views/tools/network"));
const StreamModerationView = lazy(() => import("./views/tools/stream-moderation"));
const NetworkGraphView = lazy(() => import("./views/tools/network-mute-graph"));

const UserStreamsTab = React.lazy(() => import("./views/user/streams"));
const StreamsView = React.lazy(() => import("./views/streams"));
const StreamView = React.lazy(() => import("./views/streams/stream"));
const UserStreamsTab = lazy(() => import("./views/user/streams"));
const StreamsView = lazy(() => import("./views/streams"));
const StreamView = lazy(() => import("./views/streams/stream"));

const SearchView = React.lazy(() => import("./views/search"));
const MapView = React.lazy(() => import("./views/map"));
const SearchView = lazy(() => import("./views/search"));
const MapView = lazy(() => import("./views/map"));

const overrideReactTextareaAutocompleteStyles = css`
.rta__autocomplete {
Expand Down Expand Up @@ -124,7 +124,7 @@ const RootPage = () => {
const router = createHashRouter([
{
path: "signin",
element: <LoginView />,
element: <SigninView />,
children: [
{ path: "", element: <LoginStartView /> },
{ path: "npub", element: <LoginNpubView /> },
Expand Down
18 changes: 10 additions & 8 deletions src/components/embed-event/index.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
import { lazy } from "react";
import type { DecodeResult } from "nostr-tools/lib/nip19";
import { CardProps } from "@chakra-ui/react";
import { Kind, nip19 } from "nostr-tools";

import EmbeddedNote from "./event-types/embedded-note";
import useSingleEvent from "../../hooks/use-single-event";
import { NoteLink } from "../note-link";
import { NostrEvent } from "../../types/nostr-event";
import { Kind, nip19 } from "nostr-tools";
import useReplaceableEvent from "../../hooks/use-replaceable-event";
import RelayCard from "../../views/relays/components/relay-card";
import { STREAM_CHAT_MESSAGE_KIND, STREAM_KIND } from "../../helpers/nostr/stream";
import { GOAL_KIND } from "../../helpers/nostr/goal";
import { EMOJI_PACK_KIND } from "../../helpers/nostr/emoji-packs";
import { NOTE_LIST_KIND, PEOPLE_LIST_KIND } from "../../helpers/nostr/lists";
import { COMMUNITY_DEFINITION_KIND } from "../../helpers/nostr/communities";
import { STEMSTR_TRACK_KIND } from "../../helpers/nostr/stemstr";
import useReplaceableEvent from "../../hooks/use-replaceable-event";
import { safeDecode } from "../../helpers/nip19";

import RelayCard from "../../views/relays/components/relay-card";
import EmbeddedStream from "./event-types/embedded-stream";
import { EMOJI_PACK_KIND } from "../../helpers/nostr/emoji-packs";
import EmbeddedEmojiPack from "./event-types/embedded-emoji-pack";
import EmbeddedGoal, { EmbeddedGoalOptions } from "./event-types/embedded-goal";
import EmbeddedUnknown from "./event-types/embedded-unknown";
import { NOTE_LIST_KIND, PEOPLE_LIST_KIND } from "../../helpers/nostr/lists";
import EmbeddedList from "./event-types/embedded-list";
import EmbeddedArticle from "./event-types/embedded-article";
import EmbeddedBadge from "./event-types/embedded-badge";
import EmbeddedStreamMessage from "./event-types/embedded-stream-message";
import { COMMUNITY_DEFINITION_KIND } from "../../helpers/nostr/communities";
import EmbeddedCommunity from "./event-types/embedded-community";
import { STEMSTR_TRACK_KIND } from "../../helpers/nostr/stemstr";
import EmbeddedStemstrTrack from "./event-types/embedded-stemstr-track";
const EmbeddedStemstrTrack = lazy(() => import("./event-types/embedded-stemstr-track"));

export type EmbedProps = {
goalProps?: EmbeddedGoalOptions;
Expand Down
9 changes: 3 additions & 6 deletions src/views/user/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Suspense, useState } from "react";
import {
Flex,
FormControl,
Expand All @@ -24,26 +25,22 @@ import {
Tabs,
useDisclosure,
} from "@chakra-ui/react";
import { nip19 } from "nostr-tools";

import { Outlet, useMatches, useNavigate, useParams } from "react-router-dom";
import { useUserMetadata } from "../../hooks/use-user-metadata";
import { getUserDisplayName } from "../../helpers/user-metadata";
import { isHexKey } from "../../helpers/nip19";
import { useAppTitle } from "../../hooks/use-app-title";
import { Suspense, useMemo, useState } from "react";
import { useReadRelayUrls } from "../../hooks/use-client-relays";
import relayScoreboardService from "../../services/relay-scoreboard";
import { RelayMode } from "../../classes/relay";
import { AdditionalRelayProvider } from "../../providers/additional-relay-context";
import { Kind, nip19 } from "nostr-tools";
import { unique } from "../../helpers/array";
import { RelayFavicon } from "../../components/relay-favicon";
import { useUserRelays } from "../../hooks/use-user-relays";
import Header from "./components/header";
import { ErrorBoundary } from "../../components/error-boundary";
import useUserEventKindCount from "../../hooks/use-user-event-kind-count";
import { STREAM_KIND } from "../../helpers/nostr/stream";
import { GOAL_KIND } from "../../helpers/nostr/goal";
import { useMeasure } from "react-use";

const tabs = [
{ label: "About", path: "about" },
Expand Down

0 comments on commit c7124b4

Please sign in to comment.