mirror of
https://github.com/Steffo99/todocolors.git
synced 2024-11-25 17:54:18 +00:00
Display an icon if the board has no tasks
This commit is contained in:
parent
5982352792
commit
12d3427435
2 changed files with 9 additions and 3 deletions
|
@ -1,12 +1,12 @@
|
||||||
import {BoardMainIcon} from "@/app/[lang]/board/[board]/BoardMainIcon"
|
import {BoardMainIcon} from "@/app/[lang]/board/[board]/BoardMainIcon"
|
||||||
import {BoardMainTaskGroups} from "@/app/[lang]/board/[board]/BoardMainTaskGroups"
|
import {BoardMainTaskGroups} from "@/app/[lang]/board/[board]/BoardMainTaskGroups"
|
||||||
import {useManagedBoard} from "@/app/[lang]/board/[board]/BoardManager"
|
import {useManagedBoard} from "@/app/[lang]/board/[board]/BoardManager"
|
||||||
import {faLink, faLinkSlash, faGear} from "@fortawesome/free-solid-svg-icons"
|
import {faLink, faLinkSlash, faGear, faAsterisk} from "@fortawesome/free-solid-svg-icons"
|
||||||
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome"
|
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome"
|
||||||
|
|
||||||
|
|
||||||
export function BoardMain({className}: {className?: string}) {
|
export function BoardMain({className}: {className?: string}) {
|
||||||
const {webSocketState, webSocketBackoffMs} = useManagedBoard()
|
const {webSocketState, webSocketBackoffMs, taskGroups} = useManagedBoard()
|
||||||
|
|
||||||
switch(webSocketState) {
|
switch(webSocketState) {
|
||||||
case undefined:
|
case undefined:
|
||||||
|
@ -14,7 +14,12 @@ export function BoardMain({className}: {className?: string}) {
|
||||||
case WebSocket.CONNECTING:
|
case WebSocket.CONNECTING:
|
||||||
return <BoardMainIcon icon={<FontAwesomeIcon size={"4x"} icon={faLink} beatFade/>} text={"Connessione..."} className={className}/>
|
return <BoardMainIcon icon={<FontAwesomeIcon size={"4x"} icon={faLink} beatFade/>} text={"Connessione..."} className={className}/>
|
||||||
case WebSocket.OPEN:
|
case WebSocket.OPEN:
|
||||||
|
if(taskGroups.length === 0) {
|
||||||
|
return <BoardMainIcon icon={<FontAwesomeIcon size={"4x"} icon={faAsterisk}/>} text={"Nulla da visualizzare"} className={className}/>
|
||||||
|
}
|
||||||
|
else {
|
||||||
return <BoardMainTaskGroups className={className}/>
|
return <BoardMainTaskGroups className={className}/>
|
||||||
|
}
|
||||||
case WebSocket.CLOSING:
|
case WebSocket.CLOSING:
|
||||||
return <BoardMainIcon icon={<FontAwesomeIcon size={"4x"} icon={faLinkSlash} beatFade/>} text={"Disconnessione..."} className={className}/>
|
return <BoardMainIcon icon={<FontAwesomeIcon size={"4x"} icon={faLinkSlash} beatFade/>} text={"Disconnessione..."} className={className}/>
|
||||||
case WebSocket.CLOSED:
|
case WebSocket.CLOSED:
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import {BoardMainIcon} from "@/app/[lang]/board/[board]/BoardMainIcon"
|
||||||
import {useManagedBoard} from "@/app/[lang]/board/[board]/BoardManager"
|
import {useManagedBoard} from "@/app/[lang]/board/[board]/BoardManager"
|
||||||
import {TaskDisplay} from "@/app/[lang]/board/[board]/TaskDisplay"
|
import {TaskDisplay} from "@/app/[lang]/board/[board]/TaskDisplay"
|
||||||
import {TaskGroup} from "@/app/[lang]/board/[board]/useBoardTaskArranger"
|
import {TaskGroup} from "@/app/[lang]/board/[board]/useBoardTaskArranger"
|
||||||
|
|
Loading…
Reference in a new issue