forked from mirrors/thatmattlove-hyperglass
auto expand first result
This commit is contained in:
parent
9b8fe94482
commit
0525c66ce4
2 changed files with 4 additions and 1 deletions
|
|
@ -45,7 +45,7 @@ const AccordionHeaderWrapper = styled(Flex)`
|
|||
const statusMap = { success: "success", warning: "warning", error: "warning", danger: "error" };
|
||||
|
||||
const Result = React.forwardRef(
|
||||
({ device, timeout, queryLocation, queryType, queryVrf, queryTarget }, ref) => {
|
||||
({ device, timeout, queryLocation, queryType, queryVrf, queryTarget, index }, ref) => {
|
||||
const config = useConfig();
|
||||
const theme = useTheme();
|
||||
const { colorMode } = useColorMode();
|
||||
|
|
@ -93,6 +93,7 @@ const Result = React.forwardRef(
|
|||
|
||||
return (
|
||||
<AccordionItem
|
||||
defaultIsOpen={index === 0 ? true : false}
|
||||
isDisabled={loading}
|
||||
ref={ref}
|
||||
css={css({
|
||||
|
|
|
|||
|
|
@ -117,6 +117,7 @@ const Results = ({ queryLocation, queryType, queryVrf, queryTarget, setSubmittin
|
|||
overflow="hidden"
|
||||
>
|
||||
<Accordion
|
||||
allowMultiple
|
||||
initial={{ opacity: 1 }}
|
||||
transition={{ duration: 0.3 }}
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
|
|
@ -138,6 +139,7 @@ const Results = ({ queryLocation, queryType, queryVrf, queryTarget, setSubmittin
|
|||
queryVrf={queryVrf}
|
||||
queryTarget={queryTarget}
|
||||
setSubmitting={setSubmitting}
|
||||
index={i}
|
||||
/>
|
||||
))}
|
||||
</AnimatePresence>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue