From 659967f7102d05d57ab1d8a51c739b8755161052 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Mon, 5 Jun 2023 20:25:27 -0700 Subject: [PATCH] Replace RaidDropdown with RaidCombobox --- components/party/PartyHeader/index.tsx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/components/party/PartyHeader/index.tsx b/components/party/PartyHeader/index.tsx index e45a67c7..33f806e0 100644 --- a/components/party/PartyHeader/index.tsx +++ b/components/party/PartyHeader/index.tsx @@ -9,7 +9,7 @@ import Button from '~components/common/Button' import CharLimitedFieldset from '~components/common/CharLimitedFieldset' import DurationInput from '~components/common/DurationInput' import Input from '~components/common/Input' -import RaidDropdown from '~components/RaidDropdown' +import RaidCombobox from '~components/raids/RaidCombobox' import Switch from '~components/common/Switch' import Tooltip from '~components/common/Tooltip' import Token from '~components/common/Token' @@ -227,8 +227,8 @@ const PartyHeader = (props: Props) => { setOpen(!open) } - function receiveRaid(slug?: string) { - if (slug) setRaidSlug(slug) + function receiveRaid(raid?: Raid) { + if (raid) setRaidSlug(raid?.slug) } function switchValue(value: boolean) { @@ -260,7 +260,8 @@ const PartyHeader = (props: Props) => { function updateDetails(event: React.MouseEvent) { const descriptionValue = descriptionInput.current?.value - const raid = raids.find((raid) => raid.slug === raidSlug) + const allRaids = appState.raidGroups.flatMap((group) => group.raids) + const raid = allRaids.find((raid) => raid.slug === raidSlug) const details: DetailsObject = { fullAuto: fullAuto, @@ -498,9 +499,9 @@ const PartyHeader = (props: Props) => { error={errors.name} ref={nameInput} /> -