mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-04-28 08:10:36 +00:00
feat(@ui): migrate category / overline and header
This commit is contained in:
@@ -7,15 +7,15 @@ import styles from "./Prompt.module.scss";
|
||||
import { Text } from "preact-i18n";
|
||||
import { useContext, useEffect, useState } from "preact/hooks";
|
||||
|
||||
import { InputBox, Radio } from "@revoltchat/ui";
|
||||
import { Category, Error, InputBox, Radio } from "@revoltchat/ui";
|
||||
|
||||
import { TextReact } from "../../../lib/i18n";
|
||||
|
||||
import Message from "../../../components/common/messaging/Message";
|
||||
import UserIcon from "../../../components/common/user/UserIcon";
|
||||
import Modal, { Action } from "../../../components/ui/Modal";
|
||||
import Overline from "../../../components/ui/Overline";
|
||||
import { Children } from "../../../types/Preact";
|
||||
import { I18nError } from "../../Locale";
|
||||
import { AppContext } from "../../revoltjs/RevoltClient";
|
||||
import { takeError } from "../../revoltjs/util";
|
||||
import { useIntermediate } from "../Intermediate";
|
||||
@@ -44,7 +44,11 @@ export function PromptModal({
|
||||
actions={actions}
|
||||
onClose={onClose}
|
||||
disabled={disabled}>
|
||||
{error && <Overline error={error} type="error" />}
|
||||
{error && (
|
||||
<Category>
|
||||
<I18nError error={error} />
|
||||
</Category>
|
||||
)}
|
||||
{content}
|
||||
</Modal>
|
||||
);
|
||||
@@ -385,9 +389,9 @@ export const SpecialPromptModal = observer((props: SpecialProps) => {
|
||||
id="app.special.modals.prompt.confirm_ban"
|
||||
fields={{ name: props.user?.username }}
|
||||
/>
|
||||
<Overline>
|
||||
<Category>
|
||||
<Text id="app.special.modals.prompt.confirm_ban_reason" />
|
||||
</Overline>
|
||||
</Category>
|
||||
<InputBox
|
||||
value={reason ?? ""}
|
||||
onChange={(e) =>
|
||||
@@ -452,9 +456,9 @@ export const SpecialPromptModal = observer((props: SpecialProps) => {
|
||||
]}
|
||||
content={
|
||||
<>
|
||||
<Overline block type="subtle">
|
||||
<Category>
|
||||
<Text id="app.main.servers.channel_type" />
|
||||
</Overline>
|
||||
</Category>
|
||||
<Radio
|
||||
title={
|
||||
<Text id="app.main.servers.text_channel" />
|
||||
@@ -469,9 +473,9 @@ export const SpecialPromptModal = observer((props: SpecialProps) => {
|
||||
value={type === "Voice"}
|
||||
onSelect={() => setType("Voice")}
|
||||
/>
|
||||
<Overline block type="subtle">
|
||||
<Category>
|
||||
<Text id="app.main.servers.channel_name" />
|
||||
</Overline>
|
||||
</Category>
|
||||
<InputBox
|
||||
value={name}
|
||||
onChange={(e) => setName(e.currentTarget.value)}
|
||||
@@ -527,9 +531,9 @@ export const SpecialPromptModal = observer((props: SpecialProps) => {
|
||||
]}
|
||||
content={
|
||||
<>
|
||||
<Overline block type="subtle">
|
||||
<Category>
|
||||
<Text id="app.main.servers.category_name" />
|
||||
</Overline>
|
||||
</Category>
|
||||
<InputBox
|
||||
value={name}
|
||||
onChange={(e) => setName(e.currentTarget.value)}
|
||||
|
||||
Reference in New Issue
Block a user