chore(refactor): delete context/revoltjs folder

This commit is contained in:
Paul Makles
2022-07-06 13:08:03 +01:00
parent fa9b02c71b
commit de4d644743
30 changed files with 77 additions and 161 deletions

View File

@@ -4,9 +4,8 @@ import { Route, Switch, useHistory, useParams } from "react-router-dom";
import { Text } from "preact-i18n";
import { getChannelName } from "../../context/revoltjs/util";
import { useClient } from "../../controllers/client/ClientController";
import { ChannelName } from "../../controllers/client/jsx/ChannelName";
import { GenericSettings } from "./GenericSettings";
import Overview from "./channel/Overview";
import Permissions from "./channel/Permissions";
@@ -47,7 +46,7 @@ export default function ChannelSettings() {
<GenericSettings
pages={[
{
category: <div>{getChannelName(channel, true)}</div>,
category: <ChannelName channel={channel} prefix />,
id: "overview",
icon: <InfoCircle size={20} />,
title: (

View File

@@ -9,7 +9,7 @@ import { Button, Checkbox, InputBox } from "@revoltchat/ui";
import TextAreaAutoSize from "../../../lib/TextAreaAutoSize";
import { FileUploader } from "../../../context/revoltjs/FileUploads";
import { FileUploader } from "../../../controllers/client/jsx/legacy/FileUploads";
interface Props {
channel: Channel;

View File

@@ -23,8 +23,6 @@ import { internalEmit } from "../../../lib/eventEmitter";
import { useTranslation } from "../../../lib/i18n";
import { stopPropagation } from "../../../lib/stopPropagation";
import { FileUploader } from "../../../context/revoltjs/FileUploads";
import AutoComplete, {
useAutoComplete,
} from "../../../components/common/AutoComplete";
@@ -32,6 +30,7 @@ import CollapsibleSection from "../../../components/common/CollapsibleSection";
import Tooltip from "../../../components/common/Tooltip";
import UserIcon from "../../../components/common/user/UserIcon";
import { useClient } from "../../../controllers/client/ClientController";
import { FileUploader } from "../../../controllers/client/jsx/legacy/FileUploads";
import { modalController } from "../../../controllers/modals/ModalController";
interface Data {

View File

@@ -12,12 +12,11 @@ import { Button, LineDivider, Tip } from "@revoltchat/ui";
import TextAreaAutoSize from "../../../lib/TextAreaAutoSize";
import { useTranslation } from "../../../lib/i18n";
import { FileUploader } from "../../../context/revoltjs/FileUploads";
import AutoComplete, {
useAutoComplete,
} from "../../../components/common/AutoComplete";
import { useSession } from "../../../controllers/client/ClientController";
import { FileUploader } from "../../../controllers/client/jsx/legacy/FileUploads";
import { UserProfile } from "../../../controllers/modals/components/legacy/UserProfile";
export const Profile = observer(() => {

View File

@@ -9,10 +9,9 @@ import { useEffect, useState } from "preact/hooks";
import { IconButton, Preloader } from "@revoltchat/ui";
import { getChannelName } from "../../../context/revoltjs/util";
import UserIcon from "../../../components/common/user/UserIcon";
import { Username } from "../../../components/common/user/UserShort";
import { ChannelName } from "../../../controllers/client/jsx/ChannelName";
interface InnerProps {
invite: API.Invite;
@@ -33,7 +32,9 @@ const Inner = observer(({ invite, server, removeSelf }: InnerProps) => {
<UserIcon target={user} size={24} />{" "}
<Username user={user} showServerIdentity="both" />
</span>
<span>{channel ? getChannelName(channel, true) : "#??"}</span>
<span>
<ChannelName channel={channel} prefix />
</span>
<IconButton
onClick={() => {
setDelete(true);

View File

@@ -12,8 +12,8 @@ import { Button, ComboBox, InputBox } from "@revoltchat/ui";
import TextAreaAutoSize from "../../../lib/TextAreaAutoSize";
import { noop } from "../../../lib/js";
import { FileUploader } from "../../../context/revoltjs/FileUploads";
import { getChannelName } from "../../../context/revoltjs/util";
import { ChannelName } from "../../../controllers/client/jsx/ChannelName";
import { FileUploader } from "../../../controllers/client/jsx/legacy/FileUploads";
interface Props {
server: Server;
@@ -172,7 +172,7 @@ export const Overview = observer(({ server }: Props) => {
)
.map((channel) => (
<option key={channel!._id} value={channel!._id}>
{getChannelName(channel!, true)}
<ChannelName channel={channel} prefix />
</option>
))}
</ComboBox>