Update global vars

This commit is contained in:
Justin Edmund 2022-01-14 20:37:46 -08:00
parent e8088bc0d1
commit 83a3e45315
9 changed files with 15 additions and 15 deletions

View file

@ -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=''
REACT_APP_SIERO_API_URL=''
REACT_APP_SIERO_OAUTH_URL=''
REACT_APP_SIERO_IMG_URL=''

View file

@ -20,7 +20,7 @@ class CharacterResult extends React.Component<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-grid/${character.granblue_id}.jpg`
imgSrc = `${process.env.REACT_APP_SIERO_IMG_URL}/chara-grid/${character.granblue_id}.jpg`
}
return (

View file

@ -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`
}
}

View file

@ -43,7 +43,7 @@ const GridRep = (props: Props) => {
? <img src={
process.env.NODE_ENV === 'development'
? mainhandImages[mainhand?.granblue_id || 0]
: `${process.env.SIERO_IMG_URL}/weapon-main/${mainhand?.granblue_id}.jpg`
: `${process.env.REACT_APP_SIERO_IMG_URL}/weapon-main/${mainhand?.granblue_id}.jpg`
} />
: <img />
}
@ -53,7 +53,7 @@ const GridRep = (props: Props) => {
? <img src={
process.env.NODE_ENV === 'development'
? gridImages[weapons[position]?.granblue_id || 0]
: `${process.env.SIERO_IMG_URL}/weapon-grid/${weapons[position]?.granblue_id}.jpg`
: `${process.env.REACT_APP_SIERO_IMG_URL}/weapon-grid/${weapons[position]?.granblue_id}.jpg`
} />
: <img />
}

View file

@ -20,7 +20,7 @@ class SummonResult extends React.Component<Props> {
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 (

View file

@ -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`
}
}

View file

@ -21,7 +21,7 @@ class WeaponResult extends React.Component<Props> {
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 (

View file

@ -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`
}
}

View file

@ -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' })