chore: turn emoji picker into an experiment

This commit is contained in:
Paul Makles 2022-07-01 19:32:27 +01:00
parent e4b61819d3
commit 6e70937825
3 changed files with 28 additions and 24 deletions

View file

@ -658,11 +658,13 @@ export default observer(({ channel }: Props) => {
<Box size={24} /> <Box size={24} />
</IconButton> </IconButton>
</Action>*/} </Action>*/}
<Action> {state.experiments.isEnabled("picker") && (
<IconButton onClick={() => setPicker(!picker)}> <Action>
<HappyBeaming size={24} /> <IconButton onClick={() => setPicker(!picker)}>
</IconButton> <HappyBeaming size={24} />
</Action> </IconButton>
</Action>
)}
<Action> <Action>
<IconButton <IconButton
className={ className={

View file

@ -22,6 +22,7 @@ import { useIntermediate } from "../Intermediate";
interface Props { interface Props {
onClose: () => void; onClose: () => void;
question: Children; question: Children;
description?: Children;
content?: Children; content?: Children;
disabled?: boolean; disabled?: boolean;
actions: Action[]; actions: Action[];
@ -31,6 +32,7 @@ interface Props {
export function PromptModal({ export function PromptModal({
onClose, onClose,
question, question,
description,
content, content,
actions, actions,
disabled, disabled,
@ -39,6 +41,7 @@ export function PromptModal({
return ( return (
<Modal <Modal
title={question} title={question}
description={description}
actions={actions} actions={actions}
onClose={onClose} onClose={onClose}
disabled={disabled}> disabled={disabled}>
@ -133,6 +136,12 @@ export const SpecialPromptModal = observer((props: SpecialProps) => {
fields={{ name }} fields={{ name }}
/> />
} }
description={
<TextReact
id={`app.special.modals.prompt.${event[0]}_long`}
fields={{ name: <b>{name}</b> }}
/>
}
actions={[ actions={[
{ {
confirmation: true, confirmation: true,
@ -183,12 +192,6 @@ export const SpecialPromptModal = observer((props: SpecialProps) => {
onClick: onClose, onClick: onClose,
}, },
]} ]}
content={
<TextReact
id={`app.special.modals.prompt.${event[0]}_long`}
fields={{ name: <b>{name}</b> }}
/>
}
disabled={processing} disabled={processing}
error={error} error={error}
/> />
@ -199,6 +202,11 @@ export const SpecialPromptModal = observer((props: SpecialProps) => {
<PromptModal <PromptModal
onClose={onClose} onClose={onClose}
question={<Text id={"app.context_menu.delete_message"} />} question={<Text id={"app.context_menu.delete_message"} />}
description={
<Text
id={`app.special.modals.prompt.confirm_delete_message_long`}
/>
}
actions={[ actions={[
{ {
confirmation: true, confirmation: true,
@ -228,18 +236,7 @@ export const SpecialPromptModal = observer((props: SpecialProps) => {
}, },
]} ]}
content={ content={
<> <Message message={props.target} head={true} contrast />
<h5>
<Text
id={`app.special.modals.prompt.confirm_delete_message_long`}
/>
</h5>
<Message
message={props.target}
head={true}
contrast
/>
</>
} }
disabled={processing} disabled={processing}
error={error} error={error}

View file

@ -10,7 +10,7 @@ import Store from "../interfaces/Store";
/** /**
* Union type of available experiments. * Union type of available experiments.
*/ */
export type Experiment = "dummy" | "offline_users" | "plugins"; export type Experiment = "dummy" | "offline_users" | "plugins" | "picker";
/** /**
* Currently active experiments. * Currently active experiments.
@ -19,6 +19,7 @@ export const AVAILABLE_EXPERIMENTS: Experiment[] = [
"dummy", "dummy",
"offline_users", "offline_users",
"plugins", "plugins",
"picker",
]; ];
/** /**
@ -41,6 +42,10 @@ export const EXPERIMENTS: {
description: description:
"This will enable the experimental plugin API. Only touch this if you know what you're doing.", "This will enable the experimental plugin API. Only touch this if you know what you're doing.",
}, },
picker: {
title: "Emoji Picker",
description: "This will enable a work-in-progress emoji picker.",
},
}; };
export interface Data { export interface Data {