Skip to content
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

Fix/feat: Reply comments appearing in all comments #98

Merged
merged 19 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"video.js": "^8.6.1",
"videojs-contrib-eme": "^3.11.1",
"videojs-mobile-ui": "^1.1.1",
"videojs-seek-buttons": "^4.0.3",
"videojs-sprite-thumbnails": "^2.1.1",
"zod": "^3.22.4"
},
Expand Down
272 changes: 13 additions & 259 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions src/actions/comment/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const getComments = async (
const parseIntroComment = (
comment: string,
): Array<{ start: number; end?: number; title: string }> | null => {
const introPattern = /^intro:\s*([\s\S]*)$/;
const introPattern = /^intro:\s*([\s\S]*)$/i;
const match = comment.match(introPattern);
if (!match) return [];

Expand Down Expand Up @@ -155,7 +155,11 @@ const createCommentHandler = async (
let introData:
| { start: number; end?: number | undefined; title: string }[]
| null = [];
if (data.content.startsWith('intro:')) {
if (
data.content.startsWith('intro:') ||
data.content.startsWith('Intro:') ||
data.content.startsWith('INTRO:')
) {
introData = parseIntroComment(data.content);
if (
!introData ||
Expand Down
1 change: 1 addition & 0 deletions src/actions/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export interface QueryParams {
userId?: number;
commentId?: number;
timestamp?: number;
editCommentId?: number;
}
export enum CommentFilter {
md = 'Most downvotes',
Expand Down
7 changes: 7 additions & 0 deletions src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,10 @@
.video-js .vjs-progress-control:hover .vjs-play-progress:after {
display: none;
}
.vjs-quality-selector .vjs-custom-dropup-menu {
bottom: 100%;
left: 50%;
transform: translateX(-50%);

}

Loading
Loading