File tree Expand file tree Collapse file tree 5 files changed +15
-7
lines changed
browser-extension/src/lib/enhancers/github Expand file tree Collapse file tree 5 files changed +15
-7
lines changed Original file line number Diff line number Diff line change 1+ import type { Options } from 'overtype'
2+
3+ export const commonGithubOptions : Options = {
4+ autoResize : true ,
5+ lineHeight : 'var(--text-body-lineHeight-medium, 1.4285)' ,
6+ padding : 'var(--base-size-16)' ,
7+ }
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import OverType, { type OverTypeInstance } from 'overtype'
22import type { CommentEnhancer , CommentSpot } from '../../enhancer'
33import { logger } from '../../logger'
44import { modifyDOM } from '../modifyDOM'
5+ import { commonGithubOptions } from './ghOptions'
56import { githubHighlighter } from './githubHighlighter'
67
78interface GitHubIssueAddCommentSpot extends CommentSpot {
@@ -47,9 +48,8 @@ export class GitHubIssueAddCommentEnhancer implements CommentEnhancer<GitHubIssu
4748 enhance ( textArea : HTMLTextAreaElement , _spot : GitHubIssueAddCommentSpot ) : OverTypeInstance {
4849 const overtypeContainer = modifyDOM ( textArea )
4950 return new OverType ( overtypeContainer , {
50- autoResize : true ,
51+ ... commonGithubOptions ,
5152 minHeight : '100px' ,
52- padding : 'var(--base-size-16)' ,
5353 placeholder : 'Use Markdown to format your comment' ,
5454 } ) [ 0 ] !
5555 }
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import OverType, { type OverTypeInstance } from 'overtype'
22import type { CommentEnhancer , CommentSpot } from '../../enhancer'
33import { logger } from '../../logger'
44import { modifyDOM } from '../modifyDOM'
5+ import { commonGithubOptions } from './ghOptions'
56import { githubHighlighter } from './githubHighlighter'
67
78interface GitHubIssueNewCommentSpot extends CommentSpot {
@@ -45,9 +46,8 @@ export class GitHubIssueNewCommentEnhancer implements CommentEnhancer<GitHubIssu
4546 enhance ( textArea : HTMLTextAreaElement , _spot : GitHubIssueNewCommentSpot ) : OverTypeInstance {
4647 const overtypeContainer = modifyDOM ( textArea )
4748 return new OverType ( overtypeContainer , {
48- autoResize : true ,
49+ ... commonGithubOptions ,
4950 minHeight : '400px' ,
50- padding : 'var(--base-size-16)' ,
5151 placeholder : 'Type your description here...' ,
5252 } ) [ 0 ] !
5353 }
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import OverType, { type OverTypeInstance } from 'overtype'
22import type { CommentEnhancer , CommentSpot } from '../../enhancer'
33import { logger } from '../../logger'
44import { modifyDOM } from '../modifyDOM'
5+ import { commonGithubOptions } from './ghOptions'
56import { githubHighlighter } from './githubHighlighter'
67
78interface GitHubPRAddCommentSpot extends CommentSpot {
@@ -51,7 +52,7 @@ export class GitHubPRAddCommentEnhancer implements CommentEnhancer<GitHubPRAddCo
5152 enhance ( textArea : HTMLTextAreaElement , _spot : GitHubPRAddCommentSpot ) : OverTypeInstance {
5253 const overtypeContainer = modifyDOM ( textArea )
5354 return new OverType ( overtypeContainer , {
54- autoResize : true ,
55+ ... commonGithubOptions ,
5556 minHeight : '102px' ,
5657 padding : 'var(--base-size-8)' ,
5758 placeholder : 'Add your comment here...' ,
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import OverType, { type OverTypeInstance } from 'overtype'
22import type { CommentEnhancer , CommentSpot } from '../../enhancer'
33import { logger } from '../../logger'
44import { modifyDOM } from '../modifyDOM'
5+ import { commonGithubOptions } from './ghOptions'
56import { githubHighlighter } from './githubHighlighter'
67
78interface GitHubPRNewCommentSpot extends CommentSpot {
@@ -50,9 +51,8 @@ export class GitHubPRNewCommentEnhancer implements CommentEnhancer<GitHubPRNewCo
5051 enhance ( textArea : HTMLTextAreaElement , _spot : GitHubPRNewCommentSpot ) : OverTypeInstance {
5152 const overtypeContainer = modifyDOM ( textArea )
5253 return new OverType ( overtypeContainer , {
53- autoResize : true ,
54+ ... commonGithubOptions ,
5455 minHeight : '250px' ,
55- padding : 'var(--base-size-16)' ,
5656 placeholder : 'Type your description here...' ,
5757 } ) [ 0 ] !
5858 }
You can’t perform that action at this time.
0 commit comments