mirror of
https://github.com/aykhans/slash-e.git
synced 2025-07-07 05:32:35 +00:00
feat: add title field to shortcut
This commit is contained in:
@ -27,6 +27,7 @@ const CreateShortcutDialog: React.FC<Props> = (props: Props) => {
|
||||
shortcutCreate: {
|
||||
name: "",
|
||||
link: "",
|
||||
title: "",
|
||||
description: "",
|
||||
visibility: "PRIVATE",
|
||||
tags: [],
|
||||
@ -85,6 +86,14 @@ const CreateShortcutDialog: React.FC<Props> = (props: Props) => {
|
||||
});
|
||||
};
|
||||
|
||||
const handleTitleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
setPartialState({
|
||||
shortcutCreate: Object.assign(state.shortcutCreate, {
|
||||
title: e.target.value,
|
||||
}),
|
||||
});
|
||||
};
|
||||
|
||||
const handleVisibilityInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
setPartialState({
|
||||
shortcutCreate: Object.assign(state.shortcutCreate, {
|
||||
@ -184,6 +193,18 @@ const CreateShortcutDialog: React.FC<Props> = (props: Props) => {
|
||||
</Button>
|
||||
</div>
|
||||
<div className="overflow-y-auto overflow-x-hidden">
|
||||
<div className="w-full flex flex-col justify-start items-start mb-3">
|
||||
<span className="mb-2">Title</span>
|
||||
<div className="relative w-full">
|
||||
<Input
|
||||
className="w-full"
|
||||
type="text"
|
||||
placeholder="Title"
|
||||
value={state.shortcutCreate.title}
|
||||
onChange={handleTitleInputChange}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="w-full flex flex-col justify-start items-start mb-3">
|
||||
<span className="mb-2">Name</span>
|
||||
<div className="relative w-full">
|
||||
|
3
web/src/types/modules/shortcut.d.ts
vendored
3
web/src/types/modules/shortcut.d.ts
vendored
@ -19,6 +19,7 @@ interface Shortcut {
|
||||
|
||||
name: string;
|
||||
link: string;
|
||||
title: string;
|
||||
description: string;
|
||||
visibility: Visibility;
|
||||
tags: string[];
|
||||
@ -29,6 +30,7 @@ interface Shortcut {
|
||||
interface ShortcutCreate {
|
||||
name: string;
|
||||
link: string;
|
||||
title: string;
|
||||
description: string;
|
||||
visibility: Visibility;
|
||||
tags: string[];
|
||||
@ -40,6 +42,7 @@ interface ShortcutPatch {
|
||||
|
||||
name?: string;
|
||||
link?: string;
|
||||
title?: string;
|
||||
description?: string;
|
||||
visibility?: Visibility;
|
||||
tags?: string[];
|
||||
|
Reference in New Issue
Block a user