Skip to content

Commit

Permalink
Merge pull request #26 from No-Country-simulation/frontend-fixes
Browse files Browse the repository at this point in the history
fix(frontend): 💄 update description in photo details, and minor style fixes
  • Loading branch information
lazaronazareno authored Sep 16, 2024
2 parents cb3c255 + 652418c commit bf5cd15
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 15 deletions.
11 changes: 11 additions & 0 deletions frontend/public/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed frontend/public/logo.webp
Binary file not shown.
Binary file modified frontend/src/app/favicon.ico
Binary file not shown.
6 changes: 3 additions & 3 deletions frontend/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import "./globals.css";
const inter = Poppins({ subsets: ["latin"], weight: ["300", "600"] });

export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
title: "Oh My Trip",
description: "Red Social por y para Viajeros",
};

export default function RootLayout({
Expand All @@ -17,7 +17,7 @@ export default function RootLayout({
return (
<html lang="en">
<body className={inter.className}>
<main className="max-w-[1000px] mx-auto">
<main className="max-w-[1000px] mx-auto text-TextPrimary">
{children}
</main>
</body>
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CardFeed, SwiperUsers } from "@/components"
import { AlbumFromFetch } from "@/interfaces/album"
import { User } from "@/interfaces/user"
import logo from "/public/logo.webp"
import logo from "/public/logo.svg"
import { Footer } from "@/ui"
import { Suspense } from "react"
import Image from "next/image"
Expand All @@ -25,9 +25,9 @@ export default async function Home() {
// </main>

<>
<div className="py-8 px-2">
<figure>
<Image src={logo} alt="" className="mx-auto py-6 h-[90px] w-auto" />
<div className="pb-8 px-2">
<figure className="w-full border-b">
<Image src={logo} alt="oh my trip logo" className="mx-auto h-8 w-48 my-6" />
</figure>
<Suspense fallback={<span>Cargando usuarios</span>}>
<SwiperUsers users={userResults} />
Expand Down
13 changes: 10 additions & 3 deletions frontend/src/app/photo/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
import { getAlbumById } from "@/actions/albumActions";
import { BackArrow, SwiperImages } from "@/components";
import ReadOnlyEditor from "@/components/LexicalEditor/ReadOnly";
import { AlbumFromFetch } from "@/interfaces/album";

export default async function PhotoPage({ params }: { params: { id: string } }) {

const album: AlbumFromFetch = await getAlbumById(params.id)

return (
<div className="min-h-screen pt-8 ">
<div className="absolute inset-0 bg-black opacity-70" />
<div className="min-h-screen pt-8 bg-black/70">
<div className="absolute inset-0" />
<BackArrow className="text-white relative z-50" />

<div className="mt-10 relative z-50">
<SwiperImages images={album.photos} />
<p className="text-white mt-4 line-clamp-3 px-4">{album.description}</p>
<div className="text-white mt-4 line-clamp-3 px-4">
{
album.description.includes('"root":')
? <ReadOnlyEditor feed={false} savedContent={album.description} />
: <p>{album.description}</p>
}
</div>
</div>
</div>
);
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/Cards/CardFeed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ export async function CardFeed({ album }: { album: AlbumFromFetch }) {
<AVisitar album={album} />
</div>

<div className="flex flex-wrap px-10">
<Link href={'/perfil/' + album.userId}><strong>{album.userId}:</strong></Link>
<div className="flex flex-wrap px-4">
<Link href={'/perfil/' + album.userId} className="font-bold underline">{user?.username}:</Link>
{
album.description.includes('"root":')
? <ReadOnlyEditor feed savedContent={album.description} />
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/swiper/SwiperUsers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function SwiperUsers({ users }: { users: User[] }) {
<SwiperSlide key={i} style={{ "display": "flex", "flexDirection": "column", "alignItems": "start", "minWidth": "80px", "overflow": "hidden" } as React.CSSProperties}>
<Link href={'/perfil/' + user._id}>
<Image src={user.imageUrl || imageAvatar} alt="foto" width={400} height={400} className="rounded-full object-cover size-20" />
<h2 className="text-center flex-col truncate">{user.username}</h2>
<h2 className="text-center flex-col truncate text-TextPrimary font-semibold">{user.username}</h2>
</Link>
</SwiperSlide>
))
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/ui/perfil/TopMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ export default function TopMenu({ id }: { id: string }) {


return (
<div className="flex justify-between bg-[#D9D9D9] pt-10 pb-2 px-2 text-[#979797]">
<div className="flex justify-between bg-FondoPrimary pt-10 pb-2 px-2 text-white">
<Link href={'/'}>
<BackArrow />
</Link>
<h1 className=" font-bold text-xl text-black">
<h1 className=" font-bold text-xl">
{
token === id ? "Mi Perfil" : "Perfil"
}
Expand Down

0 comments on commit bf5cd15

Please sign in to comment.