This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| interface CommentProps { | |
| comment: CommentModel, | |
| onReplyCreated: (reply: CommentModel) => void, | |
| onCommentUpdated: (updatedComment: CommentModel) => void, | |
| onCommentDeleted: (comment: CommentModel) => void, | |
| } | |
| export default function Comment({ comment, onReplyCreated, onCommentUpdated, onCommentDeleted }: CommentProps) { | |
| const { user } = useAuthenticatedUser(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| interface AuthModalsContext { | |
| showLoginModal: () => void, | |
| showSignUpModal: () => void, | |
| showResetPasswordModal: () => void, | |
| } | |
| export const AuthModalsContext = createContext<AuthModalsContext>({ | |
| showLoginModal: () => { throw new Error("AuthModalContext not implemented") }, | |
| showSignUpModal: () => { throw new Error("AuthModalContext not implemented") }, | |
| showResetPasswordModal: () => { throw new Error("AuthModalContext not implemented") }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| interface AppContext { | |
| showLoginModal: () => void, | |
| showTooManyRequestsMessage: () => void, | |
| } | |
| export const AppContext = createContext<AppContext>({ | |
| showLoginModal: () => { throw new ("Context not implemented") }, | |
| showTooManyRequestsMessage: () => { throw new ("Context not implemented") }, | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type AuthModalState = "none" | "login" | "signup" | "resetpassword"; | |
| interface AuthModalProps { | |
| state: AuthModalState | |
| setState: (state: AuthModalState) => void, | |
| } | |
| function AuthModals({ state, setState }: AuthModalProps) { | |
| if (state === "signup") { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| interface AppContext { | |
| showLoginModal: () => void, | |
| showTooManyRequestsMessage: () => void, | |
| } | |
| export const AppContext = createContext<AppContext>({ | |
| showLoginModal: () => { throw new Error("Context not implemented") }, | |
| showTooManyRequestsMessage: () => { throw new Error("Context not implemented") }, | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UserProfileLink from "@/components/UserProfileLink"; | |
| import { formatRelativeDate } from "@/helpers/utils"; | |
| import { useAuthenticatedUser } from "@/hooks/useAuthenticatedUser"; | |
| import { Comment as CommentModel } from "@/models/comment"; | |
| import { NotFoundError } from "@/network/http-errors"; | |
| import { AppContext } from "@/pages/_app"; | |
| import { useContext, useState } from "react"; | |
| import { Button } from "react-bootstrap"; | |
| import CreateCommentBox from "./CreateCommentBox"; | |
| import EditCommentBox from "./EditCommentBox"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| interface PaginationBarProps { | |
| pageCount: number, | |
| currentPage: number, | |
| onPageItemClicked: (page: number) => void, | |
| } | |
| const PaginationBar = ({ pageCount, currentPage, onPageItemClicked }: PaginationBarProps) => { | |
| const paginationMinPage = Math.max(1, currentPage - 5); | |
| const paginationMaxPage = Math.min(pageCount, Math.max(currentPage + 4, 10)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UserProfileLink from "@/components/UserProfileLink"; | |
| import { formatRelativeDate } from "@/helpers/utils"; | |
| import { useAuthenticatedUser } from "@/hooks/useAuthenticatedUser"; | |
| import { Comment as CommentModel } from "@/models/comment"; | |
| import { NotFoundError } from "@/network/http-errors"; | |
| import { AppContext } from "@/pages/_app"; | |
| import { useContext, useState } from "react"; | |
| import { Button } from "react-bootstrap"; | |
| import CreateCommentBox from "./CreateCommentBox"; | |
| import EditCommentBox from "./EditCommentBox"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UserProfileLink from "@/components/UserProfileLink"; | |
| import { formatRelativeDate } from "@/helpers/utils"; | |
| import { useAuthenticatedUser } from "@/hooks/useAuthenticatedUser"; | |
| import { Comment as CommentModel } from "@/models/comment"; | |
| import { NotFoundError } from "@/network/http-errors"; | |
| import { AppContext } from "@/pages/_app"; | |
| import { useContext, useState } from "react"; | |
| import { Button } from "react-bootstrap"; | |
| import CreateCommentBox from "./CreateCommentBox"; | |
| import EditCommentBox from "./EditCommentBox"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.codinginflow.just10minutes.data | |
| import android.os.Parcelable | |
| import androidx.room.Entity | |
| import androidx.room.PrimaryKey | |
| import kotlinx.android.parcel.Parcelize | |
| @Entity(tableName = "task_table") | |
| @Parcelize | |
| data class Task( |