-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from aversini/fix-refactoring-LiveRegion-to-dr…
…op-react-dom-server-usage fix: refactoring LiveRegion to drop react dom server usage
- Loading branch information
Showing
7 changed files
with
148 additions
and
48 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
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
3 changes: 3 additions & 0 deletions
3
packages/ui-components/src/components/private/LiveRegion/constants.ts
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
22 changes: 22 additions & 0 deletions
22
packages/ui-components/src/components/private/LiveRegion/reducer.ts
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,22 @@ | ||
import { | ||
ACTION_CLEAR_ANNOUNCEMENT, | ||
ACTION_SET_ANNOUNCEMENT, | ||
} from "./constants"; | ||
import type { ActionProps, StateProps } from "./LiveRegionTypes"; | ||
|
||
export const reducer = (state: StateProps, action: ActionProps) => { | ||
switch (action?.type) { | ||
case ACTION_SET_ANNOUNCEMENT: | ||
return { | ||
...state, | ||
announcement: action.payload, | ||
}; | ||
case ACTION_CLEAR_ANNOUNCEMENT: | ||
return { | ||
...state, | ||
announcement: null, | ||
}; | ||
default: | ||
return state; | ||
} | ||
}; |
Oops, something went wrong.