PromucFlow_constructor/app/client/src/pages/common/CustomizedDropdown/OrgDropdownData.tsx
Satish Gandham 7f7f6f666b
Development: Add eslint rules for code consistency (#4083)
Co-authored-by: Satish Gandham <satish@appsmith.com>
Co-authored-by: Abhinav Jha <abhinav@appsmith.com>
2021-04-28 15:58:39 +05:30

56 lines
1.4 KiB
TypeScript

import React from "react";
import Badge from "./Badge";
import { Directions } from "utils/helpers";
import { getOnSelectAction, DropdownOnSelectActions } from "./dropdownHelpers";
import { CustomizedDropdownProps } from "./index";
import { User } from "constants/userConstants";
import _ from "lodash";
export const options = (
user: User,
orgName: string,
orgId: string,
): CustomizedDropdownProps => {
return {
sections: [
{
options: [
{
content: (
<Badge imageURL="https://via.placeholder.com/32" text={orgName} />
),
disabled: true,
shouldCloseDropdown: false,
},
{
content: "Organization Settings",
onSelect: () =>
getOnSelectAction(DropdownOnSelectActions.REDIRECT, {
path: `/org/${orgId}/settings`,
}),
},
{
content: "Share",
onSelect: () => _.noop("Share option selected"),
},
{
content: "Members",
onSelect: () =>
getOnSelectAction(DropdownOnSelectActions.REDIRECT, {
path: `/org/${orgId}/settings`,
}),
},
],
},
],
trigger: {
icon: "ORG_ICON",
text: orgName,
outline: false,
},
openDirection: Directions.DOWN,
};
};
export default options;