mirror of
https://github.com/20kaushik02/spotify-manager-web.git
synced 2026-01-25 16:14:06 +00:00
formatting
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
.graph_wrapper {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
}
|
||||
display: flex;
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import React, { useCallback } from 'react';
|
||||
import {
|
||||
ReactFlow,
|
||||
Controls,
|
||||
Background,
|
||||
useNodesState,
|
||||
useEdgesState,
|
||||
addEdge,
|
||||
ReactFlow,
|
||||
Controls,
|
||||
Background,
|
||||
useNodesState,
|
||||
useEdgesState,
|
||||
addEdge,
|
||||
} from '@xyflow/react';
|
||||
|
||||
import '@xyflow/react/dist/style.css';
|
||||
@@ -13,35 +13,35 @@ import styles from './Graph.module.css';
|
||||
|
||||
// const initialNodes = [];
|
||||
const initialNodes = [
|
||||
{ id: '1', position: { x: 0, y: 0 }, data: { label: '1' } },
|
||||
{ id: '2', position: { x: 0, y: 100 }, data: { label: '2' } },
|
||||
{ id: '1', position: { x: 0, y: 0 }, data: { label: '1' } },
|
||||
{ id: '2', position: { x: 0, y: 100 }, data: { label: '2' } },
|
||||
];
|
||||
// const initialEdges = [];
|
||||
const initialEdges = [
|
||||
{ id: 'e1-2', source: '1', target: '2' }
|
||||
{ id: 'e1-2', source: '1', target: '2' }
|
||||
];
|
||||
const Graph = () => {
|
||||
const [playlistNodes, setNodes, onNodesChange] = useNodesState(initialNodes);
|
||||
const [linkEdges, setEdges, onEdgesChange] = useEdgesState(initialEdges);
|
||||
const [playlistNodes, setNodes, onNodesChange] = useNodesState(initialNodes);
|
||||
const [linkEdges, setEdges, onEdgesChange] = useEdgesState(initialEdges);
|
||||
|
||||
const onConnect = useCallback((params) => {
|
||||
setEdges((eds) => addEdge(params, eds));
|
||||
}, [setEdges]);
|
||||
const onConnect = useCallback((params) => {
|
||||
setEdges((eds) => addEdge(params, eds));
|
||||
}, [setEdges]);
|
||||
|
||||
return (
|
||||
<div className={styles.graph_wrapper}>
|
||||
<ReactFlow
|
||||
nodes={playlistNodes}
|
||||
edges={linkEdges}
|
||||
onNodesChange={onNodesChange}
|
||||
onEdgesChange={onEdgesChange}
|
||||
onConnect={onConnect}
|
||||
>
|
||||
<Controls />
|
||||
<Background variant='dots' gap={36} size={3} />
|
||||
</ReactFlow>
|
||||
</div>
|
||||
)
|
||||
return (
|
||||
<div className={styles.graph_wrapper}>
|
||||
<ReactFlow
|
||||
nodes={playlistNodes}
|
||||
edges={linkEdges}
|
||||
onNodesChange={onNodesChange}
|
||||
onEdgesChange={onEdgesChange}
|
||||
onConnect={onConnect}
|
||||
>
|
||||
<Controls />
|
||||
<Background variant='dots' gap={36} size={3} />
|
||||
</ReactFlow>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default Graph;
|
||||
export default Graph;
|
||||
|
||||
@@ -4,18 +4,18 @@ import { authLoginURL } from '../../api/paths';
|
||||
|
||||
// auth through backend
|
||||
const Login = () => {
|
||||
useEffect(() => {
|
||||
const timeoutID = setTimeout(() => {
|
||||
window.open(authLoginURL, "_self")
|
||||
}, 1000);
|
||||
useEffect(() => {
|
||||
const timeoutID = setTimeout(() => {
|
||||
window.open(authLoginURL, "_self")
|
||||
}, 1000);
|
||||
|
||||
return () => clearTimeout(timeoutID);
|
||||
}, []);
|
||||
return (
|
||||
<div className={styles.login_wrapper}>
|
||||
Redirecting to Spotify...
|
||||
</div>
|
||||
)
|
||||
return () => clearTimeout(timeoutID);
|
||||
}, []);
|
||||
return (
|
||||
<div className={styles.login_wrapper}>
|
||||
Redirecting to Spotify...
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default Login;
|
||||
export default Login;
|
||||
|
||||
@@ -3,18 +3,18 @@ import styles from './Logout.module.css';
|
||||
import { authLogoutURL } from '../../api/paths';
|
||||
|
||||
const Logout = () => {
|
||||
useEffect(() => {
|
||||
const timeoutID = setTimeout(() => {
|
||||
window.open(authLogoutURL, "_self")
|
||||
}, 1000);
|
||||
useEffect(() => {
|
||||
const timeoutID = setTimeout(() => {
|
||||
window.open(authLogoutURL, "_self")
|
||||
}, 1000);
|
||||
|
||||
return () => clearTimeout(timeoutID);
|
||||
}, []);
|
||||
return (
|
||||
<div className={styles.logout_wrapper}>
|
||||
See you soon!
|
||||
</div>
|
||||
)
|
||||
return () => clearTimeout(timeoutID);
|
||||
}, []);
|
||||
return (
|
||||
<div className={styles.logout_wrapper}>
|
||||
See you soon!
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default Logout;
|
||||
export default Logout;
|
||||
|
||||
@@ -3,15 +3,15 @@ import styles from "./PageNotFound.module.css";
|
||||
import { showWarnToastNotification } from '../../components/ToastNotification';
|
||||
|
||||
const PageNotFound = () => {
|
||||
useEffect(() => {
|
||||
showWarnToastNotification("Oops!")
|
||||
}, []);
|
||||
useEffect(() => {
|
||||
showWarnToastNotification("Oops!")
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className={styles.pnf_wrapper}>
|
||||
PageNotFound
|
||||
</div>
|
||||
)
|
||||
return (
|
||||
<div className={styles.pnf_wrapper}>
|
||||
PageNotFound
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default PageNotFound
|
||||
export default PageNotFound
|
||||
|
||||
Reference in New Issue
Block a user