-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: fixing microsdeck dependency #129
feat: fixing microsdeck dependency #129
Conversation
src/components/filters/Filters.ts
Outdated
"current card": "Selects apps that are present on the current MicroSD Card", | ||
"on card": "Selects apps that are present on a given MicroSD Card" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename to "Current MicroSD Card" & "On MicroSD Card"
This follows on from #128 I am planning to address a lot of the comments from it here |
# Conflicts: # src/components/filters/FilterSelect.tsx
# Conflicts: # src/index.tsx # src/state/TabMasterManager.tsx
bd89c61
to
fcdadbd
Compare
aa6e202
to
f2b8825
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please open a new pr with only these changes
"@cebbinghaus/microsdeck": "0.9.6-3b08037", | ||
"@cebbinghaus/microsdeck": "0.9.7-ea88921", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Include
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Include
<Focusable | ||
focusWithinClassName="gpfocuswithin" | ||
onActivate={focusable || selected === filterType ? () => {} : undefined} | ||
style={{ width: "100%", margin: 0, marginBottom: "10px", padding: 0 }} | ||
onOKButton={focusable || selected === filterType ? () => handleSelect(filterType) : undefined} | ||
> | ||
<div | ||
className={achievementClasses.AchievementListItemBase} | ||
style={{ display: "flex", flexDirection: "column", padding: "0.5em", height: "60px" }} | ||
> | ||
<div className="entry-label">{capitalizeEachWord(filterType)}</div> | ||
<div className="entry-desc">{filterDescriptions[filterType]}</div> | ||
</div> | ||
</Focusable> | ||
<FilterSelectElement | ||
disabled={disabled} | ||
filterType={filterType} | ||
handleSelect={focusable || selected === filterType ? () => handleSelect(filterType) : undefined} | ||
/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include
interface FilterSelectElement { | ||
filterType: FilterType, | ||
disabled: boolean, | ||
handleSelect: (() => void) | undefined; | ||
} | ||
|
||
/** | ||
* Individual Filter in the filter selection Modal | ||
*/ | ||
const FilterSelectElement: VFC<FilterSelectElement> = ({ filterType, disabled, handleSelect }) => { | ||
|
||
const pluginSource = FilterPluginSource[filterType]; | ||
|
||
const pluginNotice = !pluginSource ? "" : ( | ||
<small style={{ marginLeft: "0.5em", fontSize: "0.5em" }}>(requires {pluginSource})</small> | ||
); | ||
|
||
return ( | ||
<Focusable | ||
focusWithinClassName="gpfocuswithin" | ||
style={{ width: "100%", margin: 0, marginBottom: "10px", padding: 0 }} | ||
onOKButton={disabled ? e => e.preventDefault() : handleSelect} | ||
> | ||
<div | ||
className={`${achievementClasses.AchievementListItemBase} ${disabled && "entry-disabled"}`} | ||
style={{ display: "flex", flexDirection: "column", padding: "0.5em", height: "60px" }} | ||
> | ||
<div className="entry-label"> | ||
{capitalizeEachWord(filterType)} | ||
{pluginNotice} | ||
</div> | ||
<div className="entry-desc">{FilterDescriptions[filterType]}</div> | ||
</div> | ||
</Focusable> | ||
); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include
/** | ||
* Which plugin needs to be installed for this filter to be active | ||
*/ | ||
export const FilterPluginSource: { [key in FilterType]?: PluginSources } = { | ||
"sd card": "MicroSDeck", | ||
}; | ||
|
||
/** | ||
* Whether the filter is disabled (cannot be selected or run) | ||
* @param filter The filter to check. | ||
* @returns True if the filter should be considered disabled | ||
*/ | ||
export function isFilterDisabled(filter: FilterType): boolean { | ||
switch (filter) { | ||
case "sd card": | ||
return !MicroSDeck | ||
default: | ||
return false; | ||
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include
This PR cleans up some of the previous dependencies on MicroSDeck to make fallback behavior cleaner for when MicroSDeck is not installed.
Goals: