-
Notifications
You must be signed in to change notification settings - Fork 6
Feature 2264 guilds query parameters #2274
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
Conversation
| @@ -1,60 +0,0 @@ | |||
| import React, { useContext, useState } 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.
This is a very small component that is only used in GridResults.jsx which needed feedback from this.
It seemed easiest to just move the functionality into GridResults.jsx than to add more props to communicate.
| @@ -1,39 +0,0 @@ | |||
| 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 component this tests was deleted, so this test file was deleted.
| ? editedGuild.guildMembers.filter(guildMember => guildMember.lead) | ||
| : [] | ||
| } | ||
| isOptionEqualToValue={(option, value) => |
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 prop was missing and I think it is required to compare options to the selected value, just like it is used in the next AutoComplete.
| getOptionLabel={option => option.name} | ||
| isOptionEqualToValue={(option, value) => | ||
| value ? value.id === option.id : false | ||
| value && option.id === value.memberId |
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'm pretty sure we want to compare against the memberId property in the value object rather than the id property.
| @@ -1,13 +1,17 @@ | |||
| import React, { useContext, useState } 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 reordered some of the imports.
| import AddGuildModal from './EditGuildModal'; | ||
| import GuildSummaryCard from './GuildSummaryCard'; | ||
| import SkeletonLoader from '../skeleton_loader/SkeletonLoader'; | ||
| import { useQueryParameters } from '../../helpers/query-parameters'; |
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 is a new import.
| setSearchText(e.target.value); | ||
| }} | ||
| /> | ||
| <GuildsActions /> |
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 GuildActions component was very small and only used here. To simplify communication between that code and this code, I copied the code into here and deleted that component.
| const GuildSummaryCard = ({ guild, index, isOpen, onGuildSelect }) => { | ||
| const { state, dispatch } = useContext(AppContext); | ||
| const { guilds, userProfile, csrf } = state; | ||
| const [open, setOpen] = useState(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.
The default value of this state is now passed in a prop.
| const handleClose = () => setOpen(false); | ||
| const handleOpen = () => { | ||
| setOpen(true); | ||
| onGuildSelect(guild.id); |
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 is necessary to inform the parent component of the change.
| }; | ||
| const handleClose = () => { | ||
| setOpen(false); | ||
| onGuildSelect(''); |
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 is necessary to inform the parent component of the change.
| const { dispatch, state } = useContext(AppContext); | ||
| const { csrf, guilds, userProfile } = state; | ||
| const [addOpen, setAddOpen] = useState(false); | ||
| const [openedGuildId, setOpenedGuildId] = useState(''); |
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 maintains state used by GuildSummaryCard.
No description provided.