Skip to content

Commit

Permalink
feat: refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
nikita-jpg committed Mar 19, 2024
1 parent 69f0b5c commit 3959bfe
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 39 deletions.
5 changes: 3 additions & 2 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
* @amje @ValeraS @korvin89
/src/components/AdaptiveTabs @artemipanchuk
/src/components/DefinitionList @Raubzeug
/src/components/FilePreview @KirillDyachkovskiy
/src/components/FormRow @ogonkov
/src/components/HelpPopover @Raubzeug
/src/components/OnboardingMenu @nikita-jpg
/src/components/PlaceholderContainer @Marginy605
/src/components/PromoSheet @Avol-V
/src/components/SharePopover @niktverd
/src/components/StoreBadge @NikitaCG
/src/components/Stories @darkgenius
/src/components/AdaptiveTabs @artemipanchuk
/src/components/OnboardingMenu @nikita-jpg

70 changes: 34 additions & 36 deletions src/components/OnboardingMenu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,47 +5,45 @@ A component for managing [onboarding presets](https://github.com/gravity-ui/onbo
## Props

```ts
type OnboardingMenu = {
/** title of onboarding menu */
title: React.ReactNode;
/** number of presets passed. Changes the progress bar */
progress: number;
/** icon of onboarding menu */
icon?: IconData;

/** the default component is expand or collapsed */
defaultExpanded: boolean;
/** menu items*/
children?: React.ReactNode;

collapseButtonText?: string;
completeButtonText?: string;
className?: string;

onExpand?: (expanded: boolean) => void;
onCompleteClick: (event: React.MouseEvent) => void;
onCollapseClick?: (event: React.MouseEvent) => void;
type OnboardingMenuProps = {
/** title of onboarding menu */
title: React.ReactNode;
/** number of presets passed. Changes the progress bar */
progress: number;
/** icon of onboarding menu */
icon?: IconData;

/** the default component is expand or collapsed */
defaultExpanded: boolean;
/** menu items*/
children?: React.ReactNode;

collapseButtonText?: string;
completeButtonText?: string;
className?: string;

onExpand?: (expanded: boolean) => void;
onCompleteClick: (event: React.MouseEvent) => void;
onCollapseClick?: (event: React.MouseEvent) => void;
};

type OnboardingMenu.ItemProps = {
title: string;
/** affects the item icon */
status?: 'completed' | 'pending';
children?: React.ReactNode;
buttons?: React.ReactNode;
/** usually the last element does not need a divider, then you need to pass false */
hasDivider?: boolean;
loading?: boolean;
type OnboardingMenuItemProps = {
title: string;
/** affects the item icon */
status?: 'completed' | 'pending';
children?: React.ReactNode;
buttons?: React.ReactNode;
/** usually the last element does not need a divider, then you need to pass false */
hasDivider?: boolean;
loading?: boolean;
};

type OnboardingMenu.ItemImage = {
src: string;
alt: string;
type OnboardingMenuItemImageProps = {
src: string;
alt: string;
};

type OnboardingMenu.ItemText = {
src: string;
alt: string;
type OnboardingMenuItemTextProps = {
text: string;
};

```
2 changes: 1 addition & 1 deletion src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export * from './InfiniteScroll';
export * from './ItemSelector';
export * from './Notification';
export * from './Notifications';
export * from './OnboardingMenu';
export * from './PasswordInput';
export * from './PlaceholderContainer';
export * from './PromoSheet';
Expand All @@ -18,4 +19,3 @@ export * from './SharePopover';
export * from './StoreBadge';
export * from './Stories';
export * from './StoriesGroup';
export * from './OnboardingMenu';

0 comments on commit 3959bfe

Please sign in to comment.