From 83a3e45315368e32e32d1cd9eb965e8184c05945 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Fri, 14 Jan 2022 20:37:46 -0800 Subject: [PATCH] Update global vars --- .env.sample | 6 +++--- src/components/CharacterResult/index.tsx | 2 +- src/components/CharacterUnit/index.tsx | 2 +- src/components/GridRep/index.tsx | 4 ++-- src/components/SummonResult/index.tsx | 2 +- src/components/SummonUnit/index.tsx | 4 ++-- src/components/WeaponResult/index.tsx | 2 +- src/components/WeaponUnit/index.tsx | 4 ++-- src/utils/api.tsx | 4 ++-- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.env.sample b/.env.sample index e655b9c0..5cdcdb82 100644 --- a/.env.sample +++ b/.env.sample @@ -3,6 +3,6 @@ NODE_PATH='src/' # App URLs # Don't add a trailing slash to these URLs. -SIERO_API_URL='' -SIERO_OAUTH_URL='' -SIERO_IMG_URL='' \ No newline at end of file +REACT_APP_SIERO_API_URL='' +REACT_APP_SIERO_OAUTH_URL='' +REACT_APP_SIERO_IMG_URL='' \ No newline at end of file diff --git a/src/components/CharacterResult/index.tsx b/src/components/CharacterResult/index.tsx index c83a506e..fef0d3b4 100644 --- a/src/components/CharacterResult/index.tsx +++ b/src/components/CharacterResult/index.tsx @@ -20,7 +20,7 @@ class CharacterResult extends React.Component { if (process.env.NODE_ENV === 'development') { imgSrc = images[character.granblue_id] } else if (process.env.NODE_ENV === 'production') { - imgSrc = `${process.env.SIERO_IMG_URL}/chara-grid/${character.granblue_id}.jpg` + imgSrc = `${process.env.REACT_APP_SIERO_IMG_URL}/chara-grid/${character.granblue_id}.jpg` } return ( diff --git a/src/components/CharacterUnit/index.tsx b/src/components/CharacterUnit/index.tsx index 253aa9c7..c6dc9b82 100644 --- a/src/components/CharacterUnit/index.tsx +++ b/src/components/CharacterUnit/index.tsx @@ -44,7 +44,7 @@ const CharacterUnit = (props: Props) => { if (process.env.NODE_ENV === 'development') { imgSrc = images[character.granblue_id] } else if (process.env.NODE_ENV === 'production') { - imgSrc = `${process.env.SIERO_IMG_URL}/chara-main/${character.granblue_id}.jpg` + imgSrc = `${process.env.REACT_APP_SIERO_IMG_URL}/chara-main/${character.granblue_id}.jpg` } } diff --git a/src/components/GridRep/index.tsx b/src/components/GridRep/index.tsx index 2a8574f7..3bd1c9dd 100644 --- a/src/components/GridRep/index.tsx +++ b/src/components/GridRep/index.tsx @@ -43,7 +43,7 @@ const GridRep = (props: Props) => { ? : } @@ -53,7 +53,7 @@ const GridRep = (props: Props) => { ? : } diff --git a/src/components/SummonResult/index.tsx b/src/components/SummonResult/index.tsx index e62a4731..25fab376 100644 --- a/src/components/SummonResult/index.tsx +++ b/src/components/SummonResult/index.tsx @@ -20,7 +20,7 @@ class SummonResult extends React.Component { if (process.env.NODE_ENV === 'development') { imgSrc = gridImages[summon.granblue_id] } else if (process.env.NODE_ENV === 'production') { - imgSrc = `${process.env.SIERO_IMG_URL}/summon-grid/${summon.granblue_id}.jpg` + imgSrc = `${process.env.REACT_APP_SIERO_IMG_URL}/summon-grid/${summon.granblue_id}.jpg` } return ( diff --git a/src/components/SummonUnit/index.tsx b/src/components/SummonUnit/index.tsx index a1ba748c..ffd12316 100644 --- a/src/components/SummonUnit/index.tsx +++ b/src/components/SummonUnit/index.tsx @@ -53,9 +53,9 @@ const SummonUnit = (props: Props) => { imgSrc = gridImages[summon.granblue_id] } else if (process.env.NODE_ENV === 'production') { if (props.unitType == 0 || props.unitType == 2) - imgSrc = `${process.env.SIERO_IMG_URL}/summon-main/${summon.granblue_id}.jpg` + imgSrc = `${process.env.REACT_APP_SIERO_IMG_URL}/summon-main/${summon.granblue_id}.jpg` else - imgSrc = `${process.env.SIERO_IMG_URL}/summon-grid/${summon.granblue_id}.jpg` + imgSrc = `${process.env.REACT_APP_SIERO_IMG_URL}/summon-grid/${summon.granblue_id}.jpg` } } diff --git a/src/components/WeaponResult/index.tsx b/src/components/WeaponResult/index.tsx index 268e20a7..dc73aeb7 100644 --- a/src/components/WeaponResult/index.tsx +++ b/src/components/WeaponResult/index.tsx @@ -21,7 +21,7 @@ class WeaponResult extends React.Component { if (process.env.NODE_ENV === 'development') { imgSrc = gridImages[weapon.granblue_id] } else if (process.env.NODE_ENV === 'production') { - imgSrc = `${process.env.SIERO_IMG_URL}/weapon-grid/${weapon.granblue_id}.jpg` + imgSrc = `${process.env.REACT_APP_SIERO_IMG_URL}/weapon-grid/${weapon.granblue_id}.jpg` } return ( diff --git a/src/components/WeaponUnit/index.tsx b/src/components/WeaponUnit/index.tsx index 2790276f..1db22a69 100644 --- a/src/components/WeaponUnit/index.tsx +++ b/src/components/WeaponUnit/index.tsx @@ -53,9 +53,9 @@ const WeaponUnit = (props: Props) => { imgSrc = gridImages[weapon.granblue_id] } else if (process.env.NODE_ENV === 'production') { if (props.unitType == 0) - imgSrc = `${process.env.SIERO_IMG_URL}/weapon-main/${weapon.granblue_id}.jpg` + imgSrc = `${process.env.REACT_APP_SIERO_IMG_URL}/weapon-main/${weapon.granblue_id}.jpg` else - imgSrc = `${process.env.SIERO_IMG_URL}/weapon-grid/${weapon.granblue_id}.jpg` + imgSrc = `${process.env.REACT_APP_SIERO_IMG_URL}/weapon-grid/${weapon.granblue_id}.jpg` } } diff --git a/src/utils/api.tsx b/src/utils/api.tsx index 52eb76ff..b7b50a73 100644 --- a/src/utils/api.tsx +++ b/src/utils/api.tsx @@ -46,7 +46,7 @@ class Api { } login(object: {}) { - return axios.post(`${ process.env.SIERO_OAUTH_URL || 'http://127.0.0.1:3000/oauth' }/token`, object) + return axios.post(`${ process.env.REACT_APP_SIERO_OAUTH_URL || 'http://127.0.0.1:3000/oauth' }/token`, object) } search(object: string, query: string) { @@ -62,7 +62,7 @@ class Api { } } -const api: Api = new Api({ url: process.env.SIERO_API_URL || 'http://127.0.0.1:3000/api/v1' }) +const api: Api = new Api({ url: process.env.REACT_APP_SIERO_API_URL || 'http://127.0.0.1:3000/api/v1' }) api.createEntity( { name: 'users' }) api.createEntity( { name: 'parties' }) api.createEntity( { name: 'characters' })