Adds playback bar to story viewer

This commit is contained in:
Josh Perez 2022-05-06 15:02:44 -04:00 committed by GitHub
parent 9817946afc
commit 85c8ff76dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 291 additions and 125 deletions

View file

@ -91,6 +91,7 @@ export const actions = {
removeItem,
removeItemExternal,
resetItems,
toggleHasAllStoriesMuted,
};
export const useActions = (): typeof actions => useBoundActions(actions);
@ -111,6 +112,19 @@ function onSetSkinTone(tone: number): ItemPutAction {
return putItem('skinTone', tone);
}
function toggleHasAllStoriesMuted(): ThunkAction<
void,
RootStateType,
unknown,
ItemPutAction
> {
return (dispatch, getState) => {
const hasAllStoriesMuted = Boolean(getState().items.hasAllStoriesMuted);
dispatch(putItem('hasAllStoriesMuted', !hasAllStoriesMuted));
};
}
function putItemExternal(key: string, value: unknown): ItemPutExternalAction {
return {
type: 'items/PUT_EXTERNAL',