generated from ZanzyTHEbar/SolidJSTauri
-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added daisyui * added a small spacer * added static modal id's * titlebar actions * added tab index * deleted unnecessary code * refactored code to match daysiUI styles * connected titlebar functionality
- Loading branch information
Showing
18 changed files
with
307 additions
and
255 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,67 @@ | ||
import { Show, For, Component } from 'solid-js' | ||
import { Component, For } from 'solid-js' | ||
import { Board } from '../Board/Board' | ||
import { SelectButton } from '@components/Buttons/SelectButton' | ||
|
||
export interface IProps { | ||
boards: Array<{ board: string; description: string; debugMode?: boolean }> | ||
onSubmit: (board: string) => void | ||
onClick: () => void | ||
selectedBoard: string | ||
firmwareVersion: string | ||
show: boolean | ||
ref?: HTMLDivElement | ||
} | ||
|
||
export const SelectBoard: Component<IProps> = (props) => { | ||
return ( | ||
<div | ||
class="relative w-[285px] p-[24px] rounded-[12px] border border-solid border-[#192736] bg-[#0D1B26]" | ||
ref={props.ref}> | ||
<div class="relative w-[285px] p-[24px] rounded-[12px] border border-solid border-[#192736] bg-[#0D1B26]"> | ||
<div class="flex flex-col gap-[10px]"> | ||
<div class="flex justify-between"> | ||
<div class="text-left text-[14px] text-white font-[500] leading-[14px] not-italic"> | ||
<p>Select board</p> | ||
</div> | ||
</div> | ||
<div> | ||
<SelectButton | ||
type="button" | ||
label={!props.selectedBoard ? 'Select board' : props.selectedBoard} | ||
onClick={() => { | ||
props.onClick() | ||
}} | ||
/> | ||
<div class="pt-[10px] text-left text-[12px] text-white font-[500] leading-[14px] not-italic"> | ||
<p> | ||
Firmware version:{' '} | ||
{!props.firmwareVersion ? '--' : props.firmwareVersion} | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
<Show when={props.show}> | ||
<div class="absolute right-0 mt-[34px] w-full p-[12px] rounded-[12px] border border-solid border-[#192736] bg-[#0D1B26]"> | ||
<div class="overflow-y-scroll max-h-[250px] flex flex-col gap-[10px]"> | ||
{!props.boards.length ? ( | ||
<div class="text-left text-[12px] text-white font-[500] leading-[14px] not-italic"> | ||
<p>No boards to show</p> | ||
</div> | ||
) : ( | ||
<For each={props.boards}> | ||
{(data) => ( | ||
<Board | ||
isActive={props.selectedBoard === data.board} | ||
{...data} | ||
onClick={() => { | ||
props.onSubmit(data.board) | ||
}} | ||
/> | ||
<div class="dropdown w-full"> | ||
<SelectButton | ||
tabIndex={0} | ||
type="button" | ||
label={!props.selectedBoard ? 'Select board' : props.selectedBoard} | ||
/> | ||
<div | ||
tabIndex={0} | ||
class="dropdown-content right-[-25px] mt-[58px] p-[12px] rounded-[12px] border border-solid border-[#192736] bg-[#0D1B26] w-[285px]"> | ||
<div class="overflow-y-scroll max-h-[250px] flex flex-col gap-[10px] w-full"> | ||
{!props.boards.length ? ( | ||
<div class="flex flex-row gap-[6px]"> | ||
<span class="loading loading-ring loading-md" /> | ||
<p>Looking for boards!</p> | ||
</div> | ||
) : ( | ||
<For each={props.boards}> | ||
{(data) => ( | ||
<Board | ||
isActive={props.selectedBoard === data.board} | ||
{...data} | ||
onClick={() => { | ||
props.onSubmit(data.board) | ||
}} | ||
/> | ||
)} | ||
</For> | ||
)} | ||
</For> | ||
)} | ||
</div> | ||
</div> | ||
</div> | ||
<div class="pt-[10px] text-left text-[12px] text-white font-[500] leading-[16px] not-italic"> | ||
<div class="flex gap-[4px] items-center"> | ||
<p>Firmware version:</p> | ||
{!props.firmwareVersion ? ( | ||
<span class="loading loading-ring loading-xs" /> | ||
) : ( | ||
<p>{props.firmwareVersion}</p> | ||
)} | ||
</div> | ||
</div> | ||
</div> | ||
</Show> | ||
</div> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.