Fix cleanup
I did it wrong
This commit is contained in:
parent
a857076c31
commit
8f0f6399a7
15 changed files with 49 additions and 40 deletions
5
jsconfig.json
Normal file
5
jsconfig.json
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"baseUrl": "src"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import './App.css'
|
import './App.css'
|
||||||
|
|
||||||
import Header from 'components/Header/Header'
|
import Header from '~components/Header/Header'
|
||||||
import Main from 'Main/Main'
|
import Main from '~components/Main/Main'
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Link } from 'react-router-dom'
|
import { Link } from 'react-router-dom'
|
||||||
|
|
||||||
import Button from 'components/Button/Button'
|
import Button from '~components/Button/Button'
|
||||||
import UnauthMenu from 'components/UnauthMenu/UnauthMenu'
|
import UnauthMenu from '~components/UnauthMenu/UnauthMenu'
|
||||||
|
|
||||||
import './Header.css'
|
import './Header.css'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import Portal from '../../Portal'
|
import Portal from '~utils/Portal'
|
||||||
|
|
||||||
import Modal from '../Modal/Modal'
|
import Modal from '~components/Modal/Modal'
|
||||||
import Overlay from '../Overlay/Overlay'
|
import Overlay from '~components/Overlay/Overlay'
|
||||||
|
|
||||||
const LoginModal = (close: () => null ) => {
|
const LoginModal = (close: () => null ) => {
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Switch, Route } from 'react-router-dom'
|
import { Switch, Route } from 'react-router-dom'
|
||||||
|
|
||||||
import New from '../routes/New/New'
|
import New from '~routes/New/New'
|
||||||
import Party from '../routes/Party/Party'
|
import Party from '~routes/Party/Party'
|
||||||
import Parties from '../routes/Parties/Parties'
|
import Parties from '~routes/Parties/Parties'
|
||||||
|
|
||||||
// The Main component renders one of the three provided
|
// The Main component renders one of the three provided
|
||||||
// Routes (provided that one matches). Both the /roster
|
// Routes (provided that one matches). Both the /roster
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import Portal from 'Portal'
|
import Portal from '~utils/Portal'
|
||||||
|
|
||||||
import Modal from 'components/Modal/Modal'
|
import Modal from '~components/Modal/Modal'
|
||||||
import Overlay from 'components/Overlay/Overlay'
|
import Overlay from '~components/Overlay/Overlay'
|
||||||
import WeaponResult from 'components/WeaponResult/WeaponResult'
|
import WeaponResult from '~components/WeaponResult/WeaponResult'
|
||||||
|
|
||||||
import './SearchModal.css'
|
import './SearchModal.css'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import Portal from 'Portal'
|
import Portal from '~utils/Portal'
|
||||||
|
|
||||||
import Modal from 'components/Modal/Modal'
|
import Modal from '~components/Modal/Modal'
|
||||||
import Overlay from 'components/Overlay/Overlay'
|
import Overlay from '~components/Overlay/Overlay'
|
||||||
|
|
||||||
const SignupModal = ({ close }) => {
|
const SignupModal = ({ close }) => {
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import './UnauthMenu.css'
|
import './UnauthMenu.css'
|
||||||
|
|
||||||
import LoginModal from 'components/LoginModal/LoginModal'
|
import LoginModal from '~components/LoginModal/LoginModal'
|
||||||
import SignupModal from 'components/SignupModal/SignupModal'
|
import SignupModal from '~components/SignupModal/SignupModal'
|
||||||
|
|
||||||
import { useModal as useSignupModal } from 'useModal'
|
import { useModal as useSignupModal } from '~utils/useModal'
|
||||||
import { useModal as useLoginModal } from 'useModal'
|
import { useModal as useLoginModal } from '~utils/useModal'
|
||||||
|
|
||||||
function UnauthMenu() {
|
function UnauthMenu() {
|
||||||
const { open: signupOpen, openModal: openSignupModal, closeModal: closeSignupModal } = useSignupModal()
|
const { open: signupOpen, openModal: openSignupModal, closeModal: closeSignupModal } = useSignupModal()
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import React, { useEffect, useState } from 'react'
|
import React, { useEffect, useState } from 'react'
|
||||||
import { withRouter } from 'react-router'
|
import { withRouter } from 'react-router'
|
||||||
|
|
||||||
import WeaponGridMainhand from 'components/WeaponGridMainhand/WeaponGridMainhand'
|
import WeaponGridMainhand from '~components/WeaponGridMainhand/WeaponGridMainhand'
|
||||||
import WeaponGridUnit from 'components/WeaponGridUnit/WeaponGridUnit'
|
import WeaponGridUnit from '~components/WeaponGridUnit/WeaponGridUnit'
|
||||||
|
|
||||||
import './WeaponGrid.css'
|
import './WeaponGrid.css'
|
||||||
|
|
||||||
|
|
@ -15,8 +15,6 @@ interface GridWeapon {
|
||||||
|
|
||||||
type GridArray = { [key: number]: Weapon }
|
type GridArray = { [key: number]: Weapon }
|
||||||
|
|
||||||
const endpoint = process.env.SIERO_API ? process.env.SIERO_API : 'http://127.0.0.1:3000/api/v1'
|
|
||||||
|
|
||||||
const WeaponGrid = (props: null) => {
|
const WeaponGrid = (props: null) => {
|
||||||
const [partyId, setPartyId] = useState<string>()
|
const [partyId, setPartyId] = useState<string>()
|
||||||
const [shortcode, setShortcode] = useState<string>()
|
const [shortcode, setShortcode] = useState<string>()
|
||||||
|
|
@ -43,7 +41,7 @@ const WeaponGrid = (props: null) => {
|
||||||
method: 'GET'
|
method: 'GET'
|
||||||
}
|
}
|
||||||
|
|
||||||
return fetch(`${endpoint}/party/${shortcode}`, options)
|
return fetch(`http://127.0.0.1:3000/api/v1/party/${shortcode}`, options)
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
const grid = data.party.grid
|
const grid = data.party.grid
|
||||||
|
|
@ -120,7 +118,7 @@ const WeaponGrid = (props: null) => {
|
||||||
method: 'POST'
|
method: 'POST'
|
||||||
}
|
}
|
||||||
|
|
||||||
return fetch(`${endpoint}/api/v1/party`, options)
|
return fetch('http://127.0.0.1:3000/api/v1/party', options)
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -140,7 +138,7 @@ const WeaponGrid = (props: null) => {
|
||||||
body: body
|
body: body
|
||||||
}
|
}
|
||||||
|
|
||||||
fetch(`${endpoint}/api/v1/weapons`, options)
|
fetch('http://127.0.0.1:3000/api/v1/weapons', options)
|
||||||
.then(data => {
|
.then(data => {
|
||||||
console.log(data)
|
console.log(data)
|
||||||
})
|
})
|
||||||
|
|
@ -161,7 +159,7 @@ const WeaponGrid = (props: null) => {
|
||||||
body: body
|
body: body
|
||||||
}
|
}
|
||||||
|
|
||||||
fetch(`${endpoint}/api/v1/weapons`, options)
|
fetch('http://127.0.0.1:3000/api/v1/weapons', options)
|
||||||
.then(data => {
|
.then(data => {
|
||||||
console.log(data)
|
console.log(data)
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import React, { useEffect } from 'react'
|
import React, { useEffect } from 'react'
|
||||||
import SearchModal from 'components/SearchModal/SearchModal'
|
import SearchModal from '~components/SearchModal/SearchModal'
|
||||||
import { useModal as useModal } from 'useModal'
|
import { useModal as useModal } from '~utils/useModal'
|
||||||
|
|
||||||
import mainhandImages from 'images/mainhand/*.jpg'
|
import mainhandImages from '../../images/mainhand/*.jpg'
|
||||||
import Plus from '../../../assets/plus.svg'
|
import Plus from '../../../assets/plus.svg'
|
||||||
|
|
||||||
import './WeaponGridMainhand.css'
|
import './WeaponGridMainhand.css'
|
||||||
|
|
@ -14,10 +14,16 @@ function WeaponGridMainhand(props: WeaponGridProps) {
|
||||||
console.log('Mainhand weapon prop was updated.')
|
console.log('Mainhand weapon prop was updated.')
|
||||||
}, [props.weapon])
|
}, [props.weapon])
|
||||||
|
|
||||||
|
let imgSrc
|
||||||
|
if (props.weapon) {
|
||||||
|
const weapon = props.weapon!
|
||||||
|
imgSrc = mainhandImages[weapon.granblue_id]
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<div className="WeaponGridMainhand" onClick={openModal}>
|
<div className="WeaponGridMainhand" onClick={openModal}>
|
||||||
<img className="grid_image" src={mainhandImages[props.weapon?.granblue_id]} />
|
<img className="grid_image" src={imgSrc} />
|
||||||
<span className='icon'><Plus /></span>
|
<span className='icon'><Plus /></span>
|
||||||
</div>
|
</div>
|
||||||
{open ? (
|
{open ? (
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import SearchModal from 'components/SearchModal/SearchModal'
|
import SearchModal from '~components/SearchModal/SearchModal'
|
||||||
import { useModal as useModal } from 'useModal'
|
import { useModal as useModal } from '~utils/useModal'
|
||||||
|
|
||||||
import gridImages from 'images/grid/*.jpg'
|
import gridImages from '../../images/grid/*.jpg'
|
||||||
import Plus from '../../../assets/plus.svg'
|
import Plus from '../../../assets/plus.svg'
|
||||||
|
|
||||||
import './WeaponGridUnit.css'
|
import './WeaponGridUnit.css'
|
||||||
|
|
@ -10,7 +10,7 @@ import './WeaponGridUnit.css'
|
||||||
function WeaponGridUnit(props: WeaponGridProps) {
|
function WeaponGridUnit(props: WeaponGridProps) {
|
||||||
const { open, openModal, closeModal } = useModal()
|
const { open, openModal, closeModal } = useModal()
|
||||||
|
|
||||||
let imgSrc = ''
|
let imgSrc
|
||||||
if (props.weapon) {
|
if (props.weapon) {
|
||||||
const weapon = props.weapon!
|
const weapon = props.weapon!
|
||||||
imgSrc = gridImages[weapon.granblue_id]
|
imgSrc = gridImages[weapon.granblue_id]
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import WeaponLabelIcon from 'components/WeaponLabelIcon/WeaponLabelIcon'
|
import WeaponLabelIcon from '~components/WeaponLabelIcon/WeaponLabelIcon'
|
||||||
|
|
||||||
import gridImages from 'images/grid/*.jpg'
|
import gridImages from '../../images/grid/*.jpg'
|
||||||
|
|
||||||
import './WeaponResult.css'
|
import './WeaponResult.css'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import React from 'react'
|
||||||
import ReactDOM from 'react-dom'
|
import ReactDOM from 'react-dom'
|
||||||
import { BrowserRouter } from 'react-router-dom'
|
import { BrowserRouter } from 'react-router-dom'
|
||||||
|
|
||||||
import App from 'components/App/App'
|
import App from './components/App/App'
|
||||||
|
|
||||||
ReactDOM.render((
|
ReactDOM.render((
|
||||||
<BrowserRouter>
|
<BrowserRouter>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue