-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:juspay/hyperswitch-control-center i…
…nto group-drop-down-component
- Loading branch information
Showing
20 changed files
with
85 additions
and
77 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,23 @@ | ||
@react.component | ||
let make = (~values=[], ~showButton=false, ~onButtonClick=_ => (), ~converterFn=str => str) => { | ||
<div> | ||
{if values->Js.Array2.length !== 0 { | ||
<div className="flex flex-wrap flex-row"> | ||
{values | ||
->Js.Array2.map(value => { | ||
let onClick = _evt => { | ||
onButtonClick(value) | ||
} | ||
<div | ||
className="px-4 py-2 m-2 mr-0.5 rounded-full border border-gray-300 bg-gradient-to-b from-jp-gray-200 to-jp-gray-300 dark:from-jp-gray-950 dark:to-jp-gray-950 text-gray-500 hover:shadow dark:text-jp-gray-text_darktheme dark:text-opacity-50 flex align-center w-max cursor-pointer transition duration-300 ease"> | ||
{React.string(value->converterFn)} | ||
{if showButton { | ||
<div className="float-right cursor-pointer mt-0.5 ml-0.5 opacity-50"> | ||
<Icon className="align-middle" size=14 name="times" onClick /> | ||
</div> | ||
} else { | ||
React.null | ||
}} | ||
</div> | ||
}) | ||
->React.array} | ||
</div> | ||
} else { | ||
React.null | ||
}} | ||
</div> | ||
<UIUtils.RenderIf condition={values->Js.Array2.length !== 0}> | ||
<div className="flex flex-wrap flex-row"> | ||
{values | ||
->Js.Array2.map(value => { | ||
let onClick = _evt => { | ||
onButtonClick(value) | ||
} | ||
<div | ||
className="px-4 py-2 m-2 mr-0.5 rounded-full border border-gray-300 bg-gradient-to-b from-jp-gray-200 to-jp-gray-300 dark:from-jp-gray-950 dark:to-jp-gray-950 text-gray-500 hover:shadow dark:text-jp-gray-text_darktheme dark:text-opacity-50 flex align-center w-max cursor-pointer transition duration-300 ease"> | ||
{React.string(value->converterFn)} | ||
<UIUtils.RenderIf condition={showButton}> | ||
<div className="float-right cursor-pointer mt-0.5 ml-0.5 opacity-50"> | ||
<Icon className="align-middle" size=14 name="times" onClick /> | ||
</div> | ||
</UIUtils.RenderIf> | ||
</div> | ||
}) | ||
->React.array} | ||
</div> | ||
</UIUtils.RenderIf> | ||
} |
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
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
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
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
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
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
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
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
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
Oops, something went wrong.