Fix profiles and saving grids to accounts
This commit is contained in:
parent
931925a72e
commit
70461a0e6d
4 changed files with 10 additions and 7 deletions
|
|
@ -29,6 +29,7 @@
|
||||||
|
|
||||||
.GridRep .grid_weapons {
|
.GridRep .grid_weapons {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@ import React, { useEffect, useState } from 'react'
|
||||||
|
|
||||||
import './index.css'
|
import './index.css'
|
||||||
|
|
||||||
import mainhandImages from '../../images/mainhand/*.jpg'
|
import mainhandImages from '../../images/weapon-main/*.jpg'
|
||||||
import gridImages from '../../images/grid/*.jpg'
|
import gridImages from '../../images/weapon-grid/*.jpg'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
shortcode: string
|
shortcode: string
|
||||||
|
|
@ -43,7 +43,7 @@ const GridRep = (props: Props) => {
|
||||||
? <img src={
|
? <img src={
|
||||||
process.env.NODE_ENV === 'development'
|
process.env.NODE_ENV === 'development'
|
||||||
? mainhandImages[mainhand?.granblue_id || 0]
|
? mainhandImages[mainhand?.granblue_id || 0]
|
||||||
: `${process.env.SIERO_IMG_URL}/mainhand/${mainhand?.granblue_id}.jpg`
|
: `${process.env.SIERO_IMG_URL}/weapon-main/${mainhand?.granblue_id}.jpg`
|
||||||
} />
|
} />
|
||||||
: <img />
|
: <img />
|
||||||
}
|
}
|
||||||
|
|
@ -53,7 +53,7 @@ const GridRep = (props: Props) => {
|
||||||
? <img src={
|
? <img src={
|
||||||
process.env.NODE_ENV === 'development'
|
process.env.NODE_ENV === 'development'
|
||||||
? gridImages[weapons[position]?.granblue_id || 0]
|
? gridImages[weapons[position]?.granblue_id || 0]
|
||||||
: `${process.env.SIERO_IMG_URL}/grid/${weapons[position]?.granblue_id}.jpg`
|
: `${process.env.SIERO_IMG_URL}/weapon-grid/${weapons[position]?.granblue_id}.jpg`
|
||||||
} />
|
} />
|
||||||
: <img />
|
: <img />
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,12 +35,14 @@ interface Props {
|
||||||
const Party = (props: Props) => {
|
const Party = (props: Props) => {
|
||||||
const [cookies, setCookie] = useCookies(['user'])
|
const [cookies, setCookie] = useCookies(['user'])
|
||||||
|
|
||||||
const headers = (cookies.user) ? {
|
const headers = (cookies.user != null) ? {
|
||||||
headers: {
|
headers: {
|
||||||
'Authorization': `Bearer ${cookies.user.access_token}`
|
'Authorization': `Bearer ${cookies.user.access_token}`
|
||||||
}
|
}
|
||||||
} : {}
|
} : {}
|
||||||
|
|
||||||
|
console.log(headers)
|
||||||
|
|
||||||
// Grid data
|
// Grid data
|
||||||
const [characters, setCharacters] = useState<GridArray<Character>>({})
|
const [characters, setCharacters] = useState<GridArray<Character>>({})
|
||||||
const [weapons, setWeapons] = useState<GridArray<Weapon>>({})
|
const [weapons, setWeapons] = useState<GridArray<Weapon>>({})
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ interface User {
|
||||||
interface Party {
|
interface Party {
|
||||||
id: string
|
id: string
|
||||||
shortcode: string
|
shortcode: string
|
||||||
grid: GridWeapon[]
|
weapons: GridWeapon[]
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ProfileProps extends RouteComponentProps<Props> {}
|
interface ProfileProps extends RouteComponentProps<Props> {}
|
||||||
|
|
@ -90,7 +90,7 @@ const ProfileRoute: React.FC<ProfileProps> = ({ history, match }) => {
|
||||||
parties.map((party, i) => {
|
parties.map((party, i) => {
|
||||||
return <GridRep
|
return <GridRep
|
||||||
shortcode={party.shortcode}
|
shortcode={party.shortcode}
|
||||||
grid={party.grid}
|
grid={party.weapons}
|
||||||
key={`party-${i}`}
|
key={`party-${i}`}
|
||||||
onClick={navigate}
|
onClick={navigate}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue