diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/components/upload/SourceInput.tsx | 14 | ||||
| -rw-r--r-- | src/components/upload/TagsInput.tsx | 18 | ||||
| -rw-r--r-- | src/components/upload/TagsList.tsx | 4 |
3 files changed, 25 insertions, 11 deletions
diff --git a/src/components/upload/SourceInput.tsx b/src/components/upload/SourceInput.tsx index c93c4b6..a80092a 100644 --- a/src/components/upload/SourceInput.tsx +++ b/src/components/upload/SourceInput.tsx @@ -1,17 +1,21 @@ 'use client'; import { Input } from '@/components/ui'; +import React from 'react'; export function SourceInput() { + const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => { + if (e.key === 'Enter') { + e.preventDefault(); + } + }; + return ( <div className="flex flex-col gap-2.5 w-full"> <span>ИСТОЧНИК</span> <Input + placeholder="Введите источник" name="source" - onKeyDown={(e) => { - if (e.key === 'Enter') { - e.preventDefault(); - } - }} + onKeyDown={handleKeyDown} className="w-full h-10 py-2.5 px-5 border rounded-4xl" type="text" /> diff --git a/src/components/upload/TagsInput.tsx b/src/components/upload/TagsInput.tsx index 4dcc595..891d428 100644 --- a/src/components/upload/TagsInput.tsx +++ b/src/components/upload/TagsInput.tsx @@ -50,7 +50,8 @@ export function TagsInput() { }} inputFieldPosition="inline" classNames={{ - tagInputField: 'outline-none text-light-violet', + tagInputField: + 'outline-none text-white placeholder:text-light-violet', tag: 'bg-violet px-2.5 py-0 h-[29px] flex gap-1.25 rounded-[10px] w-fit items-center', selected: 'flex gap-2.5 flex-wrap items-center', }} @@ -61,17 +62,22 @@ export function TagsInput() { ); } -class RemoveTag extends React.Component { +type RemoveTagProps = { + className?: string; + onRemove: () => void; +}; + +class RemoveTag extends React.Component<RemoveTagProps> { render(): React.ReactNode { - // @ts-expect-error ... const { className, onRemove } = this.props; + return ( <Button - variant={'ghost'} - size={'text'} + variant="ghost" + size="text" onClick={onRemove} className={className} - onFocus={(e) => { + onFocus={() => { document.getElementById('tags-input')?.focus(); }} > diff --git a/src/components/upload/TagsList.tsx b/src/components/upload/TagsList.tsx new file mode 100644 index 0000000..11831cb --- /dev/null +++ b/src/components/upload/TagsList.tsx @@ -0,0 +1,4 @@ +export function TagsList() { + return; + <></>; +} |
