Q & A + journal (#174)

* tasks

* task input

* community route

* added thread and list for community QA

* answers thread

* journal sidebar section

* journal calendar

* fix: stuff

* fix: stuff

* fix: stuff

* chore: disable comunitty toggle

* fix: typo import header

---------

Co-authored-by: marshennikovaolga <marshennikova@gmail.com>
Co-authored-by: Aslam H <iupin5212@gmail.com>
This commit is contained in:
Nikita
2024-09-28 15:47:10 +03:00
committed by GitHub
parent 34d69be960
commit 3e7c8cf38a
24 changed files with 720 additions and 89 deletions

View File

@@ -13,6 +13,7 @@ import { PersonalPageLists } from "./personal-page"
import { PersonalLinkLists } from "./personal-link"
import { ListOfTopics } from "./master/topic"
import { ListOfTasks } from "./tasks"
import { JournalEntryLists } from "./journal"
declare module "jazz-tools" {
interface Profile {
@@ -35,6 +36,7 @@ export class UserRoot extends CoMap {
topicsLearned = co.ref(ListOfTopics)
tasks = co.ref(ListOfTasks)
journalEntries = co.ref(JournalEntryLists)
}
export class LaAccount extends Account {
@@ -64,7 +66,8 @@ export class LaAccount extends Account {
topicsLearning: ListOfTopics.create([], { owner: this }),
topicsLearned: ListOfTopics.create([], { owner: this }),
tasks: ListOfTasks.create([], { owner: this })
tasks: ListOfTasks.create([], { owner: this }),
journalEntries: JournalEntryLists.create([], { owner: this })
},
{ owner: this }
)

11
web/lib/schema/journal.ts Normal file
View File

@@ -0,0 +1,11 @@
import { co, CoList, CoMap, Encoders } from "jazz-tools"
export class JournalEntry extends CoMap {
title = co.string
content = co.json()
date = co.encoded(Encoders.Date)
createdAt = co.encoded(Encoders.Date)
updatedAt = co.encoded(Encoders.Date)
}
export class JournalEntryLists extends CoList.Of(co.ref(JournalEntry)) {}

View File

@@ -5,8 +5,7 @@ export class Task extends CoMap {
description = co.optional.string
status = co.literal("todo", "in_progress", "done")
createdAt = co.encoded(Encoders.Date)
// updatedAt = co.encoded(Encoders.Date)
completedAt = co.optional.encoded(Encoders.Date)
updatedAt = co.encoded(Encoders.Date)
}
export class ListOfTasks extends CoList.Of(co.ref(Task)) {}

View File

@@ -46,6 +46,14 @@ export function isTextInput(element: Element): boolean {
)
}
export function calendarFormatDate(date: Date): string {
return date.toLocaleDateString("en-US", {
year: "numeric",
month: "long",
day: "numeric"
})
}
export * from "./urls"
export * from "./slug"
export * from "./keyboard"