This repository has been archived by the owner on Jun 20, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ start basic api client implementation
- Loading branch information
1 parent
6b8fe99
commit 71f500f
Showing
16 changed files
with
116 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
REACT_APP_BASE_URL= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,5 @@ | |
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module.exports = { | ||
style: { | ||
postcss: { | ||
plugins: [ | ||
require('tailwindcss'), | ||
require('autoprefixer'), | ||
], | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,21 @@ | ||
import logo from './logo.svg'; | ||
import './App.css'; | ||
import {useEffect} from "react"; | ||
import {getTypes, moblist} from "./api/base"; | ||
|
||
function App() { | ||
return ( | ||
<div className="App"> | ||
<header className="App-header"> | ||
<img src={logo} className="App-logo" alt="logo" /> | ||
<p> | ||
Edit <code>src/App.js</code> and save to reload. | ||
</p> | ||
<a | ||
className="App-link" | ||
href="https://reactjs.org" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
Learn React | ||
</a> | ||
</header> | ||
</div> | ||
); | ||
useEffect(() => { | ||
(async () => { | ||
console.log(await moblist()) | ||
})() | ||
}) | ||
|
||
return ( | ||
<div className="min-h-screen flex justify-center items-center"> | ||
<div> | ||
<p>🧛 Blood Night Web</p> | ||
<p>{window.location.hash}</p> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default App; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React, {useEffect, useState} from 'react'; | ||
|
||
const ErrorUi = () => { | ||
const [err, setErr] = useState(""); | ||
|
||
return ( | ||
<div> | ||
{err} | ||
</div> | ||
); | ||
}; | ||
|
||
export default ErrorUi; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import {tokenHeader} from "./util"; | ||
|
||
export async function getTypes() { | ||
return await fetch(process.env.REACT_APP_BASE_URL + "/types") | ||
.then(response => response.json()) | ||
} | ||
|
||
export async function moblist() { | ||
return await fetch(process.env.REACT_APP_BASE_URL + "/moblist", {headers: tokenHeader()}) | ||
.then(response => response.json()) | ||
} | ||
|
||
export async function getMobSettings(identifier) { | ||
return await fetch(process.env.REACT_APP_BASE_URL + "/mobsettings/" + identifier, {headers: tokenHeader()}) | ||
.then(response => response.json()) | ||
} | ||
|
||
export async function createMobSettings(identifier) { | ||
return await fetch(process.env.REACT_APP_BASE_URL + "/mobsettings/" + identifier, {headers: tokenHeader(), method: "POST"}) | ||
} | ||
|
||
export async function deleteMobSettings(identifier) { | ||
return await fetch(process.env.REACT_APP_BASE_URL + "/mobsettings/" + identifier, {headers: tokenHeader(), method: "DELETE"}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import {createMobSettings, deleteMobSettings, getMobSettings, getTypes, moblist} from "./base"; | ||
|
||
module.exports = [getTypes, moblist, getMobSettings, createMobSettings, deleteMobSettings] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export function tokenHeader() { | ||
return {"token": localStorage.getItem("token")} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,3 @@ | ||
body { | ||
margin: 0; | ||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', | ||
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', | ||
sans-serif; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
} | ||
|
||
code { | ||
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', | ||
monospace; | ||
} | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module.exports = { | ||
mode: 'jit', | ||
purge: ['./src/**/*.{js,jsx,ts,tsx}', './public/index.html'], | ||
darkMode: 'media', // or 'media' or 'class' | ||
theme: { | ||
extend: {}, | ||
}, | ||
variants: { | ||
extend: {}, | ||
}, | ||
plugins: [], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1151,6 +1151,16 @@ | |
exec-sh "^0.3.2" | ||
minimist "^1.2.0" | ||
|
||
"@craco/craco@^6.1.2": | ||
version "6.1.2" | ||
resolved "https://registry.yarnpkg.com/@craco/craco/-/craco-6.1.2.tgz#30e45288e4609ac6b8cf828085b34acebdc60e69" | ||
integrity sha512-GlQZn+g+yNlaDvIL5m6mcCoBGyFDwO4kkNx3fNFf98wuldkdWyBFoQbtOFOIb4gvkTh4VntOOxtJEoZfKs7XXw== | ||
dependencies: | ||
cross-spawn "^7.0.0" | ||
lodash "^4.17.15" | ||
semver "^7.3.2" | ||
webpack-merge "^4.2.2" | ||
|
||
"@csstools/convert-colors@^1.4.0": | ||
version "1.4.0" | ||
resolved "https://registry.yarnpkg.com/@csstools/convert-colors/-/convert-colors-1.4.0.tgz#ad495dc41b12e75d588c6db8b9834f08fa131eb7" | ||
|
@@ -11274,6 +11284,13 @@ [email protected]: | |
object.entries "^1.1.0" | ||
tapable "^1.0.0" | ||
|
||
webpack-merge@^4.2.2: | ||
version "4.2.2" | ||
resolved "https://registry.yarnpkg.com/webpack-merge/-/webpack-merge-4.2.2.tgz#a27c52ea783d1398afd2087f547d7b9d2f43634d" | ||
integrity sha512-TUE1UGoTX2Cd42j3krGYqObZbOD+xF7u28WB7tfUordytSjbWTIjK/8V0amkBfTYN4/pB/GIDlJZZ657BGG19g== | ||
dependencies: | ||
lodash "^4.17.15" | ||
|
||
webpack-sources@^1.1.0, webpack-sources@^1.3.0, webpack-sources@^1.4.0, webpack-sources@^1.4.1, webpack-sources@^1.4.3: | ||
version "1.4.3" | ||
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.4.3.tgz#eedd8ec0b928fbf1cbfe994e22d2d890f330a933" | ||
|