Skip to content

Commit

Permalink
v0.2.0 (#33)
Browse files Browse the repository at this point in the history
* [DEV-41] add auto migration to envs (#26)

* chore: updated .env.example

* chore: added vscode extensions recommendations

* chore: updated dependencies

* chore: updated README

* chore: updated dependencies

* chore: moved tailwind import to js

* chore: added tests to env variables

* chore: added env vault config

* chore: work on workflows

* chore: updated bun lock

* chore: updated dependencies

* chore: force build step to bundle env

* chore: force build step to bundle env

* chore: updated dotenv-vault

* feat: bumped vault version

* chore: I give up on dotenv-vault

* chore: removed vault from workflow

* chore: updated envs to work on both states

* [DEV-54] repository enhancements and utilities package (#29)

* chore: upgraded dependencies

* feat: added banner to readme

* feat: added code of conduct

* feat: added contributing guide

* test: move md files to github dir

* chore: renamed contributing to github standard

* feat: added screenshot to readme

* chore: updaded pr template

* feat: added bug report issue template

* feat: added base shared package

* chore: moved api to js export

* feat: finished api integration

* chore: updated dependencies

* chore: updated dependencies

* feat: moved service and api to shared lib

* chore: enhanced tests

* feat: added tests

* chore: added type tests to CICD

* feat: added api tests

* feat: added test type entry

* chore: removed prisma ads

* [DEV-12] Enhance profile creation page (#30)

* chore: removed prisma ads

* fix: 404 thrown on non localized pages

* fix: missing textures on cards

* feat: refactored profile form

* feat: enhanced legal documents

* feat: enhanced footer

* chore: disabled prefetch

* chore: enhanced app metadata

* chore: enhanced app metadata

* chore: enhanced app metadata

* chore: enhanced app metadata

* chore: enhanced not found page

* chore: enhanced app metadata

* fix: link inserting locale

* chore: minor style fixes

* chore: minor style fixes

* feat: added update missing person status
  • Loading branch information
darklight9811 authored Sep 12, 2024
1 parent 4904f65 commit c069471
Show file tree
Hide file tree
Showing 40 changed files with 392 additions and 201 deletions.
20 changes: 10 additions & 10 deletions apps/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,36 @@
"postinstall": "cd ../../ && bun run postinstall"
},
"dependencies": {
"@clerk/localizations": "^2.8.1",
"@clerk/nextjs": "^5.4.1",
"@clerk/localizations": "^3.0.1",
"@clerk/nextjs": "^5.5.2",
"@react-pdf/renderer": "^3.4.4",
"@repo/ds": "1.0.0",
"@repo/env": "1.0.0",
"@repo/schemas": "1.0.0",
"@repo/services": "1.0.0",
"@tanstack/react-query": "^5.54.1",
"@tanstack/react-query-devtools": "^5.54.1",
"@tanstack/react-query": "^5.55.4",
"@tanstack/react-query-devtools": "^5.55.4",
"@upstash/ratelimit": "^2.0.2",
"@vercel/analytics": "^1.3.1",
"@vercel/functions": "^1.4.1",
"@vercel/kv": "^2.0.0",
"@vercel/speed-insights": "^1.0.12",
"@yamiassu/shared": "*",
"lucide-react": "^0.438.0",
"next": "^14.2.8",
"next-intl": "^3.19.0",
"lucide-react": "^0.439.0",
"next": "^14.2.10",
"next-intl": "^3.19.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"zod": "^3.23.8"
},
"devDependencies": {
"@repo/config": "0.0.0",
"@types/node": "^22.5.3",
"@types/node": "^22.5.4",
"@types/react": "^18.3.5",
"@types/react-dom": "^18.3.0",
"autoprefixer": "^10.4.20",
"postcss": "^8.4.45",
"tailwindcss": "^3.4.10",
"typescript": "^5.5.4"
"tailwindcss": "^3.4.11",
"typescript": "^5.6.2"
}
}
21 changes: 11 additions & 10 deletions apps/app/src/app/(app)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ import Image from "next/image";

export default function Page() {
return (
<>
<main className="flex flex-col w-full grow relative">
{/**
* ### MARK: Hero
*/}

<div className="flex flex-col justify-center min-h-[800px] md:min-h-[1000px] items-center relative pb-[20vh] px-2 md:mb-[450px]">
<div className="flex flex-col justify-center h-full min-h-[800px] md:min-h-[1000px] items-center relative pb-[50vh] px-2 overflow-hidden">
<img
src="/images/arts/splash_01.svg"
alt=""
fetchPriority="high"
className="absolute z-[-1] w-full min-w-[840px] bg-cover"
className="absolute xl:top-[-40vh] z-[-1] w-full min-w-[840px] bg-cover"
/>

<h1 className="text-3xl md:text-7xl font-bold max-w-screen-xl text-center text-white animate-top-in mb-8">
Expand All @@ -35,7 +35,7 @@ export default function Page() {
src="/images/arts/line_01.svg"
alt=""
fetchPriority="high"
className="absolute z-[-1] w-full !top-[70%]"
className="absolute z-[-1] w-full !top-[50%]"
/>

<Link
Expand All @@ -54,7 +54,7 @@ export default function Page() {
alt=""
width={1100}
height={679}
className="z-[-1] absolute top-[65%]"
className="z-[-1] absolute top-[50%]"
priority
/>
</div>
Expand All @@ -66,6 +66,7 @@ export default function Page() {
<div className="container mx-auto flex flex-col md:flex-row gap-10">
<div className="w-full sm:w-1/2">
<Image
loading="eager"
src="/images/arts/people_01.png"
alt=""
width={600}
Expand Down Expand Up @@ -114,13 +115,13 @@ export default function Page() {
<Image
src="/images/screenshots/app_store.png"
alt=""
width={120}
width={136}
height={40}
/>
<Image
src="/images/screenshots/play_store.png"
alt=""
width={120}
width={136}
height={40}
className="opacity-50"
/>
Expand Down Expand Up @@ -252,9 +253,9 @@ export default function Page() {
*/}

<div className="md:mb-32">
<h1 className="text-slate-900 text-2xl md:text-6xl font-extrabold text-center">
<h2 className="text-slate-900 text-2xl md:text-6xl font-extrabold text-center">
Perguntas frequentes
</h1>
</h2>

<Accordion
type="single"
Expand Down Expand Up @@ -348,6 +349,6 @@ export default function Page() {
</Link>
</div>
</div>
</>
</main>
);
}
82 changes: 36 additions & 46 deletions apps/app/src/app/(app)/profiles/[id]/edit/page.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
import { Link } from "@/lib/navigation";
import parallel from "@/lib/parallel";
import DeleteModal from "@/modules/general/dialogs/delete-dialog";
import * as actions from "@/modules/profile/actions";
import ProfileForm from "@/modules/profile/components/profile-form";
import FindDialog from "@/modules/profile/dialogs/find-dialog";
import { currentUser } from "@/modules/user/loaders";
import Form from "@repo/ds/form/form";
import { Button, buttonVariants } from "@repo/ds/ui/button";
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
} from "@repo/ds/ui/dialog";
import type { ProfileUpdateSchema } from "@repo/schemas/profile";
import type {
ProfileFindSchema,
ProfileUpdateSchema,
} from "@repo/schemas/profile";
import profileService from "@repo/services/profile";
import { Eye, Trash } from "lucide-react";
import { Eye, SaveIcon, Trash } from "lucide-react";
import { notFound } from "next/navigation";

export default async function Page({ params }: { params: { id: string } }) {
Expand All @@ -33,6 +28,12 @@ export default async function Page({ params }: { params: { id: string } }) {
return actions.update({ id: params.id, data: data as ProfileUpdateSchema });
}

async function find(data: ProfileFindSchema) {
"use server";

return actions.find({ id: params.id, data });
}

async function remove() {
"use server";

Expand All @@ -52,42 +53,31 @@ export default async function Page({ params }: { params: { id: string } }) {
>
<Eye />
</Link>
<Dialog>
<DialogTrigger asChild>
<Button variant="destructive" size="icon" type="button">
<Trash />
</Button>
</DialogTrigger>

<DialogContent>
<DialogHeader>
<DialogTitle>Você tem certeza?</DialogTitle>
<DialogDescription>
Essa ação não é reversivel, os dados serão perdidos
permanentemente
</DialogDescription>
</DialogHeader>

<DialogFooter>
<DialogTrigger asChild>
<Button variant="outline">Voltar</Button>
</DialogTrigger>
<Form onSubmit={remove}>
<Button variant="destructive" className="ml-auto">
Apagar
</Button>
</Form>
</DialogFooter>
</DialogContent>
</Dialog>
<DeleteModal submit={remove}>
<Button variant="destructive" size="icon">
<Trash />
</Button>
</DeleteModal>
</h1>

<ProfileForm onSubmit={update} data={data} schema="update" require>
<Link href="/" className={buttonVariants({ variant: "outline" })}>
Voltar
</Link>
<Button type="submit" className="w-full max-w-[180px]">
Atualizar
<ProfileForm onSubmit={update} data={data}>
<DeleteModal submit={remove}>
<Button variant="destructive" size="icon">
<Trash />
</Button>
</DeleteModal>
<FindDialog submit={find}>
<Button
size="icon"
variant="success"
disabled={!!data.date_found}
className="w-full md:max-w-[180px]"
>
Encontrado
</Button>
</FindDialog>
<Button type="submit" size="icon">
<SaveIcon />
</Button>
</ProfileForm>
</main>
Expand Down
24 changes: 9 additions & 15 deletions apps/app/src/app/(app)/profiles/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { Link } from "@/lib/navigation";
import parallel from "@/lib/parallel";
import { baseUrl } from "@/lib/url";
import Banner from "@/modules/profile/components/banner";
import ReportDialog from "@/modules/report/components/report-dialog";
import { ContactDialog } from "@/modules/profile/dialogs/contact-dialog";
import ReportDialog from "@/modules/report/dialogs/report-dialog";
import { currentUser } from "@/modules/user/loaders";
import { Avatar, AvatarFallback, AvatarImage } from "@repo/ds/ui/avatar";
import { Button, buttonVariants } from "@repo/ds/ui/button";
Expand All @@ -27,7 +28,6 @@ import { getLocale, getTranslations } from "next-intl/server";
import { headers } from "next/headers";
import Image from "next/image";
import { notFound } from "next/navigation";
import { FindDialog } from "./_components/find-dialog";

/**
* ### MARK: Metadata
Expand Down Expand Up @@ -118,23 +118,17 @@ export default async function Page({ params }: { params: { id: string } }) {
</div>

<div className="flex gap-2 mt-4">
<FindDialog contact={data.contact}>
<Button type="button" className="w-full">
{t("found")}
</Button>
</FindDialog>
<ContactDialog contact={data.contact}>
<Button className="w-full">{t("found")}</Button>
</ContactDialog>
<Tooltip>
{!canReport && (
<TooltipContent>{t("already_reported")}</TooltipContent>
)}
<TooltipTrigger asChild>
<div>
<ReportDialog data={{ id_profile: data.id }}>
<Button
type="button"
variant="destructive"
disabled={!canReport}
>
<Button variant="destructive" disabled={!canReport}>
<Flag />
</Button>
</ReportDialog>
Expand All @@ -148,7 +142,7 @@ export default async function Page({ params }: { params: { id: string } }) {
link={`${baseUrl()}/profiles/${data.id}`}
description={t("help", { profile: data.name })}
>
<Button type="button" size="icon">
<Button size="icon">
<Share2 />
</Button>
</Share>
Expand All @@ -157,7 +151,7 @@ export default async function Page({ params }: { params: { id: string } }) {
description={data.description}
contact={data.contact?.options as { type: string; value: string }[]}
>
<Button type="button" size="icon">
<Button size="icon">
<Printer />
</Button>
</Banner>
Expand All @@ -172,7 +166,7 @@ export default async function Page({ params }: { params: { id: string } }) {
>
<Edit />
</Link>
<Button type="button" size="icon" variant="destructive">
<Button size="icon" variant="destructive">
<Trash />
</Button>
</>
Expand Down
1 change: 0 additions & 1 deletion apps/app/src/app/(app)/profiles/_components/filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ export function Filter(props: Props) {
Aplicar
</Button>
<Button
type="button"
size="icon"
variant="destructive"
className="px-2"
Expand Down
9 changes: 6 additions & 3 deletions apps/app/src/app/(app)/profiles/new/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,19 @@ export default function Page() {
}

return (
<main className="grow flex flex-col justify-center items-center my-16 px-2">
<main className="grow flex flex-col justify-center items-center my-16 px-4">
<h1 className="w-full max-w-5xl text-3xl font-bold mb-4 text-primary">
{t("create-title")}
</h1>

<ProfileForm onSubmit={store}>
<Link href="/" className={buttonVariants({ variant: "outline" })}>
<Link
href="/profiles"
className={buttonVariants({ variant: "outline" })}
>
{t("back")}
</Link>
<Button type="submit" className="w-full max-w-[180px]">
<Button type="submit" className="w-full md:max-w-[180px]">
{t("create")}
</Button>
</ProfileForm>
Expand Down
4 changes: 2 additions & 2 deletions apps/app/src/app/(auth)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import Footer from "../_components/footer";
export default function Layout({ children }: { children: React.ReactNode }) {
return (
<>
<div className="relative grow flex flex-col justify-center items-center overflow-hidden animate-fade-in pb-[15vh]">
<span className="absolute top-1 left-1 flex gap-2 opacity-50 text-primary">
<div className="relative grow flex flex-col justify-center items-center animate-fade-in py-[15vh]">
<span className="absolute top-3 left-3 flex gap-2 opacity-50 text-primary">
<Image
alt="logo"
height={20}
Expand Down
4 changes: 2 additions & 2 deletions apps/app/src/app/_components/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ export default function Footer(props: Props) {
return (
<footer
className={cn(
"w-full flex flex-col flex-wrap gap-4 justify-evenly items-center py-4 px-2",
"w-full flex flex-col flex-wrap gap-4 justify-evenly items-center p-4",
props.className,
)}
>
<div className="flex flex-col md:flex-row text-center md:text-left container mx-auto gap-8">
<div className="flex flex-col md:flex-row text-center md:text-left !p-0 container mx-auto gap-8">
<div className="flex flex-col w-full md:w-1/4">
<Link
href="/"
Expand Down
4 changes: 1 addition & 3 deletions apps/app/src/app/error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ export default function ErrorPage({
)}

<div className="flex gap-2">
<Button type="button" onClick={reset}>
Tentar novamente
</Button>
<Button onClick={reset}>Tentar novamente</Button>
<Link href="/" className={buttonVariants()}>
Ir para home
</Link>
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/app/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export async function generate(lang: string) {
description: t("description"),
start_url: "/",
display: "browser",
background_color: "#DFF2FD",
background_color: "#3a506b",
theme_color: "#3a506b",
orientation: "portrait",
dir: "ltr",
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/components/share.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default function Share(props: Props) {
return (
<DialogDrawer>
<DialogDrawerTrigger asChild>
{props.children || <Button type="button">Compartilhar</Button>}
{props.children || <Button>Compartilhar</Button>}
</DialogDrawerTrigger>

<DialogDrawerContent
Expand Down
Loading

0 comments on commit c069471

Please sign in to comment.