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
[next] Fixes #1539: Porting DeleteFeedDialogButton to Next #1582
Conversation
const { id, url } = feed; | ||
const classes = useStyles(); | ||
const { telescopeUrl } = useSiteMetadata(); | ||
const [open, setOpen] = useState<boolean>(false); |
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.
For inferred types like this, it's not necessary to include the generic <boolean>
. Not wrong to do this, but not necessary.
const { telescopeUrl } = useSiteMetadata(); | ||
const [open, setOpen] = useState<boolean>(false); | ||
|
||
const deleteBtnRef = useRef<HTMLButtonElement>(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.
Whereas this one is necessary, since we can't infer from null
.
const removeFeed = async () => { | ||
console.log(`Removing feed hosted at URL ${url}...`); | ||
try { | ||
const response = await fetch(`${telescopeUrl}/feeds/${id}`, { method: 'DELETE ' }); |
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.
Stupid question but 'DELETE '
has an extra space in it, is it needed?
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.
Definitely not, that's my fast typing lol
Also, is there any way to test this code? I imagine not right? |
Not atm, this will need to be imported onto the corresponding components that use it in order to see if there's anything wrong with it |
Issue This PR Addresses
Fixes #1539
Type of Change
Description
This PR address #1539, which is the porting of the DeleteFeedDialogIcon button to next from gatsby. It is part of #1316 which is the transitioning of the telescope frontend.
Checklist