Skip to content

Commit 0b916a9

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents db08f12 + 8301ea8 commit 0b916a9

File tree

5 files changed

+16
-4
lines changed

5 files changed

+16
-4
lines changed

wp-react-lib/CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# @devgateway/wp-react-lib
22

3+
## 0.3.2
4+
5+
### Patch Changes
6+
7+
- 7ce74cb: Fix localized provider by fixing the destructured props
8+
9+
## 0.3.1
10+
11+
### Patch Changes
12+
13+
- 7ea6235: Fix rendering issues in the replace link but handling empty values
14+
315
## 0.3.0
416

517
### Minor Changes

wp-react-lib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devgateway/wp-react-lib",
3-
"version": "0.3.0",
3+
"version": "0.3.2",
44
"author": "Sebastian Dimunzio <sdimunzio@developmentgateway.org/>",
55
"type": "module",
66
"files": [

wp-react-lib/src/providers/LocalizedProvider.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {AppContext} from "./Context"
33

44
const LocalizedProvider = (CustomProvider) => (props) => (
55
<AppContext.Consumer>
6-
{({locale}) => <CustomProvider locale={locale} {...props} />}
6+
{(data) => <CustomProvider locale={data?.locale} {...props} />}
77
</AppContext.Consumer>)
88

99
export default LocalizedProvider

wp-react-lib/src/reducers/actions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ export const getMenu = ({slug, locale = "en"}) => (dispatch, getState) => {
201201
}
202202

203203

204-
export const getSettings = ({locale = "en",changeUUID=null}) => (dispatch, getState) => {
204+
export const getSettings = ({locale = "en", changeUUID=null}) => (dispatch, getState) => {
205205
dispatch({type: LOAD_SETTINGS})
206206
wp.getSettings(locale,changeUUID).then(response => {
207207
const {data, meta} = response

wp-react-lib/src/util/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const useHash = process.env.VITE_REACT_APP_USE_HASH_LINKS;
44
export const replaceLink = (url, locale) => {
55
//console.log("--------- replaceLink--------------")
66
//console.log(process.env.REACT_APP_WP_HOSTS)
7-
const replacementTarget = process.env.VITE_REACT_APP_WP_HOSTS.split(",")
7+
const replacementTarget = process.env.VITE_REACT_APP_WP_HOSTS?.split(",") || []
88
let all = new RegExp("^(http|https)://(" + replacementTarget.join('|') + ")", "ig");
99
if (useHash && url) {
1010
return url.replaceAll(all, "#" + locale)

0 commit comments

Comments
 (0)