-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
269 additions
and
50 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: 'Publish' | ||
on: workflow_dispatch | ||
|
||
env: | ||
CARGO_INCREMENTAL: 0 | ||
RUST_BACKTRACE: short | ||
RUSTFLAGS: '-W unreachable-pub -W rust-2021-compatibility' | ||
|
||
jobs: | ||
publish-tauri: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
settings: | ||
- platform: 'macos-latest' | ||
args: '--target universal-apple-darwin' | ||
- platform: 'ubuntu-22.04' | ||
args: '' | ||
- platform: 'windows-latest' | ||
args: '--target x86_64-pc-windows-msvc' | ||
runs-on: ${{ matrix.settings.platform }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
- uses: dtolnay/rust-toolchain@stable | ||
with: | ||
targets: aarch64-apple-darwin | ||
- name: install dependencies (ubuntu only) | ||
if: matrix.settings.platform == 'ubuntu-22.04' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y build-essential libssl-dev javascriptcoregtk-4.1 libayatana-appindicator3-dev libsoup-3.0-dev libgtk-3-dev libwebkit2gtk-4.1-dev webkit2gtk-4.1 librsvg2-dev patchelf | ||
- name: Install bun | ||
uses: oven-sh/setup-bun@v1 | ||
with: | ||
bun-version: latest | ||
- name: Setup node and cache for package data | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 'lts/*' | ||
cache: 'bun' | ||
cache-dependency-path: bun.lockb | ||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
cache-on-failure: true | ||
- run: bun install | ||
- uses: tauri-apps/tauri-action@dev | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tagName: v__VERSION__ | ||
releaseName: 'v__VERSION__' | ||
releaseBody: 'See the assets to download this version and install.' | ||
releaseDraft: true | ||
prerelease: false | ||
args: ${{ matrix.settings.args }} | ||
includeDebug: false |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
import type { Component, JSX } from "solid-js"; | ||
import { For, createSignal } from "solid-js"; | ||
import { DisclosureStateChild, Listbox, ListboxButton, ListboxOption, ListboxOptions, Transition } from "terracotta"; | ||
import { TbSelector } from "solid-icons/tb"; | ||
import { FiCheck } from "solid-icons/fi"; | ||
|
||
interface DropdownItem { | ||
id: number; | ||
name: string; | ||
} | ||
|
||
interface DropdownProps { | ||
data: DropdownItem[]; | ||
onSelect: (value: DropdownItem) => void; | ||
} | ||
|
||
const Dropdown: Component<DropdownProps> = (props) => { | ||
const [selected, setSelected] = createSignal(props.data[0]); | ||
|
||
const handleSelect = (value: DropdownItem | undefined) => { | ||
if (!value) return; | ||
setSelected(value); | ||
props.onSelect(value); | ||
}; | ||
|
||
return ( | ||
<div class="w-full"> | ||
<Listbox defaultOpen={false} value={selected()} onSelectChange={handleSelect}> | ||
<div class="relative mt-1"> | ||
<ListboxButton class="relative w-full py-2 pl-3 pr-10 text-left bg-element border-default border-1 rounded-lg cursor-default focus:outline-none sm:text-sm"> | ||
<span class="block truncate">{selected().name}</span> | ||
<span class="absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none"> | ||
<TbSelector class="w-5 h-5 text-primary" aria-hidden="true" /> | ||
</span> | ||
</ListboxButton> | ||
<DisclosureStateChild> | ||
{({ isOpen }): JSX.Element => ( | ||
<Transition | ||
show={isOpen()} | ||
enter="transition ease-in duration-100" | ||
enterFrom="opacity-0" | ||
enterTo="opacity-100" | ||
leave="transition ease-out duration-100" | ||
leaveFrom="opacity-100" | ||
leaveTo="opacity-0" | ||
> | ||
<ListboxOptions | ||
unmount={false} | ||
class="absolute w-full py-1 mt-1 overflow-auto text-base bg-element border-default border-1 rounded-md shadow-lg max-h-60 focus:outline-none sm:text-sm" | ||
> | ||
<For each={props.data}> | ||
{(item): JSX.Element => ( | ||
<ListboxOption class="focus:outline-none group" value={item}> | ||
{({ isActive, isSelected }): JSX.Element => ( | ||
<div | ||
classList={{ | ||
"bg-default": isActive(), | ||
"cursor-default select-none relative py-2 pl-10 pr-4": true, | ||
}} | ||
> | ||
<span | ||
classList={{ | ||
"font-medium": isSelected(), | ||
"font-normal": !isSelected(), | ||
"block truncate": true, | ||
}} | ||
> | ||
{item.name} | ||
</span> | ||
{isSelected() ? ( | ||
<span | ||
classList={{ | ||
"text-primary": true, | ||
"absolute inset-y-0 left-0 flex items-center pl-3": true, | ||
}} | ||
> | ||
<FiCheck class="w-5 h-5" /> | ||
</span> | ||
) : null} | ||
</div> | ||
)} | ||
</ListboxOption> | ||
)} | ||
</For> | ||
</ListboxOptions> | ||
</Transition> | ||
)} | ||
</DisclosureStateChild> | ||
</div> | ||
</Listbox> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Dropdown; |
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import type { Component } from "solid-js"; | ||
|
||
type TextInputProps = { | ||
type: "text" | "date"; | ||
onChange: (value: string) => void; | ||
label: string; | ||
defaultValue?: string; | ||
}; | ||
|
||
type NumberInputProps = { | ||
type: "number"; | ||
onChange: (value: number) => void; | ||
label: string; | ||
defaultValue?: number; | ||
}; | ||
|
||
type InputProps = TextInputProps | NumberInputProps; | ||
|
||
const Input: Component<InputProps> = (props) => { | ||
const handleInput = (e: Event) => { | ||
const value = (e.target as HTMLInputElement).value; | ||
if (props.type === "number") { | ||
props.onChange(Number(value) as never); | ||
} else { | ||
props.onChange(value as never); | ||
} | ||
}; | ||
|
||
return ( | ||
<input | ||
type={props.type} | ||
class="w-full px-2 py-1 border border-default rounded-lg bg-element border-default" | ||
onInput={handleInput} | ||
placeholder={props.label} | ||
value={props.defaultValue} | ||
/> | ||
); | ||
}; | ||
|
||
export default Input; |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import type { Component } from "solid-js"; | ||
|
||
const Table: Component<{}> = (props) => { | ||
return <div></div>; | ||
}; | ||
|
||
export default Table; |
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
19 changes: 16 additions & 3 deletions
19
src/screens/Dashboard/pages/Sales/Clients/ManageClient.tsx
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.