Compare commits
3 Commits
46fd498c32
...
2645bb054c
| Author | SHA1 | Date | |
|---|---|---|---|
|
2645bb054c
|
|||
|
8e11a2fb56
|
|||
|
92d6f451ec
|
@@ -456,7 +456,7 @@ function ChemistryDnDMobile({ user, teams, players }: PlayerInfoProps) {
|
|||||||
<div className="column">
|
<div className="column">
|
||||||
<div className="box">
|
<div className="box">
|
||||||
<p className="subtitle is-6 is-uppercase has-text-weight-light">
|
<p className="subtitle is-6 is-uppercase has-text-weight-light">
|
||||||
yes, please ♥️
|
♥️
|
||||||
</p>
|
</p>
|
||||||
<PlayerList
|
<PlayerList
|
||||||
list={playersRight}
|
list={playersRight}
|
||||||
@@ -513,22 +513,24 @@ export default function Rankings() {
|
|||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="container block">
|
<section className="section">
|
||||||
<p className="notification is-warning is-light">
|
<div className="container block">
|
||||||
assign as many or as few players as you want and don't forget to 💾
|
<p className="notification is-warning is-light">
|
||||||
<strong> submit</strong> when you're done :)
|
assign as many or as few players as you want and don't forget to 💾
|
||||||
</p>
|
<strong> submit</strong> when you're done :)
|
||||||
{user && teams && players ? (
|
</p>
|
||||||
<TabController tabs={tabs}>
|
{user && teams && players ? (
|
||||||
<ChemistryDnDMobile {...{ user, teams, players }} />
|
<TabController tabs={tabs}>
|
||||||
<MVPDnD {...{ user, teams, players }} />
|
<ChemistryDnDMobile {...{ user, teams, players }} />
|
||||||
<TypeDnD {...{ user, teams, players }} />
|
<MVPDnD {...{ user, teams, players }} />
|
||||||
</TabController>
|
<TypeDnD {...{ user, teams, players }} />
|
||||||
) : (
|
</TabController>
|
||||||
<div className="container">
|
) : (
|
||||||
<progress className="progress is-primary" max="100"></progress>
|
<div className="container">
|
||||||
</div>
|
<progress className="progress is-primary" max="100"></progress>
|
||||||
)}
|
</div>
|
||||||
</div>
|
)}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import {
|
|||||||
import { customTheme } from "./NetworkTheme";
|
import { customTheme } from "./NetworkTheme";
|
||||||
import { useSession } from "./Session";
|
import { useSession } from "./Session";
|
||||||
import { useNavigate } from "react-router";
|
import { useNavigate } from "react-router";
|
||||||
|
import { ChevronDown, ChevronUp, Settings2 } from "lucide-react";
|
||||||
|
|
||||||
interface NetworkData {
|
interface NetworkData {
|
||||||
nodes: GraphNode[];
|
nodes: GraphNode[];
|
||||||
@@ -43,7 +44,10 @@ export const GraphComponent = () => {
|
|||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
const [error, setError] = useState("");
|
const [error, setError] = useState("");
|
||||||
const [threed, setThreed] = useState(false);
|
const [threed, setThreed] = useState(false);
|
||||||
|
const [showControls, setShowControls] = useState(true);
|
||||||
const [likes, setLikes] = useState(2);
|
const [likes, setLikes] = useState(2);
|
||||||
|
const [showLikes, setShowLikes] = useState(true);
|
||||||
|
const [showDislikes, setShowDislikes] = useState(false);
|
||||||
const [popularity, setPopularity] = useState(false);
|
const [popularity, setPopularity] = useState(false);
|
||||||
const [mutuality, setMutuality] = useState(false);
|
const [mutuality, setMutuality] = useState(false);
|
||||||
const { user, teams } = useSession();
|
const { user, teams } = useSession();
|
||||||
@@ -96,17 +100,6 @@ export const GraphComponent = () => {
|
|||||||
setMutuality(!mutuality);
|
setMutuality(!mutuality);
|
||||||
}
|
}
|
||||||
|
|
||||||
function showLabel() {
|
|
||||||
switch (likes) {
|
|
||||||
case 0:
|
|
||||||
return "dislike";
|
|
||||||
case 1:
|
|
||||||
return "both";
|
|
||||||
case 2:
|
|
||||||
return "like";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function findMatches(edges: GraphEdge[]) {
|
function findMatches(edges: GraphEdge[]) {
|
||||||
const adjacencyList = edges.map(
|
const adjacencyList = edges.map(
|
||||||
(edge) => edge.source + edge.target + edge.data.relation
|
(edge) => edge.source + edge.target + edge.data.relation
|
||||||
@@ -157,6 +150,10 @@ export const GraphComponent = () => {
|
|||||||
setData({ nodes: newNodes, edges: data.edges });
|
setData({ nodes: newNodes, edges: data.edges });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setLikes(+!showLikes + +showDislikes);
|
||||||
|
}, [showLikes, showDislikes]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (mutuality) colorMatches(false);
|
if (mutuality) colorMatches(false);
|
||||||
colorMatches(mutuality);
|
colorMatches(mutuality);
|
||||||
@@ -183,7 +180,9 @@ export const GraphComponent = () => {
|
|||||||
|
|
||||||
let content: ReactNode;
|
let content: ReactNode;
|
||||||
if (loading) {
|
if (loading) {
|
||||||
content = <span className="loader" />;
|
<div className="container">
|
||||||
|
<progress className="progress is-primary" max="100"></progress>
|
||||||
|
</div>;
|
||||||
} else if (error) {
|
} else if (error) {
|
||||||
content = <span>{error}</span>;
|
content = <span>{error}</span>;
|
||||||
} else {
|
} else {
|
||||||
@@ -250,58 +249,98 @@ export const GraphComponent = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={{ position: "absolute", top: 0, bottom: 0, left: 0, right: 0 }}>
|
<div>
|
||||||
<div className="controls">
|
<div className="card network-controls">
|
||||||
<div className="control" onClick={handleMutuality}>
|
<header
|
||||||
<div className="switch">
|
className="card-header"
|
||||||
<input type="checkbox" checked={mutuality} onChange={() => {}} />
|
style={{ cursor: "pointer" }}
|
||||||
<span className="slider round"></span>
|
onClick={() => setShowControls(!showControls)}
|
||||||
</div>
|
>
|
||||||
<span>mutuality</span>
|
<p className="card-header-title">
|
||||||
</div>
|
<span className="icon-text">
|
||||||
|
<span className="icon">
|
||||||
|
<Settings2 />
|
||||||
|
</span>
|
||||||
|
<span>controls</span>
|
||||||
|
</span>
|
||||||
|
</p>
|
||||||
|
<button className="card-header-icon">
|
||||||
|
{showControls ? <ChevronUp /> : <ChevronDown />}
|
||||||
|
</button>
|
||||||
|
</header>
|
||||||
|
{showControls && (
|
||||||
|
<div className="card-content">
|
||||||
|
<div className="field">
|
||||||
|
<div className="field is-grouped">
|
||||||
|
<div className="control">
|
||||||
|
<button
|
||||||
|
className={
|
||||||
|
"button is-primary" + (showLikes ? " is-outlined" : "")
|
||||||
|
}
|
||||||
|
onClick={() => setShowLikes(!showLikes)}
|
||||||
|
>
|
||||||
|
<span className="icon">👍</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div className="control">
|
||||||
|
<button
|
||||||
|
className={
|
||||||
|
"button is-primary" + (showDislikes ? " is-outlined" : "")
|
||||||
|
}
|
||||||
|
onClick={() => setShowDislikes(!showDislikes)}
|
||||||
|
>
|
||||||
|
<span className="icon">👎</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className="control" onClick={handleThreed}>
|
<div className="control">
|
||||||
<span>2D</span>
|
<label className="checkbox">
|
||||||
<div className="switch">
|
<input
|
||||||
<input type="checkbox" checked={threed} onChange={() => {}} />
|
type="checkbox"
|
||||||
<span className="slider round"></span>
|
checked={mutuality}
|
||||||
</div>
|
onClick={handleMutuality}
|
||||||
<span>3D</span>
|
/>
|
||||||
</div>
|
<span className="ml-1">mutuality</span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className="control">
|
<div className="control">
|
||||||
<div className="stack column">
|
<label className="radio">
|
||||||
<datalist id="markers">
|
<input
|
||||||
<option value="0"></option>
|
type="radio"
|
||||||
<option value="1"></option>
|
checked={!threed}
|
||||||
<option value="2"></option>
|
name="3D"
|
||||||
</datalist>
|
onClick={handleThreed}
|
||||||
<div id="three-slider">
|
/>
|
||||||
<label>😬</label>
|
<span className="m-1">2D</span>
|
||||||
<input
|
</label>
|
||||||
type="range"
|
<label className="radio">
|
||||||
list="markers"
|
<input
|
||||||
min="0"
|
type="radio"
|
||||||
max="2"
|
checked={threed}
|
||||||
step="1"
|
name="3D"
|
||||||
width="16px"
|
onClick={handleThreed}
|
||||||
onChange={(evt) => setLikes(Number(evt.target.value))}
|
/>
|
||||||
/>
|
<span className="m-1">3D</span>
|
||||||
<label>😍</label>
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="control">
|
||||||
|
<label className="checkbox">
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
checked={popularity}
|
||||||
|
onClick={handlePopularity}
|
||||||
|
/>
|
||||||
|
<span className="ml-1">
|
||||||
|
popularity<sup>*</sup>
|
||||||
|
</span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{showLabel()}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
)}
|
||||||
|
|
||||||
<div className="control" onClick={handlePopularity}>
|
|
||||||
<div className="switch">
|
|
||||||
<input type="checkbox" checked={popularity} onChange={() => {}} />
|
|
||||||
<span className="slider round"></span>
|
|
||||||
</div>
|
|
||||||
<span>
|
|
||||||
popularity<sup>*</sup>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{popularity && (
|
{popularity && (
|
||||||
|
|||||||
@@ -21,8 +21,17 @@ export default function TabController({ tabs, children }: TabControllerProps) {
|
|||||||
<div className="tabs is-boxed is-centered">
|
<div className="tabs is-boxed is-centered">
|
||||||
<ul>
|
<ul>
|
||||||
{tabs.map((tab, index) => (
|
{tabs.map((tab, index) => (
|
||||||
<li className={currentIndex === index ? "is-active" : ""}>
|
<li
|
||||||
<a onClick={() => handleTabClick(index)}>{tab.label}</a>
|
className={
|
||||||
|
currentIndex === index ? "is-active has-text-weight-bold" : ""
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<a
|
||||||
|
className="has-text-black"
|
||||||
|
onClick={() => handleTabClick(index)}
|
||||||
|
>
|
||||||
|
{tab.label}
|
||||||
|
</a>
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
Reference in New Issue
Block a user