-
Notifications
You must be signed in to change notification settings - Fork 7
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
Discord Id Check #69
base: main
Are you sure you want to change the base?
Discord Id Check #69
Conversation
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.
Just a small change and it should be good to ship 👍🏾
packages/web/src/components/DiscordCheck/DiscordButtonCheck.tsx
Outdated
Show resolved
Hide resolved
packages/web/src/components/DiscordCheck/DiscordButtonCheck.tsx
Outdated
Show resolved
Hide resolved
packages/web/src/components/DiscordCheck/DiscordButtonCheck.tsx
Outdated
Show resolved
Hide resolved
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.
One more small thing 🤏🏾
packages/web/tests/components/DiscordCheck/DiscordButtonCheck.test.tsx
Outdated
Show resolved
Hide resolved
packages/web/src/components/DiscordCheck/DiscordButtonCheck.tsx
Outdated
Show resolved
Hide resolved
packages/web/tests/components/DiscordCheck/DiscordButtonCheck.test.tsx
Outdated
Show resolved
Hide resolved
packages/web/tests/components/DiscordCheck/DiscordButtonCheck.test.tsx
Outdated
Show resolved
Hide resolved
packages/web/tests/components/DiscordCheck/DiscordButtonCheck.test.tsx
Outdated
Show resolved
Hide resolved
packages/web/tests/components/DiscordCheck/DiscordButtonCheck.test.tsx
Outdated
Show resolved
Hide resolved
packages/web/tests/components/DiscordCheck/DiscordButtonCheck.test.tsx
Outdated
Show resolved
Hide resolved
packages/web/tests/components/DiscordCheck/DiscordButtonCheck.test.tsx
Outdated
Show resolved
Hide resolved
packages/web/tests/components/DiscordCheck/DiscordButtonCheck.test.tsx
Outdated
Show resolved
Hide resolved
packages/web/tests/components/DiscordCheck/DiscordButtonCheck.test.tsx
Outdated
Show resolved
Hide resolved
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.
Just a few quick things and then we can merge
packages/web/tests/components/DiscordCheck/DiscordButtonCheck.test.tsx
Outdated
Show resolved
Hide resolved
interface User { | ||
discordId?: 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.
Is User
not defined anywhere else in the front end?
@@ -0,0 +1,61 @@ | |||
import React from 'react'; |
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.
I just noticed this, but this directory should have the same name as the file; can you rename the parent DiscordÇheck
to match DiscordButton
?
@@ -29,7 +29,7 @@ export const UserProfile: React.FC<UserProfileProps> = ({ user, setUser }: UserP | |||
'content-type': 'application/json', | |||
}, | |||
body: JSON.stringify({ | |||
discordId: undefined, | |||
discordId: null, |
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.
Why was this change made? null
doesn't match the type above (string
in conjunction with ?
becomes string | undefined
which is not the same as string | null
)
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.
This was made because I don't think the database knows what undefined was. Unless we change it to null the discord ID is not actually removed from the profile. it just selects the profile but doesn't actually remove the Discord ID.
interface User { | ||
discordId?: 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.
We should be using the same type the front end uses; adding our own interface adds no value because if the front end's interface changes, the type safety here won't catch it
@@ -0,0 +1,61 @@ | |||
import React from 'react'; |
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.
The file name here should match the component exactly; make sure to rename this file and the parent directory
Pre-Requisites
Description of Changes
Check the database to see if the current user has a discordId attached to their profile. If they are registered display the "Go to Discord" button. If not registered display the "Join Discord" button.
Related Issues
Closes #52
Relies on #74