-
-
Notifications
You must be signed in to change notification settings - Fork 360
feat(client): add chat url link to chapters #998
feat(client): add chat url link to chapters #998
Conversation
CodeSee Review Map:Review in an interactive map View more CodeSee Maps Legend |
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.
Thanks for putting this together, @Ismailtlem, it's working nicely.
I noticed a few minor issues:
server/prisma/schema.prisma
Outdated
@@ -22,6 +22,7 @@ model chapters { | |||
region String | |||
country String | |||
imageUrl String | |||
chatUrl String @default("") |
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.
chatUrl String @default("") | |
chatUrl String? |
We don't need to specify the default, since it's optional.
label: 'Chat link', | ||
placeholder: 'https://discord.gg/KVUmVXA', | ||
required: false, | ||
type: 'text', |
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.
type: 'text', | |
type: 'url', |
They're all going to be urls, I think.
<Heading size="md" color={'gray.700'}> | ||
Chat Link: | ||
</Heading> | ||
<Link>{data.chapter.chatUrl}</Link> |
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.
Could you make this conditional on the chatUrl existing? It looks a little odd to see Chat Link: without the link.
@Field(() => String) | ||
chatUrl: string; |
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.
@Field(() => String) | |
chatUrl: string; | |
@Field(() => String, { nullable: true }) | |
chatUrl?: string | null; |
This is necessary if we make the field optional. Unfortunately, the fact it can now be null needs to be handled by ChapterForm
. For now it's fine to use
defaultValue={defaultValues[key] ?? undefined}
it's ugly, but it'll do until I come up with something nicer.
@Field(() => String) | ||
chatUrl: string; |
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.
@Field(() => String) | |
chatUrl: string; | |
@Field(() => String, { nullable: true }) | |
chatUrl?: string | null; |
server/src/graphql-types/Chapter.ts
Outdated
@Field(() => String) | ||
chatUrl: string; |
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.
@Field(() => String) | |
chatUrl: string; | |
@Field(() => String, { nullable: true }) | |
chatUrl?: string | null; |
97a6c3f
to
7cde6c4
Compare
7cde6c4
to
b6d8b53
Compare
Thanks @Ismailtlem it all LGTM, now 👍 |
@all-contributors add @Ismailtlem for code |
I've put up a pull request to add @Ismailtlem! 🎉 |
Update README.md
).main
branch of Chapter.Related to #104