Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
694f8f5
Refactor sign-in component to add sign-up link
gumiranda Nov 25, 2024
08bbea6
Refactor sign-in component to update sign-up button text
gumiranda Nov 25, 2024
2cd1f4e
Refactor sign-in component to update sign-up button text
gumiranda Nov 25, 2024
acecbcf
Refactor sign-in component to add phone input
gumiranda Nov 25, 2024
e7336fc
Refactor sign-in component to add phone input and update sign-up butt…
gumiranda Nov 25, 2024
75953b8
Add phone input and phone number validation to sign-up form
gumiranda Nov 25, 2024
e6596a4
Refactor phone input component to remove unnecessary code
gumiranda Nov 25, 2024
2d23186
Refactor phone input component to update phone number validation and …
gumiranda Nov 25, 2024
ae6981d
Refactor phone input component to update phone number validation and …
gumiranda Nov 25, 2024
856d99e
Refactor phone input and country selector components
gumiranda Nov 25, 2024
d4db9f7
Refactor phone input and country selector components
gumiranda Nov 25, 2024
beeb0c3
Remover importações não utilizadas no componente AppointmentService
gustavoaguiar-code Feb 3, 2025
9d84dae
Adicionar componentes TweetForm e TweetList para funcionalidade de po…
gustavoaguiar-code Feb 4, 2025
8676aa9
Adicionar seção de Feed com componentes TweetForm e TweetList
gustavoaguiar-code Feb 4, 2025
3a20949
Adicionar animações e tratamento de erros ao componente TweetForm
gustavoaguiar-code Feb 4, 2025
d1becd2
Adicionar modelos e APIs para gerenciamento de tweets e fotos, inclui…
gustavoaguiar-code Feb 4, 2025
78ab143
Adicionar seletor de emoji ao formulário de tweet
gustavoaguiar-code Feb 4, 2025
4c23f6b
Atualizar o placeholder do campo de texto no formulário de tweet para…
gustavoaguiar-code Feb 4, 2025
76c7e29
Adicionar feedback de sucesso ao enviar tweet e traduzir textos para …
gustavoaguiar-code Feb 4, 2025
f88310a
Ajustar layout do formulário de tweet para melhor responsividade e ex…
gustavoaguiar-code Feb 4, 2025
d99fda6
Refatorar lista de tweets para usar componentes de cartão e adicionar…
gustavoaguiar-code Feb 4, 2025
ea55ab5
Ajustar layout do formulário de tweet e melhorar responsividade da pá…
gustavoaguiar-code Feb 4, 2025
40a0798
Ajustar largura máxima de seções para melhorar layout e responsividade
gustavoaguiar-code Feb 4, 2025
e5e4788
Adicionar contêiner de largura máxima para melhorar o layout das pági…
gustavoaguiar-code Feb 4, 2025
d0ea023
Adicionar variante padrão ao botão do formulário de tweet e remover c…
gustavoaguiar-code Feb 4, 2025
55b2f2f
Adicionar suporte a respostas no formulário de tweet, ajustando mensa…
gustavoaguiar-code Feb 4, 2025
0a08e7b
Adicionar componente TweetCard e refatorar TweetList para utilizá-lo
gustavoaguiar-code Feb 4, 2025
cf6b8df
Adicionar suporte a respostas no componente TweetCard e refatorar Twe…
gustavoaguiar-code Feb 4, 2025
88f29dd
Adicionar tipagem ao componente ImageTweet no formulário de tweet
gustavoaguiar-code Feb 4, 2025
6bc3254
Ajustar o componente ImageTweet para limitar a altura da imagem e mel…
gustavoaguiar-code Feb 4, 2025
fc365cb
Adicionar suporte a respostas no componente TweetCard e refatorar Twe…
gustavoaguiar-code Feb 4, 2025
c5d13f3
Ajustar layout do componente principal para suportar flexbox em telas…
gustavoaguiar-code Feb 4, 2025
acc66c2
Ajustar margens do layout para suportar telas extra grandes
gustavoaguiar-code Feb 4, 2025
117865e
Remover botão de compartilhamento do componente TweetCard e ajustar l…
gustavoaguiar-code Feb 4, 2025
babeac9
Refatorar componentes TweetCard e TweetList para utilizar novas propr…
gustavoaguiar-code Feb 7, 2025
dd345da
Adicionar funcionalidade de curtir no componente TweetCard e refatora…
gustavoaguiar-code Feb 7, 2025
1ac1c29
Adicionar tipagem ao parâmetro de item na verificação de curtidas no …
gustavoaguiar-code Feb 7, 2025
5a1f3b4
Adicionar componente Toaster e hook useToast para gerenciar notificaç…
gustavoaguiar-code Feb 7, 2025
91d4ac4
Adicionar Toaster do Shadcn ao provedor de contexto
gustavoaguiar-code Feb 7, 2025
a6ed23b
Adicionar suporte à rolagem infinita na lista de tweets e refatorar o…
gustavoaguiar-code Feb 7, 2025
a6b86d2
Refatorar componente TweetCard para suportar quebra de linha e limita…
gustavoaguiar-code Feb 7, 2025
3614fa4
Remover a dependência de cookies do componente TweetList na página de…
gustavoaguiar-code Feb 7, 2025
ceffc6e
Adicionar animações e tratamento de erros ao componente TweetList par…
gustavoaguiar-code Feb 7, 2025
3424bce
Remover importação do componente TweetForm e ajustar a lógica de trat…
gustavoaguiar-code Feb 12, 2025
e0e927b
Ajustar a lógica de tratamento de tweets para garantir que um array v…
gustavoaguiar-code Feb 12, 2025
e39cc75
Refatorar a lógica de obtenção de tweets para utilizar a função getAx…
gustavoaguiar-code Feb 17, 2025
d844e47
Adicionar verificação de autenticação ao clicar em responder tweet, e…
gustavoaguiar-code Feb 17, 2025
a51f852
Adicionar suporte ao campo 'place' no modelo Owner e atualizar a lógi…
gustavoaguiar-code Feb 17, 2025
f956472
Adicionar componente Avatar para exibir a foto de perfil do proprietá…
gustavoaguiar-code Feb 17, 2025
02081d7
Ajustar o tamanho do componente Avatar na página de detalhes do propr…
gustavoaguiar-code Feb 17, 2025
fd34c6b
Atualizar a lógica de exibição do componente OwnerItem para utilizar …
gustavoaguiar-code Feb 17, 2025
f04f24e
Adicionar página de verificação de email e componente de fallback par…
gustavoaguiar-code Mar 5, 2025
df0bd6e
Merge branch 'dev2' into develop
gustavoaguiar-code Mar 5, 2025
4c8fe3e
Refactor email verification logic and move verifyEmail function to a …
gustavoaguiar-code Mar 5, 2025
bde899a
Refactor email verification process to use API instance and improve e…
gustavoaguiar-code Mar 5, 2025
3f2aa9a
Add missing Link import in FallbackEmailVerified component
gustavoaguiar-code Mar 5, 2025
67be4e3
Add geolocation support to signup process and update coordinate handling
gustavoaguiar-code Mar 5, 2025
7d90a67
Refactor imports to separate cookie handling and improve code organiz…
gustavoaguiar-code Mar 5, 2025
cc0781b
Fix import path for SignInDiv component to reflect updated directory …
gustavoaguiar-code Mar 5, 2025
68bee76
Adicionar página de recuperação de senha com validação de email e fee…
gustavoaguiar-code Mar 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions crazystacknextjs/next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ const nextConfig: NextConfig = {
protocol: "https",
hostname: "images.unsplash.com",
},
{
protocol: "https",
hostname:
"crazystack.571527a8590aad1eb25dc5b3338c4271.r2.cloudflarestorage.com",
},
],
},
};
Expand Down
7 changes: 7 additions & 0 deletions crazystacknextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
"lint": "next lint"
},
"dependencies": {
"@emoji-mart/data": "^1.2.1",
"@emoji-mart/react": "^1.1.1",
"@hookform/resolvers": "^3.9.1",
"@radix-ui/react-avatar": "^1.1.1",
"@radix-ui/react-checkbox": "^1.1.2",
Expand All @@ -26,16 +28,21 @@
"@radix-ui/react-slot": "^1.1.0",
"@radix-ui/react-switch": "^1.1.1",
"@radix-ui/react-tabs": "^1.1.1",
"@radix-ui/react-toast": "^1.2.6",
"@radix-ui/react-tooltip": "^1.1.3",
"@react-input/mask": "^1.2.15",
"@tanstack/react-query": "^5.59.16",
"axios": "^1.7.7",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"date-fns": "^4.1.0",
"emoji-mart": "^5.6.0",
"framer-motion": "^12.0.11",
"i18next": "^23.16.4",
"i18next-chained-backend": "^4.6.2",
"i18next-http-backend": "^2.6.2",
"i18next-resources-to-backend": "^1.2.1",
"libphonenumber-js": "^1.11.15",
"lucide-react": "^0.454.0",
"next": "15.0.2",
"next-themes": "^0.3.0",
Expand Down
Binary file removed crazystacknextjs/public/banner-01.png
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import Link from "next/link";

export const TermsAndConditions = () => {
return (
<p className="mt-4 px-8 text-center text-sm text-muted-foreground">
Clicando em continuar, você concorda com nossos{" "}
<Link
href="/terms"
className="underline underline-offset-4 hover:text-primary"
>
Termos de serviço
</Link>{" "}
e{" "}
<Link
href="/terms"
className="underline underline-offset-4 hover:text-primary"
>
Política de privacidade
</Link>
</p>
);
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { LoginForm } from "@/slices/general/features/login";
import Link from "next/link";
import { TermsAndConditions } from "../../_components/terms-and-conditions";

export const SignInDiv = () => {
return (
Expand All @@ -18,22 +19,7 @@ export const SignInDiv = () => {
</div>
</div>
<LoginForm />
<p className="mt-4 px-8 text-center text-sm text-muted-foreground">
Clicando em continuar, você concorda com nossos{" "}
<Link
href="/terms"
className="underline underline-offset-4 hover:text-primary"
>
Termos de serviço
</Link>{" "}
e{" "}
<Link
href="/terms"
className="underline underline-offset-4 hover:text-primary"
>
Política de privacidade
</Link>
</p>
<TermsAndConditions />
<p className="mt-4 text-center text-sm text-muted-foreground">
Ainda não tem uma conta?{" "}
<Link
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Metadata } from "next";
import { whitelabel } from "@/application/whitelabel";
import { SideDiv } from "./_components/side-div";
import { SignInDiv } from "./_components/signin-div";
import { SideDiv } from "../_components/side-div";

export const metadata: Metadata = {
title: `${whitelabel.systemName} | Entrar`,
Expand Down
34 changes: 34 additions & 0 deletions crazystacknextjs/src/app/(auth)/signup/_components/signup-div.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { SignUpForm } from "@/slices/general/features/signup";
import Link from "next/link";
import { TermsAndConditions } from "../../_components/terms-and-conditions";

export const SignUpDiv = () => {
return (
<div className="mt-8 lg:mt-0 p-8">
<div
className="mx-auto flex w-full flex-col justify-center
space-y-6 sm:w-[350px]"
>
<div className="flex flex-col space-y-2 text-center mb-4">
<h1 className="text-2xl font-semibold tracking-tight font-inter">
Criar conta
</h1>
<p className="text-sm text-muted-foreground font-inter">
Digite seu email e senha para criar sua conta
</p>
</div>
</div>
<SignUpForm />
<TermsAndConditions />
<p className="mt-4 text-center text-sm text-muted-foreground">
Já tem uma conta?{" "}
<Link
href="/signup"
className="font-semibold text-primary hover:underline"
>
Entre aqui
</Link>
</p>
</div>
);
};
21 changes: 21 additions & 0 deletions crazystacknextjs/src/app/(auth)/signup/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import type { Metadata } from "next";
import { whitelabel } from "@/application/whitelabel";
import { SignUpDiv } from "./_components/signup-div";
import { SideDiv } from "../_components/side-div";

export const metadata: Metadata = {
title: `${whitelabel.systemName} | Entrar`,
description: `Página de login do ${whitelabel.systemName}. Faça login para acessar o sistema.`,
};
export default function Login() {
return (
<div
className="container relative h-[800px] flex-col items-center justify-center
md:grid lg:max-w-none lg:grid-cols-2 lg:px-0
"
>
<SideDiv />
<SignUpDiv />
</div>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from "react";
import data from "@emoji-mart/data";
import Picker from "@emoji-mart/react";

interface EmojiPickerProps {
onEmojiSelect: (emoji: string) => void;
}

const EmojiPicker: React.FC<EmojiPickerProps> = ({ onEmojiSelect }) => {
return (
<Picker
data={data}
onEmojiSelect={(emoji: any) => onEmojiSelect(emoji.native)}
theme="light"
showPreview={false}
showSkinTones={false}
emojiSize={20}
emojiButtonSize={28}
maxFrequentRows={4}
/>
);
};

export default EmojiPicker;
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
"use client";

import { useState, useCallback, useEffect } from "react";
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
import { Button } from "@/components/ui/button";
import {
Card,
CardContent,
CardFooter,
CardHeader,
} from "@/components/ui/card";
import { Heart, MessageCircle, Repeat2 } from "lucide-react";
import { TweetForm } from "./tweet-form";
import { toggleLike } from "@/slices/belezix/entidades/tweet/tweet.api";
import { useAuth } from "@/shared/libs/contexts/AuthContext";
import { parseCookies } from "nookies";
import { useToast } from "@/hooks/use-toast";

export const TweetCard = ({
tweet,
canReply = false,
handleChangeCanReply,
ref,
}: any) => {
const { user } = useAuth();
const { toast } = useToast();
const isReply = !!tweet?.tweetId;
const [likeCount, setLikeCount] = useState(
Number(tweet?.tweetlike?.total ?? 0),
);
const [isLiked, setIsLiked] = useState(
tweet?.tweetlike?.find?.((item: any) => item?.createdById === user?._id),
);
const [isLikeLoading, setIsLikeLoading] = useState(false);

useEffect(() => {
setLikeCount(Number(tweet?.tweetlike?.total ?? 0));
setIsLiked(
tweet?.tweetlike?.find?.((item: any) => item?.createdById === user?._id),
);
}, [tweet, user]);

const handleLikeClick = useCallback(async () => {
if (!user) {
toast({
title: "Authentication required",
description: "Please log in to like tweets.",
variant: "destructive",
});
return;
}

setIsLikeLoading(true);
try {
await toggleLike({
tweetlike: { tweetId: tweet?._id, userSlug: user?.slug },
cookies: parseCookies(),
});
setLikeCount((prev: any) => (isLiked ? prev - 1 : prev + 1));
setIsLiked(!isLiked);
} catch (error) {
console.error("Error toggling like:", error);
toast({
title: "Error",
description: "Failed to update like status. Please try again.",
variant: "destructive",
});
} finally {
setIsLikeLoading(false);
}
}, [isLiked, tweet?._id, user, toast]);

return (
<Card className="w-full" ref={ref}>
<CardHeader className="flex flex-row items-center space-x-4 pb-2">
<Avatar className="w-12 h-12">
<AvatarImage
src={tweet?.createdBy?.photo}
alt={tweet?.createdBy?.name}
/>
<AvatarFallback>{tweet?.createdBy?.slug?.charAt?.(0)}</AvatarFallback>
</Avatar>
<div className="flex-1">
<div className="flex items-center justify-between">
<div>
<h3 className="font-bold text-lg">@{tweet?.createdBy?.slug}</h3>
<p className="text-sm text-gray-500">{tweet?.createdBy?.name}</p>
</div>
<p className="text-sm text-gray-500">{tweet?.distanceNow}</p>
</div>
</div>
</CardHeader>
<CardContent>
<p
className="mb-4 text-lg leading-relaxed line-clamp-6"
style={{ wordBreak: "break-word" }}
>
{tweet?.body}
</p>
{tweet?.image && (
<img
src={tweet?.image || "/placeholder.svg"}
alt="Tweet image"
className="w-full rounded-lg mb-4 object-cover h-64"
/>
)}
</CardContent>
<CardFooter>
<div className="flex justify-between w-full">
<Button
variant="ghost"
size="sm"
className="flex items-center space-x-2 text-gray-500 hover:text-blue-500 transition-colors"
onClick={() => {
if (!user) {
toast({
title: "Authentication required",
description: "Please log in to reply tweets.",
variant: "destructive",
});
return;
}
handleChangeCanReply({ tweet });
}}
>
<MessageCircle className="w-5 h-5" />
<span>{tweet?.replies}</span>
</Button>
<Button
variant="ghost"
size="sm"
className="flex items-center space-x-2 text-gray-500 hover:text-green-500 transition-colors"
onClick={() => {}}
>
<Repeat2 className="w-5 h-5" />
<span>{tweet?.retweets}</span>
</Button>
<Button
variant="ghost"
size="sm"
className={`flex items-center space-x-2 transition-colors ${
isLiked
? "text-red-500 hover:text-red-600"
: "text-gray-500 hover:text-red-500"
}`}
onClick={handleLikeClick}
disabled={isLikeLoading}
>
<Heart
className={`w-5 h-5 transition-transform duration-300 ${
isLiked ? "fill-current scale-110" : ""
}`}
/>
<span className="font-semibold">{likeCount}</span>
</Button>
</div>
</CardFooter>
{canReply && (
<div className="m-4 rounded-lg shadow-md max-w-2xl">
<TweetForm tweetId={tweet?._id} />
</div>
)}
</Card>
);
};
Loading