-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scratch Comments Feature #1230
base: main
Are you sure you want to change the base?
Scratch Comments Feature #1230
Conversation
* Added refined textarea * Added delete and edit comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm liking this so far, just some comments
@@ -0,0 +1,78 @@ | |||
.holder { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New code should use Tailwind where possible rather than SCSS modules
overflow: hidden; | ||
resize: none; | ||
|
||
&::-webkit-input-placeholder { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is outdated https://caniuse.com/css-placeholder
} | ||
} | ||
|
||
function EditComment({ comment, stopEditing, submit }: { comment: any, stopEditing: () => void, submit: (text: string) => Promise<unknown> }) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unknown!?
Also split this signature onto multiple lines
await api.delete_(commentUrl(comment), {}) | ||
alert("Comment deleted") | ||
} catch (e) { | ||
alert(`Error Deleting Comment: ${e}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO this should be a dialog or a toast or something
<div className={styles.counter}>{text.length} / {maxTextLength}</div> | ||
</div> | ||
</section> | ||
<br /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
} | ||
|
||
return ( | ||
<div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally this would be more semantic, like a form, and editing would submit the form
Feedback is welcome
Features
Tests
Comment
Most recent example
Screencast.from.2024-05-16.00-03-08.webm
fixes #128