Skip to content

Commit

Permalink
feat: Cambio en el ui
Browse files Browse the repository at this point in the history
  • Loading branch information
BarraR3port committed Nov 27, 2024
1 parent 7e88948 commit 1b9ad04
Show file tree
Hide file tree
Showing 9 changed files with 189 additions and 120 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ jobs:
check_for_new_versions:
name: Check if new version is available
runs-on: ubuntu-latest
outputs:
new_release_published: ${{ steps.semantic_release.outputs.new_release_published }}
new_release_version: ${{ steps.semantic_release.outputs.new_release_version }}
permissions:
contents: write
packages: write
Expand All @@ -27,7 +30,7 @@ jobs:
- name: Semantic Release
id: semantic_release
uses: cycjimmy/semantic-release-action@v4
with:
with:
semantic_version: "24.0.0"
extra_plugins: |
conventional-changelog-conventionalcommits
Expand All @@ -38,4 +41,22 @@ jobs:
@semantic-release/commit-analyzer
semantic-release-replace-plugin
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Check Release Status
if: steps.semantic_release.outputs.new_release_published == 'true'
run: |
echo "New release was published!"
echo "Version: ${{ steps.semantic_release.outputs.new_release_version }}"
trigger_build:
needs: check_for_new_versions
if: needs.check_for_new_versions.outputs.new_release_published == 'true'
runs-on: ubuntu-latest
steps:
- name: Trigger auto-tauri-build workflow
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
event-type: new-release-created
client-payload: '{"version": "${{ needs.check_for_new_versions.outputs.new_release_version }}"}'
73 changes: 73 additions & 0 deletions .github/workflows/tauri-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Build app for all platforms
on:
release:
types: [created, published, prereleased]
push:
tags:
- '*'
workflow_dispatch:

jobs:
build-non-mac:
name: Build for non-Mac platforms
strategy:
fail-fast: true
matrix:
platform: [windows-latest]
include:
- os: windows-latest
rust_target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Extract and Set Release ID
run: |
RELEASE_ID=$(curl --silent "https://api.github.com/repos/$GITHUB_REPOSITORY/releases?per_page=1" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" | jq -r '.[0].id')
echo "RELEASE_ID=${RELEASE_ID}" >> $GITHUB_ENV
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: ${{ matrix.rust_target }}

- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
workspaces: v2 -> v2/target

- name: Install apt dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt install -y --no-install-recommends libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev patchelf
- name: Install bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install dependencies
run: |
bun install
- name: Build the app
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
FONTAWESOME_NPM_AUTH_TOKEN: ${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}
NEXT_PUBLIC_API_URL: ${{ secrets.NEXT_PUBLIC_API_URL }}
with:
releaseId: ${{ env.RELEASE_ID }}
updaterJsonPreferNsis: false
tauriScript: bun tauri
continue-on-error: false
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,6 @@
"trustedDependencies": [
"@biomejs/biome",
"sharp"
]
}
],
"packageManager": "[email protected]+sha1.1959a18351b811cdeedbd484a8f86c3cc3bbaf72"
}
4 changes: 2 additions & 2 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ interface ExamplesLayoutProps {

export default function MyApp({ children }: ExamplesLayoutProps) {
return (
<html lang="es" suppressHydrationWarning className="bg-black overflow-clip">
<html lang="es" suppressHydrationWarning className="overflow-clip">
<head />
<body className="font-sans antialiased bg-transparent overflow-clip scrollbar-none">
<ThemeProvider attribute="class" defaultTheme="dark" enableSystem disableTransitionOnChange>
<ThemeProvider attribute="class" defaultTheme="light" enableSystem disableTransitionOnChange>
<Toaster />
<div className="h-screen overflow-clip">
<TooltipProvider>
Expand Down
19 changes: 9 additions & 10 deletions src/components/store/sale/ProductList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,34 +130,34 @@ export default function ProductList() {
title="Selecciona el Método de pago:"
description={
<div className="w-full max-w-md space-y-6">
<div>Método de pago para completar la compra.</div>
<div className="text-secondary">Método de pago para completar la compra.</div>
<div className="grid gap-4">
<Card className="flex items-center justify-between p-4" onClick={finishSaleWithCash}>
<div className="flex items-center gap-4">
<DollarSignIcon className="w-6 h-6" />
<div>
<h4 className="font-medium">Efectivo</h4>
<p className="text-sm text-gray-400">Procesar pago en efectivo.</p>
<p className="text-sm text-text-secondary">Procesar pago en efectivo.</p>
</div>
</div>
{loadingCashPayment ? (
<Loader2 className={"animate-spin w-5 h-5"} />
) : (
<ChevronRightIcon className="w-5 h-5 text-gray-400" />
<ChevronRightIcon className="w-5 h-5 text-text-secondary" />
)}
</Card>
<Card className="flex items-center justify-between p-4" onClick={finishSaleWithTransBank}>
<div className="flex items-center gap-4">
<CreditCardIcon className="w-6 h-6" />
<div>
<h4 className="font-medium">TransBank</h4>
<p className="text-sm text-gray-400">Procesar pago con TransBank</p>
<p className="text-sm text-text-secondary">Procesar pago con TransBank</p>
</div>
</div>
{loadingTransBankPayment ? (
<Loader2 className={"animate-spin w-5 h-5"} />
) : (
<ChevronRightIcon className="w-5 h-5 text-gray-400" />
<ChevronRightIcon className="w-5 h-5 text-text-secondary" />
)}
</Card>
</div>
Expand All @@ -183,7 +183,7 @@ export default function ProductList() {
<tbody>
{products.length === 0 && (
<tr>
<td colSpan={7} className="h-48 px-4 py-2 text-center text-gray-400 align-middle">
<td colSpan={7} className="h-48 px-4 py-2 text-center text-text-secondary align-middle">
Agrega productos a la lista
</td>
</tr>
Expand Down Expand Up @@ -223,14 +223,14 @@ export default function ProductList() {
/>
</td>
<td className="px-4 py-2 text-left">
<span className="text-gray-400 ">
<span className="text-secondary ">
<AnimatedNumber value={initialPrice} format={priceFormatter.format} />
</span>
</td>
<td
className={cn(
"px-4 py-2 text-left text-red-400",
product.item?.discount?.name === undefined && "text-white"
"px-4 py-2 text-left text-destructive",
product.item?.discount?.name === undefined && "text-black"
)}
>
{finalDiscountPrice ? (
Expand Down Expand Up @@ -302,7 +302,6 @@ export default function ProductList() {
setOpenFinishModal(true);
}}
disabled={products.length === 0}
variant="success"
>
Completar compra
</Button>
Expand Down
9 changes: 4 additions & 5 deletions src/components/ui/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,15 @@ const buttonVariants = cva(
{
variants: {
variant: {
default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
default: "bg-primary text-primary-foreground shadow hover:bg-primary/80",
destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
ghost: "hover:bg-accent hover:text-accent-foreground",
link: "text-primary underline-offset-4 hover:underline",
primary: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
success: "bg-success text-white shadow-sm hover:bg-success/80",
primary: "bg-primary text-white shadow hover:bg-primary/80",
selected: "bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",
error: "bg-error text-white shadow-sm hover:bg-error/80"
error: "bg-destructive text-white shadow-sm hover:bg-destructive/80"
},
size: {
default: "h-9 px-4 py-2",
Expand All @@ -37,7 +36,7 @@ const buttonVariants = cva(

export interface ButtonProps
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
VariantProps<typeof buttonVariants> {
VariantProps<typeof buttonVariants> {
asChild?: boolean;
loading?: boolean;
prevIcon?: React.ReactNode;
Expand Down
4 changes: 2 additions & 2 deletions src/modals/basic-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ export default function BasicModal({ open, onClose, onConfirm, loading, title, d
<Modal title={title} description={description} open={open} onClose={onClose}>
<div className="flex items-center justify-end w-full pt-6 space-x-2">
{type === "cancelAndConfirm" && (
<Button variant="secondary" onClick={onClose} disabled={loading}>
<Button variant="error" onClick={onClose} disabled={loading}>
Cancelar
</Button>
)}
<Button onClick={onConfirm} loading={loading}>
<Button onClick={onConfirm} loading={loading} variant="primary">
Confirmar
</Button>
</div>
Expand Down
Loading

0 comments on commit 1b9ad04

Please sign in to comment.