From a9f14c8a380e02a6e218bdf8e451ae99e4893835 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Sun, 27 Feb 2022 00:39:37 -0800 Subject: [PATCH] Add an optional All option to raid select --- components/PartyDetails/index.tsx | 1 + components/RaidDropdown/index.tsx | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/components/PartyDetails/index.tsx b/components/PartyDetails/index.tsx index cdb6f813..81394059 100644 --- a/components/PartyDetails/index.tsx +++ b/components/PartyDetails/index.tsx @@ -79,6 +79,7 @@ const PartyDetails = (props: Props) => { ref={nameInput} /> ) => void + onChange?: (event: React.ChangeEvent) => void + onBlur?: (event: React.ChangeEvent) => void } const RaidDropdown = React.forwardRef(function useFieldSet(props, ref) { @@ -63,6 +65,18 @@ const RaidDropdown = React.forwardRef(function useFiel groupedRaids[i] = raids.filter(raid => raid.group == i) } + if (props.allOption) + groupedRaids[0].unshift({ + id: '0', + name: { + en: 'All raids', + jp: '全て' + }, + level: 0, + group: 0, + element: 0 + }) + setRaids(groupedRaids) } @@ -82,7 +96,7 @@ const RaidDropdown = React.forwardRef(function useFiel } return ( - { Array.from(Array(raids?.length)).map((x, i) => { return raidGroup(i) })}