mirror of
https://github.com/felipegcoutinho/openmonetis.git
synced 2026-05-09 11:01:45 +00:00
Compare commits
2 Commits
v2.4.0
...
9456aa98bc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9456aa98bc | ||
|
|
21c6a8d9d0 |
2
.github/workflows/docker-publish.yml
vendored
2
.github/workflows/docker-publish.yml
vendored
@@ -85,6 +85,8 @@ jobs:
|
|||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
|
build-args: |
|
||||||
|
NEXT_PUBLIC_LOGO_DEV_TOKEN=${{ secrets.NEXT_PUBLIC_LOGO_DEV_TOKEN }}
|
||||||
|
|
||||||
- name: Image digest
|
- name: Image digest
|
||||||
run: echo ${{ steps.meta.outputs.digest }}
|
run: echo ${{ steps.meta.outputs.digest }}
|
||||||
|
|||||||
@@ -40,6 +40,10 @@ COPY --from=deps /app/public/pdf.worker.min.mjs ./public/pdf.worker.min.mjs
|
|||||||
ENV NEXT_TELEMETRY_DISABLED=1 \
|
ENV NEXT_TELEMETRY_DISABLED=1 \
|
||||||
NODE_ENV=production
|
NODE_ENV=production
|
||||||
|
|
||||||
|
# Token público do Logo.dev — injetado em build time (NEXT_PUBLIC_* é inlined pelo Next.js)
|
||||||
|
ARG NEXT_PUBLIC_LOGO_DEV_TOKEN
|
||||||
|
ENV NEXT_PUBLIC_LOGO_DEV_TOKEN=$NEXT_PUBLIC_LOGO_DEV_TOKEN
|
||||||
|
|
||||||
# Build da aplicação Next.js
|
# Build da aplicação Next.js
|
||||||
RUN pnpm build
|
RUN pnpm build
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://biomejs.dev/schemas/2.4.10/schema.json",
|
"$schema": "https://biomejs.dev/schemas/2.4.11/schema.json",
|
||||||
"vcs": {
|
"vcs": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"clientKind": "git",
|
"clientKind": "git",
|
||||||
|
|||||||
@@ -9,11 +9,7 @@ import {
|
|||||||
PopoverTrigger,
|
PopoverTrigger,
|
||||||
} from "@/shared/components/ui/popover";
|
} from "@/shared/components/ui/popover";
|
||||||
import { Spinner } from "@/shared/components/ui/spinner";
|
import { Spinner } from "@/shared/components/ui/spinner";
|
||||||
import {
|
import { buildLogoDevUrl, logoQueryKeys, toNameKey } from "@/shared/lib/logo";
|
||||||
buildLogoDevUrl,
|
|
||||||
logoQueryKeys,
|
|
||||||
toNameKey,
|
|
||||||
} from "@/shared/lib/logo";
|
|
||||||
import {
|
import {
|
||||||
removeEstablishmentLogoAction,
|
removeEstablishmentLogoAction,
|
||||||
saveEstablishmentLogoAction,
|
saveEstablishmentLogoAction,
|
||||||
@@ -84,7 +80,9 @@ export function EstablishmentLogoPicker({
|
|||||||
function handleSelect(domain: string) {
|
function handleSelect(domain: string) {
|
||||||
startTransition(async () => {
|
startTransition(async () => {
|
||||||
await saveEstablishmentLogoAction(name, domain);
|
await saveEstablishmentLogoAction(name, domain);
|
||||||
queryClient.setQueryData(logoQueryKeys.mapping(toNameKey(name)), { domain });
|
queryClient.setQueryData(logoQueryKeys.mapping(toNameKey(name)), {
|
||||||
|
domain,
|
||||||
|
});
|
||||||
onSelect(domain);
|
onSelect(domain);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -128,7 +126,8 @@ export function EstablishmentLogoPicker({
|
|||||||
onClick={handleReset}
|
onClick={handleReset}
|
||||||
className={cn(
|
className={cn(
|
||||||
"flex flex-col items-center gap-1 rounded-md p-1.5 text-center transition-colors hover:bg-accent disabled:opacity-50",
|
"flex flex-col items-center gap-1 rounded-md p-1.5 text-center transition-colors hover:bg-accent disabled:opacity-50",
|
||||||
resolvedDomain === null && "ring-2 ring-primary ring-offset-1",
|
resolvedDomain === null &&
|
||||||
|
"ring-2 ring-primary ring-offset-1",
|
||||||
)}
|
)}
|
||||||
title="Usar iniciais coloridas"
|
title="Usar iniciais coloridas"
|
||||||
>
|
>
|
||||||
@@ -157,7 +156,8 @@ export function EstablishmentLogoPicker({
|
|||||||
onClick={() => handleSelect(r.domain)}
|
onClick={() => handleSelect(r.domain)}
|
||||||
className={cn(
|
className={cn(
|
||||||
"flex flex-col items-center gap-1 rounded-md p-1.5 text-center transition-colors hover:bg-accent disabled:opacity-50",
|
"flex flex-col items-center gap-1 rounded-md p-1.5 text-center transition-colors hover:bg-accent disabled:opacity-50",
|
||||||
resolvedDomain === r.domain && "ring-2 ring-primary ring-offset-1",
|
resolvedDomain === r.domain &&
|
||||||
|
"ring-2 ring-primary ring-offset-1",
|
||||||
)}
|
)}
|
||||||
title={r.name}
|
title={r.name}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import { RiPencilLine } from "@remixicon/react";
|
|||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import {
|
import {
|
||||||
LOGO_DEV_TOKEN,
|
|
||||||
buildLogoDevUrl,
|
buildLogoDevUrl,
|
||||||
|
LOGO_DEV_TOKEN,
|
||||||
logoQueryKeys,
|
logoQueryKeys,
|
||||||
toNameKey,
|
toNameKey,
|
||||||
} from "@/shared/lib/logo";
|
} from "@/shared/lib/logo";
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
|
||||||
import { RiArrowDropDownLine } from "@remixicon/react";
|
import { RiArrowDropDownLine } from "@remixicon/react";
|
||||||
import { cva } from "class-variance-authority";
|
import { cva } from "class-variance-authority";
|
||||||
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
|
|
||||||
import type * as React from "react";
|
import type * as React from "react";
|
||||||
import { cn } from "@/shared/utils";
|
import { cn } from "@/shared/utils";
|
||||||
|
|
||||||
|
|||||||
@@ -48,9 +48,7 @@ export const toNameKey = (name: string): string => name.trim().toLowerCase();
|
|||||||
|
|
||||||
export const LOGO_DEV_TOKEN = process.env.NEXT_PUBLIC_LOGO_DEV_TOKEN;
|
export const LOGO_DEV_TOKEN = process.env.NEXT_PUBLIC_LOGO_DEV_TOKEN;
|
||||||
|
|
||||||
export function buildLogoDevUrl(
|
export function buildLogoDevUrl(domain?: string | null): string | null {
|
||||||
domain?: string | null,
|
|
||||||
): string | null {
|
|
||||||
if (!LOGO_DEV_TOKEN || !domain) return null;
|
if (!LOGO_DEV_TOKEN || !domain) return null;
|
||||||
return `https://img.logo.dev/${domain}?token=${LOGO_DEV_TOKEN}&size=64&format=png`;
|
return `https://img.logo.dev/${domain}?token=${LOGO_DEV_TOKEN}&size=64&format=png`;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user