Skip to content

Commit

Permalink
feat(ProgressBar): add new progress bars
Browse files Browse the repository at this point in the history
  • Loading branch information
AAGaming00 committed Jul 13, 2022
1 parent 79d73de commit d9e4ff3
Showing 1 changed file with 31 additions and 3 deletions.
34 changes: 31 additions & 3 deletions src/deck-components/ProgressBar.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,46 @@
import { VFC } from 'react';
import { VFC, ReactNode } from 'react';

import { findModuleChild } from '../webpack';
import { ItemProps } from './Item';

export interface ProgressBarItem extends ItemProps {
export interface ProgressBarItemProps extends ItemProps {
indeterminate?: boolean;
nTransitionSec?: number;
nProgress?: number;
focusable?: boolean;
}


export interface ProgressBarProps {
indeterminate?: boolean;
nTransitionSec?: number;
nProgress?: number;
focusable?: boolean;
}

export interface ProgressBarWithInfoProps extends ProgressBarProps {
sTimeRemaining?: ReactNode;
sOperationText?: ReactNode;
}

export const ProgressBar = findModuleChild((m) => {
if (typeof m !== 'object') return undefined;
for (let prop in m) {
if (m[prop]?.toString()?.includes('.ProgressBar,"standard"==')) return m[prop];
}
}) as VFC<ProgressBarProps>;

export const ProgressBarWithInfo = findModuleChild((m) => {
if (typeof m !== 'object') return undefined;
for (let prop in m) {
if (m[prop]?.toString()?.includes('.ProgressBarFieldStatus},')) return m[prop];
}
}) as VFC<ProgressBarWithInfoProps>;


export const ProgressBarItem = findModuleChild((m) => {
if (typeof m !== 'object') return undefined;
for (let prop in m) {
if (m[prop]?.toString()?.includes('"indeterminate","nTransitionSec"')) return m[prop];
}
}) as VFC<ProgressBarItem>;
}) as VFC<ProgressBarItemProps>;

0 comments on commit d9e4ff3

Please sign in to comment.