Commit c1aab57c authored by Martin Bebjak's avatar Martin Bebjak
Browse files

Continued FE development

parent 4643e062
Pipeline #139423 passed with stage
in 1 minute and 23 seconds
export function Agent() {
import { useEffect } from "react";
interface IAgentDetail{
// todo agentdetail fields
}
export function Agent(props: { id: number; }) {
const Agent = null;
useEffect(() => {
props.id;
// fetch agent data
});
return(
<div>
<h2>Šakal šakalovič, český skaut a lámač ženských sŕdc</h2>
......
import React, { useState, useEffect } from 'react';
export function AgentsList () {
const [agents, setAgents] = useState(null);
useEffect(() => {
// fetch data
});
if (agents === null) {
return(
<div>
<h1>Loading ......</h1>
</div>
)
} else {
return(
<div>
<ul>
......@@ -10,4 +26,5 @@ export function AgentsList () {
</ul>
</div>
)
}
}
\ No newline at end of file
export function Content(){
return(
<div></div>
)
}// import { Home } from './Home';
// import { Agent } from './Agent';
// import { AgentList } from './AgentsList';
// import { Mission } from './Mission';
// import { MissionsList } from './MissionsList';
// import { FindAgent } from './FindAvailableAgents';
// interface IContentProps{
// whatToShow: string
// }
// export function Content(props: IContentProps) {
// switch (props.whatToShow) {
// case "Agent":
// return(
// <div>
// <Agent/>
// </div>
// )
// break;
// case "AgentsList":
// return(
// <div>
// <AgentList/>
// </div>
// )
// break;
// case "Mission":
// return(
// <div>
// <Mission/>
// </div>
// )
// break;
// case "MissionsList":
// return(
// <div>
// <MissionsList/>
// </div>
// )
// break;
// case "FindAgent":
// return(
// <div>
// <FindAgent/>
// </div>
// )
// break;
// default:
// return(
// <div>
// <Home/>
// </div>
// )
// break;
// }
// }
\ No newline at end of file
import Combobox from "react-widgets/Combobox";
import { useState, useCallback } from "react";
export function FindAvailableAgents() {
const [result, setResult] = useState(null);
const searchForAgent = useCallback (()=>{
//todo find result
},[result]);
let content;
if (result === null) {
content = <h2>No items found</h2>
} else {
// todo content = db result
<ul>
<li>
<image></image> {/*moze byt nejaka agent ikonka*/}
<p>Name</p>
<p>Skills</p>
</li>
</ul>
}
return(
<div>
<input placeholder="napis sem nieco ty kekekt"></input>
<div className="searchBar">
<Combobox
hideCaret
hideEmptyPopup
data={["Nigger", "Chad", "Belize", "Tramtaria", "Kekistan", "Bobri vrch", "Normandia"]}
placeholder="Choose a country"/>
<Combobox
hideCaret
hideEmptyPopup
data={["Bombenie", "Busenie", "Prebombenie", "Vybombenie", "Zabombenie", "Bombickovanie", "Bodovanie"]}
placeholder="Choose a skill"/>
<button onClick={ searchForAgent }>Search</button>
</div>
<div className="Content">
{ content }
</div>
</div>
)
}
\ No newline at end of file
......@@ -49,7 +49,7 @@ export class Main extends Component<IMainProps, IMainState>{
<Route path="/missions" element={ <MissionsList/> }/>
<Route path="/findAgent" element={ <FindAvailableAgents/> }/>
<Route path="mission/:id" element={ <Mission />} />
<Route path="agent/:id" element={ <Agent />} />
<Route path="agent/:id" element={ <Agent id={ 0 } />} />
</Routes>
</div>
)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment