Skip to content

Commit

Permalink
fix (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
Collection50 authored Aug 30, 2024
1 parent 2151ee7 commit 748ece3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Button, Icon } from '@/system/components';
import { Textarea } from '@/system/components/Textarea/Textarea';
import { useCallback, useState } from 'react';
import { KeyboardEvent, useCallback, useState } from 'react';
import Memo from './Memo/Memo';
import { cn } from '@/utils';
import { useMemosContext } from '../../fetcher/MemosFetcher';
Expand Down Expand Up @@ -28,6 +28,13 @@ export default function MemoContainer() {
}
}, [memo]);

const handleKeyDown = useCallback((e: KeyboardEvent) => {
if (e.key === 'Enter' && !e.shiftKey) {
e.preventDefault();
handlePostMemo();
}
}, []);

return (
<section className="min-w-400 h-screen border-1 bg-neutral-1">
<div className="flex items-end p-16 w-full h-109 gap-8">
Expand All @@ -51,6 +58,7 @@ export default function MemoContainer() {
onFocus={() => setTextareaHeight(TEXT_FOCUS_HEIGHT)}
onBlur={() => setTextareaHeight(TEXT_DEFAULT_HEIGHT)}
rows={1}
onKeyDown={handleKeyDown}
className={cn(
'resize-none min-h-0 bg-white border-none focus:outline-0 focus-visible:ring-0 focus-visible:ring-offset-0',
textareaHeight === TEXT_DEFAULT_HEIGHT && 'overflow-hidden',
Expand Down
2 changes: 1 addition & 1 deletion src/app/(sidebar)/write/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export default function Page({ params: { id } }: { params: { id: string } }) {

<TagSelector
disabled={selectedTags.length === 3}
classNames={{ base: 'px-80', content: 'h-264', trigger: 'hover:bg-neutral-1' }}>
classNames={{ base: 'px-80', trigger: 'hover:bg-neutral-1' }}>
<TagSelector.Title>태그</TagSelector.Title>

<TagSelector.Trigger>
Expand Down

0 comments on commit 748ece3

Please sign in to comment.