-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #548 from alleslabs/feat/module-interact-v2
feat: interaction query param
- Loading branch information
Showing
36 changed files
with
283 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...pages/interaction/component/main/body.tsx → ...interact/component/FunctionSelectBody.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
61 changes: 61 additions & 0 deletions
61
src/lib/pages/interact/component/common/FunctionAccordion.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { | ||
AccordionButton, | ||
AccordionIcon, | ||
AccordionItem, | ||
AccordionPanel, | ||
Flex, | ||
Text, | ||
} from "@chakra-ui/react"; | ||
|
||
import { CountBadge, FunctionCard } from "lib/components/module"; | ||
import type { ExposedFunction, Option } from "lib/types"; | ||
|
||
import { NoImageEmptyState } from "./EmptyState"; | ||
|
||
interface FunctionAccordionProps { | ||
filteredFns: ExposedFunction[]; | ||
isEmpty: boolean; | ||
triggerText: string; | ||
selectedFn: Option<ExposedFunction>; | ||
setSelectedFn: (fn: ExposedFunction) => void; | ||
} | ||
|
||
export const FunctionAccordion = ({ | ||
filteredFns, | ||
isEmpty, | ||
triggerText, | ||
selectedFn, | ||
setSelectedFn, | ||
}: FunctionAccordionProps) => ( | ||
<AccordionItem bg="background.main" py={1}> | ||
<h6> | ||
<AccordionButton> | ||
<Flex align="center" justify="space-between" gap={2}> | ||
<Text variant="body2" color="text.dark"> | ||
{triggerText} | ||
</Text> | ||
<CountBadge count={filteredFns.length} variant="common" /> | ||
</Flex> | ||
<AccordionIcon color="gray.600" ml="auto" /> | ||
</AccordionButton> | ||
</h6> | ||
<AccordionPanel py={3} px={0}> | ||
<Flex flexDirection="column" gap={1}> | ||
{filteredFns.length ? ( | ||
filteredFns.map((fn) => ( | ||
<FunctionCard | ||
key={fn.name} | ||
variant={selectedFn?.name === fn.name ? "selected" : "common"} | ||
exposedFn={fn} | ||
onFunctionSelect={setSelectedFn} | ||
/> | ||
)) | ||
) : ( | ||
<NoImageEmptyState | ||
desc={isEmpty ? "No function" : "No matching function found"} | ||
/> | ||
)} | ||
</Flex> | ||
</AccordionPanel> | ||
</AccordionItem> | ||
); |
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions
1
...ges/interaction/component/common/index.ts → .../pages/interact/component/common/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from "./EmptyState"; | ||
export * from "./FunctionAccordion"; | ||
export * from "./InteractionTypeSwitch"; | ||
export * from "./ModuleContainer"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from "./ModuleSelectDrawer"; | ||
export * from "./ModuleSelectDrawerTrigger"; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...ction/component/drawer/selector/index.tsx → ...eract/component/drawer/selector/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export * from "./common"; | ||
export * from "./drawer"; | ||
export * from "./form"; | ||
export * from "./FunctionSelectBody"; | ||
export * from "./FunctionSelectPanel"; |
File renamed without changes.
Oops, something went wrong.
f6165d2
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.
Successfully deployed to the following URLs:
initia-celatone-frontend – ./
initia-celatone-frontend.vercel.app
initia-celatone-frontend-alleslabs.vercel.app
initia.celat.one
initia-celatone-frontend-git-feat-initia-alleslabs.vercel.app