-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
121 additions
and
85 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
...lientapp/src/components/molecules/menu-option-selection-all/menu-option-selection-all.tsx
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import useGlobalSettings from "../../../hooks/use-global-settings"; | ||
import { IArchiveProps } from "../../../interfaces/IArchiveProps"; | ||
import localization from "../../../localization/localization.json"; | ||
import { Language } from "../../../shared/language"; | ||
|
||
export interface IMenuOptionUndoSelectionProps { | ||
select: string[]; | ||
state: IArchiveProps; | ||
allSelection: () => void; | ||
} | ||
|
||
export const MenuOptionSelectionAll: React.FunctionComponent< | ||
IMenuOptionUndoSelectionProps | ||
> = ({ select, state, allSelection }) => { | ||
const settings = useGlobalSettings(); | ||
const language = new Language(settings.language); | ||
const MessageSelectAll = language.key(localization.MessageSelectAll); | ||
|
||
return ( | ||
<> | ||
{select.length !== state.fileIndexItems.length ? ( | ||
<li | ||
className="menu-option" | ||
data-test="select-all" | ||
onClick={() => allSelection()} | ||
Check warning on line 25 in starsky/starsky/clientapp/src/components/molecules/menu-option-selection-all/menu-option-selection-all.tsx Codecov / codecov/patchstarsky/starsky/clientapp/src/components/molecules/menu-option-selection-all/menu-option-selection-all.tsx#L25
|
||
tabIndex={0} | ||
onKeyDown={(event) => { | ||
event.key === "Enter" && allSelection(); | ||
}} | ||
> | ||
{MessageSelectAll} | ||
</li> | ||
) : null} | ||
</> | ||
); | ||
}; |
36 changes: 36 additions & 0 deletions
36
...entapp/src/components/molecules/menu-option-selection-undo/menu-option-selection-undo.tsx
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import useGlobalSettings from "../../../hooks/use-global-settings"; | ||
import { IArchiveProps } from "../../../interfaces/IArchiveProps"; | ||
import localization from "../../../localization/localization.json"; | ||
import { Language } from "../../../shared/language"; | ||
|
||
export interface IMenuOptionSelectionUndoProps { | ||
select: string[]; | ||
state: IArchiveProps; | ||
undoSelection: () => void; | ||
} | ||
|
||
export const MenuOptionSelectionUndo: React.FunctionComponent< | ||
IMenuOptionSelectionUndoProps | ||
> = ({ select, state, undoSelection }) => { | ||
const settings = useGlobalSettings(); | ||
const language = new Language(settings.language); | ||
const MessageUndoSelection = language.key(localization.MessageUndoSelection); | ||
|
||
return ( | ||
<> | ||
{select.length === state.fileIndexItems.length ? ( | ||
<li | ||
data-test="undo-selection" | ||
className="menu-option" | ||
onClick={() => undoSelection()} | ||
tabIndex={0} | ||
onKeyDown={(event) => { | ||
event.key === "Enter" && undoSelection(); | ||
}} | ||
> | ||
{MessageUndoSelection} | ||
</li> | ||
) : null} | ||
</> | ||
); | ||
}; |
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
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
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
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