mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-08-24 12:06:54 -05:00
added antd
This commit is contained in:
15
react-ui/config-overrides.js
vendored
Normal file
15
react-ui/config-overrides.js
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
// https://ant.design/docs/react/use-with-create-react-app
|
||||
|
||||
const { override, fixBabelImports, addLessLoader } = require("customize-cra")
|
||||
|
||||
module.exports = override(
|
||||
fixBabelImports("import", {
|
||||
libraryName: "antd",
|
||||
libraryDirectory: "es",
|
||||
style: true
|
||||
}),
|
||||
addLessLoader({
|
||||
javascriptEnabled: true,
|
||||
modifyVars: { '@primary-color': '#141163'}
|
||||
})
|
||||
)
|
||||
1095
react-ui/package-lock.json
generated
1095
react-ui/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -4,25 +4,34 @@
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@apollo/react-hooks": "^3.0.0",
|
||||
"antd": "^3.21.4",
|
||||
"apollo-boost": "^0.4.3",
|
||||
"apollo-link": "^1.2.12",
|
||||
"apollo-link-context": "^1.0.18",
|
||||
"babel-plugin-import": "^1.12.0",
|
||||
"customize-cra": "^0.5.0",
|
||||
"graphql": "^14.4.2",
|
||||
"jstz": "^2.1.1",
|
||||
"less": "^3.9.0",
|
||||
"less-loader": "^5.0.0",
|
||||
"react": "^16.9.0",
|
||||
"react-app-rewired": "^2.1.3",
|
||||
"react-color": "^2.17.3",
|
||||
"react-dom": "^16.9.0",
|
||||
"react-localization": "^1.0.15",
|
||||
"react-redux": "^7.1.0",
|
||||
"react-router": "^5.0.1",
|
||||
"react-router-dom": "^5.0.1",
|
||||
"react-scripts": "3.0.0",
|
||||
"react-sketch": "^0.5.1",
|
||||
"recharts": "^1.7.0",
|
||||
"redux": "^4.0.4",
|
||||
"semantic-ui-react": "^0.86.0"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "react-scripts start",
|
||||
"build": "react-scripts build && move build ../build",
|
||||
"test": "react-scripts test",
|
||||
"start": "react-app-rewired start",
|
||||
"build": "react-app-rewired build && move build ../build",
|
||||
"test": "react-app-rewired test",
|
||||
"eject": "react-scripts eject"
|
||||
},
|
||||
"eslintConfig": {
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
-->
|
||||
<title>sendou.ink</title>
|
||||
</head>
|
||||
<body style="background-color: #f2f7fd">
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<div id="root"></div>
|
||||
<!--
|
||||
|
||||
7
react-ui/src/components/Misc/HomePage.js
vendored
7
react-ui/src/components/Misc/HomePage.js
vendored
@@ -1,6 +1,8 @@
|
||||
import React from "react"
|
||||
import React, { useState } from "react"
|
||||
import { Header, Image, Segment } from "semantic-ui-react"
|
||||
import { Link } from "react-router-dom"
|
||||
import { useSelector } from 'react-redux'
|
||||
import { Button } from 'antd'
|
||||
import koshienBanner from "../img/misc/koshienBanner.png"
|
||||
|
||||
const HomePage = ({ setMenuSelection }) => {
|
||||
@@ -11,7 +13,6 @@ const HomePage = ({ setMenuSelection }) => {
|
||||
<div style={{ padding: "5px" }}>
|
||||
<div style={{ textAlign: "center" }}>
|
||||
<Header as="h2">
|
||||
Welcome to sendou.ink!
|
||||
<Header sub>Competitive Splatoon Hub</Header>
|
||||
</Header>
|
||||
</div>
|
||||
@@ -30,7 +31,7 @@ const HomePage = ({ setMenuSelection }) => {
|
||||
- Generate a maplist to use when scrimming. You can choose the map
|
||||
pool to be used including monthly ranked maps or an upcoming event.
|
||||
Any maps you don't feel like you need to practice can be excluded
|
||||
from the pool.
|
||||
from the pool. <Button type='primary'>Buttoni</Button>
|
||||
</div>
|
||||
<div style={{ paddingTop: "15px" }}>
|
||||
<b>
|
||||
|
||||
2
react-ui/src/components/Misc/MainMenu.js
vendored
2
react-ui/src/components/Misc/MainMenu.js
vendored
@@ -3,7 +3,7 @@ import { Menu, Button, Image, Dropdown } from 'semantic-ui-react'
|
||||
import { useQuery } from '@apollo/react-hooks'
|
||||
import { userLean } from '../../graphql/queries/userLean'
|
||||
import { withRouter } from 'react-router-dom'
|
||||
import memcake from '../img/misc/memcake.png'
|
||||
import memcake from '../img/misc/sink_logo.png'
|
||||
|
||||
const MainMenu = withRouter(({ history, menuSelection, setMenuSelection }) => {
|
||||
const { data, error, loading } = useQuery(userLean)
|
||||
|
||||
@@ -3,7 +3,7 @@ import WeaponForm from '../XSearch/WeaponForm'
|
||||
import BuildCollection from './BuildCollection'
|
||||
|
||||
const BuildSearch = ({ setMenuSelection, weaponFromUrl }) => {
|
||||
const [weapon, setWeapon] = useState(weaponFromUrl ? weaponFromUrl : '')
|
||||
const [weapon, setWeapon] = useState(weaponFromUrl)
|
||||
const [page, setPage] = useState(1)
|
||||
|
||||
useEffect(() => {
|
||||
@@ -17,7 +17,7 @@ const BuildSearch = ({ setMenuSelection, weaponFromUrl }) => {
|
||||
<WeaponForm weaponForm={weapon} setWeaponForm={setWeapon} push setPage={setPage} />
|
||||
</div>
|
||||
<div>
|
||||
{weapon === '' ? null : <BuildCollection weapon={weapon} page={page} setPage={setPage} />}
|
||||
{!weapon ? null : <BuildCollection weapon={weapon} page={page} setPage={setPage} />}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
171
react-ui/src/components/elements/Select.js
vendored
Normal file
171
react-ui/src/components/elements/Select.js
vendored
Normal file
@@ -0,0 +1,171 @@
|
||||
import React from 'react'
|
||||
import { useSelector } from 'react-redux'
|
||||
import { Select } from 'antd';
|
||||
|
||||
const { Option, OptGroup } = Select;
|
||||
|
||||
const mainWeapons = [
|
||||
{
|
||||
categoryName: "Shooters",
|
||||
weapons: ["Sploosh-o-matic", "Neo Sploosh-o-matic", "Sploosh-o-matic 7",
|
||||
"Splattershot Jr.", "Custom Splattershot Jr.", "Kensa Splattershot Jr.",
|
||||
"Splash-o-matic", "Neo Splash-o-matic", "Aerospray MG", "Aerospray RG",
|
||||
"Aerospray PG", "Splattershot", "Tentatek Splattershot", "Kensa Splattershot",
|
||||
".52 Gal", ".52 Gal Deco", "Kensa .52 Gal", "N-ZAP '85", "N-ZAP '89",
|
||||
"N-ZAP '83", "Splattershot Pro", "Forge Splattershot Pro", "Kensa Splattershot Pro",
|
||||
".96 Gal", ".96 Gal Deco", "Jet Squelcher", "Custom Jet Squelcher", "L-3 Nozzlenose", "L-3 Nozzlenose D", "Kensa L-3 Nozzlenose",
|
||||
"H-3 Nozzlenose", "H-3 Nozzlenose D", "Cherry H-3 Nozzlenose", "Squeezer",
|
||||
"Foil Squeezer"]
|
||||
},
|
||||
{
|
||||
categoryName: "Blasters",
|
||||
weapons: ["Luna Blaster", "Luna Blaster Neo", "Kensa Luna Blaster",
|
||||
"Blaster", "Custom Blaster", "Range Blaster", "Custom Range Blaster",
|
||||
"Grim Range Blaster", "Rapid Blaster", "Rapid Blaster Deco", "Kensa Rapid Blaster",
|
||||
"Rapid Blaster Pro", "Rapid Blaster Pro Deco", "Clash Blaster", "Clash Blaster Neo"]
|
||||
},
|
||||
{
|
||||
categoryName: "Rollers",
|
||||
weapons: ["Carbon Roller", "Carbon Roller Deco", "Splat Roller", "Krak-On Splat Roller",
|
||||
"Kensa Splat Roller", "Dynamo Roller", "Gold Dynamo Roller", "Kensa Dynamo Roller",
|
||||
"Flingza Roller", "Foil Flingza Roller"]
|
||||
},
|
||||
{
|
||||
categoryName: "Brushes",
|
||||
weapons: ["Inkbrush", "Inkbrush Nouveau",
|
||||
"Permanent Inkbrush", "Octobrush", "Octobrush Nouveau", "Kensa Octobrush"]
|
||||
},
|
||||
{
|
||||
categoryName: "Chargers",
|
||||
weapons: ["Classic Squiffer", "New Squiffer", "Fresh Squiffer", "Splat Charger",
|
||||
"Firefin Splat Charger", "Kensa Charger", "Splatterscope", "Firefin Splatterscope",
|
||||
"Kensa Splatterscope", "E-liter 4K", "Custom E-liter 4K", "E-liter 4K Scope",
|
||||
"Custom E-liter 4K Scope", "Bamboozler 14 Mk I", "Bamboozler 14 Mk II",
|
||||
"Bamboozler 14 Mk III", "Goo Tuber", "Custom Goo Tuber"]
|
||||
},
|
||||
{
|
||||
categoryName: "Splatlings",
|
||||
weapons: ["Mini Splatling", "Zink Mini Splatling", "Kensa Mini Splatling",
|
||||
"Heavy Splatling", "Heavy Splatling Deco", "Heavy Splatling Remix",
|
||||
"Hydra Splatling", "Custom Hydra Splatling", "Ballpoint Splatling",
|
||||
"Ballpoint Splatling Nouveau", "Nautilus 47", "Nautilus 79"]
|
||||
},
|
||||
{
|
||||
categoryName: "Sloshers",
|
||||
weapons: ["Slosher", "Slosher Deco", "Soda Slosher", "Tri-Slosher",
|
||||
"Tri-Slosher Nouveau", "Sloshing Machine", "Sloshing Machine Neo",
|
||||
"Kensa Sloshing Machine", "Bloblobber", "Bloblobber Deco", "Explosher",
|
||||
"Custom Explosher"]
|
||||
},
|
||||
{
|
||||
categoryName: "Dualies",
|
||||
weapons: ["Dapple Dualies", "Dapple Dualies Nouveau", "Clear Dapple Dualies",
|
||||
"Splat Dualies", "Enperry Splat Dualies", "Kensa Splat Dualies", "Glooga Dualies",
|
||||
"Glooga Dualies Deco", "Kensa Glooga Dualies", "Dualie Squelchers",
|
||||
"Custom Dualie Squelchers", "Dark Tetra Dualies", "Light Tetra Dualies"]
|
||||
},
|
||||
{
|
||||
categoryName: "Brellas",
|
||||
weapons: ["Splat Brella", "Sorella Brella", "Tenta Brella", "Tenta Sorella Brella",
|
||||
"Tenta Camo Brella", "Undercover Brella", "Undercover Sorella Brella", "Kensa Undercover Brella"]
|
||||
}
|
||||
]
|
||||
|
||||
const allWeapons = [
|
||||
{
|
||||
categoryName: "Shooters",
|
||||
weapons: ["Sploosh-o-matic", "Neo Sploosh-o-matic", "Sploosh-o-matic 7",
|
||||
"Splattershot Jr.", "Custom Splattershot Jr.", "Kensa Splattershot Jr.",
|
||||
"Splash-o-matic", "Neo Splash-o-matic", "Aerospray MG", "Aerospray RG",
|
||||
"Aerospray PG", "Splattershot", "Tentatek Splattershot", "Kensa Splattershot",
|
||||
".52 Gal", ".52 Gal Deco", "Kensa .52 Gal", "N-ZAP '85", "N-ZAP '89",
|
||||
"N-ZAP '83", "Splattershot Pro", "Forge Splattershot Pro", "Kensa Splattershot Pro",
|
||||
".96 Gal", ".96 Gal Deco", "Jet Squelcher", "Custom Jet Squelcher", "L-3 Nozzlenose", "L-3 Nozzlenose D", "Kensa L-3 Nozzlenose",
|
||||
"H-3 Nozzlenose", "H-3 Nozzlenose D", "Cherry H-3 Nozzlenose", "Squeezer",
|
||||
"Foil Squeezer"]
|
||||
},
|
||||
{
|
||||
categoryName: "Blasters",
|
||||
weapons: ["Luna Blaster", "Luna Blaster Neo", "Kensa Luna Blaster",
|
||||
"Blaster", "Custom Blaster", "Range Blaster", "Custom Range Blaster",
|
||||
"Grim Range Blaster", "Rapid Blaster", "Rapid Blaster Deco", "Kensa Rapid Blaster",
|
||||
"Rapid Blaster Pro", "Rapid Blaster Pro Deco", "Clash Blaster", "Clash Blaster Neo"]
|
||||
},
|
||||
{
|
||||
categoryName: "Rollers",
|
||||
weapons: ["Carbon Roller", "Carbon Roller Deco", "Splat Roller", "Krak-On Splat Roller",
|
||||
"Kensa Splat Roller", "Dynamo Roller", "Gold Dynamo Roller", "Kensa Dynamo Roller",
|
||||
"Flingza Roller", "Foil Flingza Roller"]
|
||||
},
|
||||
{
|
||||
categoryName: "Brushes",
|
||||
weapons: ["Inkbrush", "Inkbrush Nouveau",
|
||||
"Permanent Inkbrush", "Octobrush", "Octobrush Nouveau", "Kensa Octobrush"]
|
||||
},
|
||||
{
|
||||
categoryName: "Chargers",
|
||||
weapons: ["Classic Squiffer", "New Squiffer", "Fresh Squiffer", "Splat Charger",
|
||||
"Firefin Splat Charger", "Kensa Charger", "Splatterscope", "Firefin Splatterscope",
|
||||
"Kensa Splatterscope", "E-liter 4K", "Custom E-liter 4K", "E-liter 4K Scope",
|
||||
"Custom E-liter 4K Scope", "Bamboozler 14 Mk I", "Bamboozler 14 Mk II",
|
||||
"Bamboozler 14 Mk III", "Goo Tuber", "Custom Goo Tuber"]
|
||||
},
|
||||
{
|
||||
categoryName: "Splatlings",
|
||||
weapons: ["Mini Splatling", "Zink Mini Splatling", "Kensa Mini Splatling",
|
||||
"Heavy Splatling", "Heavy Splatling Deco", "Heavy Splatling Remix",
|
||||
"Hydra Splatling", "Custom Hydra Splatling", "Ballpoint Splatling",
|
||||
"Ballpoint Splatling Nouveau", "Nautilus 47", "Nautilus 79"]
|
||||
},
|
||||
{
|
||||
categoryName: "Sloshers",
|
||||
weapons: ["Slosher", "Slosher Deco", "Soda Slosher", "Tri-Slosher",
|
||||
"Tri-Slosher Nouveau", "Sloshing Machine", "Sloshing Machine Neo",
|
||||
"Kensa Sloshing Machine", "Bloblobber", "Bloblobber Deco", "Explosher",
|
||||
"Custom Explosher"]
|
||||
},
|
||||
{
|
||||
categoryName: "Dualies",
|
||||
weapons: ["Dapple Dualies", "Dapple Dualies Nouveau", "Clear Dapple Dualies",
|
||||
"Splat Dualies", "Enperry Splat Dualies", "Kensa Splat Dualies", "Glooga Dualies",
|
||||
"Glooga Dualies Deco", "Kensa Glooga Dualies", "Dualie Squelchers",
|
||||
"Custom Dualie Squelchers", "Dark Tetra Dualies", "Light Tetra Dualies"]
|
||||
},
|
||||
{
|
||||
categoryName: "Brellas",
|
||||
weapons: ["Splat Brella", "Sorella Brella", "Tenta Brella", "Tenta Sorella Brella",
|
||||
"Tenta Camo Brella", "Undercover Brella", "Undercover Sorella Brella", "Kensa Undercover Brella"]
|
||||
},
|
||||
{
|
||||
categoryName: "Sub weapons",
|
||||
weapons: ["Splat Bomb", "Suction Bomb", "Burst Bomb", "Curling Bomb", "Autobomb", "Ink Mine", "Toxic Mist", "Point Sensor", "Splash Wall", "Sprinkler", "Squid Beakon", "Fizzy Bomb", "Torpedo"]
|
||||
},
|
||||
{
|
||||
categoryName: "Special weapons",
|
||||
weapons: ["Tenta Missiles", "Sting Ray", "Inkjet", "Splashdown", "Ink Armor", "Ink Storm", "Baller", "Bubble Blower", "Booyah Bomb", "Ultra Stamp", "Splat-Bomb Launcher", "Suction-Bomb Launcher", "Curling-Bomb Launcher", "Burst-Bomb Launcher", "Autobomb Launcher"]
|
||||
},
|
||||
]
|
||||
|
||||
const SelectElement = ({ onChange, content }) => {
|
||||
const localization = useSelector(state => state.localization)
|
||||
let contentArr = null
|
||||
if (content === "MAINWEAPONS") contentArr = mainWeapons
|
||||
else if (content === "ALLWEAPONS") contentArr = allWeapons
|
||||
return (
|
||||
<Select style={{ width: 200 }} onChange={onChange} showSearch>
|
||||
{contentArr.map(c => {
|
||||
return (
|
||||
<OptGroup key={c.categoryName} label={localization[c.categoryName]}>
|
||||
{c.weapons.map(w => {
|
||||
return (
|
||||
<Option key={w} value={w}>{localization[w]}</Option>
|
||||
)
|
||||
})}
|
||||
</OptGroup>
|
||||
)
|
||||
})}
|
||||
</Select>
|
||||
)
|
||||
}
|
||||
|
||||
export default SelectElement
|
||||
BIN
react-ui/src/components/img/misc/sink_logo.png
Normal file
BIN
react-ui/src/components/img/misc/sink_logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
@@ -1,14 +1,12 @@
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 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;
|
||||
html {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
code {
|
||||
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
|
||||
monospace;
|
||||
body {
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
background: rgb(96,221,142);
|
||||
background: linear-gradient(180deg, rgba(96,221,142,1) 0%, rgba(27,141,141,1) 25%, rgba(20,17,99,1) 100%);
|
||||
background-repeat: no-repeat;
|
||||
background-attachment: fixed;
|
||||
}
|
||||
|
||||
11
react-ui/src/index.js
vendored
11
react-ui/src/index.js
vendored
@@ -1,11 +1,14 @@
|
||||
import React from 'react'
|
||||
import ReactDOM from 'react-dom'
|
||||
import App from './App'
|
||||
import { Provider } from 'react-redux'
|
||||
import { ApolloProvider } from '@apollo/react-hooks'
|
||||
import { ApolloClient } from 'apollo-client'
|
||||
import { createHttpLink } from 'apollo-link-http'
|
||||
import { InMemoryCache } from 'apollo-cache-inmemory'
|
||||
import { setContext } from 'apollo-link-context'
|
||||
import store from './store'
|
||||
import './index.css'
|
||||
|
||||
const httpLink = createHttpLink({
|
||||
uri: '/graphql',
|
||||
@@ -28,8 +31,10 @@ const client = new ApolloClient({
|
||||
})
|
||||
|
||||
ReactDOM.render(
|
||||
<ApolloProvider client={client}>
|
||||
<App />
|
||||
</ApolloProvider>,
|
||||
<Provider store={store}>
|
||||
<ApolloProvider client={client}>
|
||||
<App />
|
||||
</ApolloProvider>
|
||||
</Provider>,
|
||||
document.getElementById('root')
|
||||
)
|
||||
|
||||
35
react-ui/src/reducers/languageReducer.js
vendored
Normal file
35
react-ui/src/reducers/languageReducer.js
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
import LocalizedStrings from 'react-localization'
|
||||
import translation from '../translation.json'
|
||||
|
||||
const initialState = () => {
|
||||
const strings = new LocalizedStrings(translation)
|
||||
const languagePreference = window.localStorage.getItem(
|
||||
"languagePreference"
|
||||
)
|
||||
if (languagePreference) strings.setLanguage(languagePreference)
|
||||
return strings
|
||||
}
|
||||
|
||||
const languageReducer = (state = initialState(), action) => {
|
||||
switch (action.type) {
|
||||
case 'SET_LANGUAGE':
|
||||
const newStringsObj = action.state
|
||||
newStringsObj.setLanguage(action.languageCode)
|
||||
window.localStorage.setItem(
|
||||
"languagePreference",
|
||||
action.languageCode
|
||||
)
|
||||
return action.filter
|
||||
default:
|
||||
return state
|
||||
}
|
||||
}
|
||||
|
||||
export const languageChange = (languageCode) => {
|
||||
return {
|
||||
type: 'SET_LANGUAGE',
|
||||
languageCode,
|
||||
}
|
||||
}
|
||||
|
||||
export default languageReducer
|
||||
11
react-ui/src/store.js
vendored
Normal file
11
react-ui/src/store.js
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import { createStore, combineReducers } from 'redux'
|
||||
|
||||
import languageReducer from './reducers/languageReducer'
|
||||
|
||||
const reducer = combineReducers({
|
||||
localization: languageReducer,
|
||||
})
|
||||
|
||||
const store = createStore(reducer)
|
||||
|
||||
export default store
|
||||
7067
react-ui/src/translation.json
Normal file
7067
react-ui/src/translation.json
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user