mirror of
https://github.com/Steffo99/todocolors.git
synced 2024-11-22 16:24:19 +00:00
Use <main>
instead of <div>
in BoardMainTaskGroups
This commit is contained in:
parent
acb31c46eb
commit
3f774cfa6d
2 changed files with 24 additions and 2 deletions
22
todoblue/src/app/board/[board]/BoardMain.tsx
Normal file
22
todoblue/src/app/board/[board]/BoardMain.tsx
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
import {BoardMainTaskGroups} from "@/app/board/[board]/BoardMainTaskGroups"
|
||||||
|
import {BoardMainIcon} from "@/app/board/[board]/BoardMainIcon"
|
||||||
|
import {useBoardContext} from "@/app/board/[board]/useBoardContext"
|
||||||
|
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome"
|
||||||
|
import {faGear, faArrowsSpin, faExclamationCircle} from "@fortawesome/free-solid-svg-icons"
|
||||||
|
|
||||||
|
|
||||||
|
export function BoardMain() {
|
||||||
|
const {websocketState} = useBoardContext()
|
||||||
|
|
||||||
|
switch(websocketState) {
|
||||||
|
case undefined:
|
||||||
|
return <BoardMainIcon icon={<FontAwesomeIcon icon={faGear} spin/>} text={"Caricamento..."}/>
|
||||||
|
case WebSocket.CONNECTING:
|
||||||
|
return <BoardMainIcon icon={<FontAwesomeIcon icon={faArrowsSpin} spin/>} text={"Connessione..."}/>
|
||||||
|
case WebSocket.OPEN:
|
||||||
|
return <BoardMainTaskGroups/>
|
||||||
|
case WebSocket.CLOSING:
|
||||||
|
case WebSocket.CLOSED:
|
||||||
|
return <BoardMainIcon icon={<FontAwesomeIcon icon={faExclamationCircle}/>} text={"Errore"} className={"red"}/>
|
||||||
|
}
|
||||||
|
}
|
|
@ -6,8 +6,8 @@ export function BoardMainTaskGroups() {
|
||||||
const {taskGroups} = useBoardContext()
|
const {taskGroups} = useBoardContext()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={"chapter-5"}>
|
<main className={"chapter-5"}>
|
||||||
{taskGroups.map((tg) => <TaskGroupColumn taskGroup={tg}/>)}
|
{taskGroups.map((tg) => <TaskGroupColumn taskGroup={tg}/>)}
|
||||||
</div>
|
</main>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue