forked from SteamDeckHomebrew/decky-frontend-lib
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ProgressBar): add new progress bars
- Loading branch information
1 parent
79d73de
commit d9e4ff3
Showing
1 changed file
with
31 additions
and
3 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
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>; |