DocSpace-client/packages/shared/components/main-button-mobile
Alexey Safronov 8a202e1d79 Merge branch 'release/v2.5.0' into develop
# Conflicts:
#	packages/client/src/components/Article/MainButton/index.js
#	packages/shared/utils/common.ts
2024-04-19 13:13:00 +04:00
..
sub-components Replaced copyright start year + format 2024-03-21 18:09:55 +04:00
index.tsx Replaced copyright start year + format 2024-03-21 18:09:55 +04:00
MainButtonMobile.docs.mdx Replaced copyright start year + format 2024-03-21 18:09:55 +04:00
MainButtonMobile.stories.tsx Web: Shared: Components: hide copyright 2024-03-25 13:19:22 +05:00
MainButtonMobile.styled.ts Merge branch 'release/v2.5.0' into develop 2024-04-19 13:13:00 +04:00
MainButtonMobile.test.tsx Replaced copyright start year + format 2024-03-21 18:09:55 +04:00
MainButtonMobile.tsx Merge branch 'release/v2.5.0' into develop 2024-03-22 16:20:48 +04:00
MainButtonMobile.types.ts Merge branch 'release/v2.5.0' into develop 2024-03-22 16:20:48 +04:00
README.md Client: fix after rewrite to typescript 2023-12-27 17:45:22 +03:00

MainButtonMobile

Usage

import MainButtonMobile , from "@docspace/shared/components/main-button-mobile";
import MobileActionsFolderReactSvgUrl from "PUBLIC_DIR/images/mobile.actions.folder.react.svg?url";
const actionOptions = [
  {
    key: "1",
    label: "New document",
    icon: MobileActionsFolderReactSvgUrl,
  },
  {
    key: "2",
    label: "New presentation",
    icon: MobileActionsFolderReactSvgUrl,
  },
];

const buttonOptions = [
  {
    key: "1",
    label: "Import point",
  },
  {
    key: "2",
    label: "Import point",
  },
];

const progressOptions = [
  {
    key: "1",
    label: "Uploads",
    percent: 30,
    status: `8/10`,
    open: true,
  },
];

<MainButtonMobile
  style={{
    top: "90%",
    left: "82%",
    position: "fixed",
  }}
  manualWidth="320px"
  title="Upload"
  withButton={true}
  actionOptions={actionOptions}
  progressOptions={progressOptions}
  isOpenButton={true}
  buttonOptions={buttonOptions}
/>;
Props Type Required Values Default Description
style obj, array - - - Accepts css style
actionOptions obj - - - Options for drop down items
progressOptions obj - - - If you need display progress bar components
buttonOptions obj - - - Menu that opens by clicking on the button
onUploadClick func - - - The function that will be called after the button click
withButton bool - - - Show button inside drop down
isOpenButton bool - - - The parameter that is used with buttonOptions is needed to open the menu by clicking on the button
title string - - The name of the button in the drop down
percent number - - - Loading indicator
manualWidth string - - - Required if you need to specify the exact width of the drop down component
opened bool - - - Tells when the dropdown should be opened
className string - - - Accepts class
onClose func - - - if you need close drop down