Skip to content
Snippets Groups Projects
Commit 09c82d8d authored by Yusuf Akgül's avatar Yusuf Akgül :hatching_chick:
Browse files

fixed back button, updated packages, made adjustements

parent f5ccf2cb
No related branches found
No related tags found
1 merge request!30Rewrite.gweets
Pipeline #38794 failed
Showing
with 55 additions and 53 deletions
import AddGameDropdown from "@/components/add-game-dropdown"; import AddGameDropdown from "@/components/add-game-dropdown";
import AddGameToFinishedList from "@/components/add-game-to-finished-list";
import AddGameToPlanList from "@/components/add-game-to-plan-list";
import AddGameToPlayingList from "@/components/add-game-to-playing-list";
import AddGameToFavList from "@/components/addGameToFavList"; import AddGameToFavList from "@/components/addGameToFavList";
import { BackHeader } from "@/components/back-header";
import { AspectRatio } from "@/components/ui/aspect-ratio"; import { AspectRatio } from "@/components/ui/aspect-ratio";
import { Button } from "@/components/ui/button"; import { Button } from "@/components/ui/button";
import { Card } from "@/components/ui/card"; import { Card } from "@/components/ui/card";
...@@ -36,6 +34,12 @@ export default async function GameDetail({ params }: { params: { gameid: string ...@@ -36,6 +34,12 @@ export default async function GameDetail({ params }: { params: { gameid: string
return ( return (
<div className="main-content h-full"> <div className="main-content h-full">
<Card className="w-full h-full overflow-hidden"> <Card className="w-full h-full overflow-hidden">
<div className="p-3">
<BackHeader>
<h1 className="font-bold">Game</h1>
</BackHeader>
</div>
<div className="h-64 overflow-hidden"> <div className="h-64 overflow-hidden">
<AspectRatio ratio={889 / 500}> <AspectRatio ratio={889 / 500}>
<Image <Image
......
...@@ -7,7 +7,7 @@ export default async function GamesPage() { ...@@ -7,7 +7,7 @@ export default async function GamesPage() {
return ( return (
<main className="main-content"> <main className="main-content">
<div className="flex justify-center"> <div className="flex justify-center">
<div className="fixed top-30 z-50"> <div className="fixed top-30 z-40">
<ScrollToTop /> <ScrollToTop />
</div> </div>
<InfiniteScrollGames /> <InfiniteScrollGames />
......
// import { PostCommentForm } from "@/components/comment-gweets";
export default async function PostDetail({ params }: { params: { postid: string } }) {
const postid = params.postid
return (
<div className="main-content px-3 pb-3">
<div className="lg:col-span-1">
{/* <PostCommentForm postid={postid} /> */}
</div>
<div className="side-content">
<div className="flex-col">
</div>
</div>
</div>
)
}
\ No newline at end of file
import { BackHeader } from "@/components/back-header";
import { GweetDetails } from "@/components/gweets/components/gweet-details"; import { GweetDetails } from "@/components/gweets/components/gweet-details";
import { GweetHeader } from "@/components/layout"; import { Card } from "@/components/ui/card";
export default async function GweetDetailPage() { export default async function GweetDetailPage() {
return ( return (
<div> <Card className="w-full h-full p-3 xl:p-6 ">
<GweetHeader /> <BackHeader>
<h1 className="font-bold">Gweet</h1>
</BackHeader>
<GweetDetails /> <GweetDetails />
</div> </Card>
); );
}; };
\ No newline at end of file
...@@ -16,7 +16,7 @@ export default async function ContentLayout({ ...@@ -16,7 +16,7 @@ export default async function ContentLayout({
return ( return (
<div className="flex min-h-screen flex-col space-y-6"> <div className="flex min-h-screen flex-col space-y-6">
<header className="sticky top-0 z-40 border-b bg-background"> <header className="sticky top-0 z-50 border-b bg-background">
<div className="container flex h-16 items-center justify-between py-4"> <div className="container flex h-16 items-center justify-between py-4">
<MainNav /> <MainNav />
<SearchInput className="p-3 md:w-2/3 2xl:w-1/3" /> <SearchInput className="p-3 md:w-2/3 2xl:w-1/3" />
......
import { Inter } from 'next/font/google' import { Inter } from 'next/font/google'
import './globals.css' import './globals.css'
import Providers from '@/components/react-query/provider'
import { ThemeProvider } from '@/components/ui/theme-provider' import { ThemeProvider } from '@/components/ui/theme-provider'
import { Toaster } from '@/components/ui/toaster' import { Toaster } from '@/components/ui/toaster'
import Providers from '@/lib/react-query/provider'
const inter = Inter({ subsets: ['latin'] }) const inter = Inter({ subsets: ['latin'] })
......
...@@ -10,7 +10,7 @@ export const BackButton = () => { ...@@ -10,7 +10,7 @@ export const BackButton = () => {
return ( return (
<Button <Button
variant="ghost" variant="ghost"
size="lg" size="icon"
onClick={() => router.back()} onClick={() => router.back()}
title="Go Back" title="Go Back"
> >
......
import { BackButton } from "@/components/back-button"; import { BackButton } from "@/components/back-button";
export const BackHeader = ({ children }: { children: React.ReactNode }) => {
export const GweetHeader = () => {
return ( return (
<div className=""> <div className="flex items-center space-x-3">
<BackButton /> <BackButton />
<h2 className="">Gweet</h2> {children}
</div> </div>
); );
}; }
\ No newline at end of file
...@@ -226,7 +226,7 @@ export const CreateGweet = ({ ...@@ -226,7 +226,7 @@ export const CreateGweet = ({
type="button" type="button"
size="icon" size="icon"
variant="secondary" variant="secondary"
className="rounded-full absolute top-1 right-1 z-50" className="rounded-full absolute top-1 right-1 z-40"
onClick={() => { onClick={() => {
setChosenImages( setChosenImages(
chosenImages.filter((img, j) => j !== i), chosenImages.filter((img, j) => j !== i),
...@@ -251,7 +251,7 @@ export const CreateGweet = ({ ...@@ -251,7 +251,7 @@ export const CreateGweet = ({
</Card> </Card>
<div className="flex justify-end"> <div className="flex justify-end">
<Button type="submit" size="lg" className=" w-20" disabled={isLoading || !session.user}> <Button type="submit" size="lg" className="w-20" disabled={isLoading || !session.user}>
{isLoading ? ( {isLoading ? (
<Icons.spinner className="h-4 w-4 animate-spin" /> <Icons.spinner className="h-4 w-4 animate-spin" />
) : ( ) : (
......
...@@ -6,7 +6,7 @@ import { Icons } from "@/components/icons"; ...@@ -6,7 +6,7 @@ import { Icons } from "@/components/icons";
export const CommentButton = ({ gweet }: { gweet: IGweet }) => { export const CommentButton = ({ gweet }: { gweet: IGweet }) => {
return ( return (
<div className="relative inline-flex items-center"> <div className="relative inline-flex items-center">
<Button variant="ghost" size="icon" className="hover:bg-sky-800 z-50"> <Button variant="ghost" size="icon" className="hover:bg-sky-800 z-40">
<Icons.messagecircle className="w-6 h-6" /> <Icons.messagecircle className="w-6 h-6" />
</Button> </Button>
......
...@@ -24,7 +24,7 @@ export const RegweetButton = ({ gweet }: { gweet: IGweet }) => { ...@@ -24,7 +24,7 @@ export const RegweetButton = ({ gweet }: { gweet: IGweet }) => {
}); });
} }
}} }}
variant="ghost" size="icon" className="hover:bg-green-800 z-50" variant="ghost" size="icon" className="hover:bg-green-800 z-40"
> >
{hasRegweeted ? {hasRegweeted ?
<Icons.regweet className="w-6 h-6 text-green-600" /> <Icons.regweet className="w-6 h-6 text-green-600" />
......
import { TryAgain } from "@/components/try-again"; import { TryAgain } from "@/components/try-again";
import LoadingItem from "@/components/loading-item";
import { useGweets } from "../hooks/use-gweets"; import { useGweets } from "../hooks/use-gweets";
import { Icons } from "@/components/icons";
import { InfiniteGweets } from "./infinite-gweets"; import { InfiniteGweets } from "./infinite-gweets";
export const Comments = ({ gweetId }: { gweetId: string }) => { export const Comments = ({ gweetId }: { gweetId: string }) => {
...@@ -21,7 +20,7 @@ export const Comments = ({ gweetId }: { gweetId: string }) => { ...@@ -21,7 +20,7 @@ export const Comments = ({ gweetId }: { gweetId: string }) => {
}); });
if (isLoading) { if (isLoading) {
return <Icons.spinner className="mt-3 h-4 w-4 animate-spin align-middle" />; return <LoadingItem />;
} }
if (isError) { if (isError) {
......
"use client" "use client"
import { CreateGweetWrapper } from "@/components/create-gweet/components/create-gweet-wrapper"; import { CreateGweetWrapper } from "@/components/create-gweet/components/create-gweet-wrapper";
import { Icons } from "@/components/icons"; import LoadingItem from "@/components/loading-item";
import { TryAgain } from "@/components/try-again"; import { TryAgain } from "@/components/try-again";
import { Card } from "@/components/ui/card"; import { Card } from "@/components/ui/card";
import { Separator } from "@/components/ui/separator"; import { Separator } from "@/components/ui/separator";
...@@ -21,7 +21,7 @@ export const GweetDetails = () => { ...@@ -21,7 +21,7 @@ export const GweetDetails = () => {
const { data: gweet, isLoading, isError } = useGweet(id); const { data: gweet, isLoading, isError } = useGweet(id);
if (isLoading) { if (isLoading) {
return <Icons.spinner className="h-4 w-4 animate-spin" />; return <LoadingItem />;
} }
if (isError) { if (isError) {
...@@ -33,7 +33,7 @@ export const GweetDetails = () => { ...@@ -33,7 +33,7 @@ export const GweetDetails = () => {
} }
return ( return (
<Card className="w-full h-full mt-12 p-3 xl:p-6 "> <>
<div className="flex flex-col space-y-3 px-3 pt-3"> <div className="flex flex-col space-y-3 px-3 pt-3">
<GweetAuthor gweet={gweet} /> <GweetAuthor gweet={gweet} />
...@@ -83,6 +83,6 @@ export const GweetDetails = () => { ...@@ -83,6 +83,6 @@ export const GweetDetails = () => {
</div> </div>
<Separator className="h-1 mb-3" /> <Separator className="h-1 mb-3" />
<Comments gweetId={gweet?.id} /> <Comments gweetId={gweet?.id} />
</Card> </>
); );
}; };
\ No newline at end of file
"use client"; "use client";
import LoadingItem from "@/components/loading-item";
import { TryAgain } from "@/components/try-again"; import { TryAgain } from "@/components/try-again";
import { useGweets } from "../hooks/use-gweets";
import { Icons } from "@/components/icons";
import { Card } from "@/components/ui/card"; import { Card } from "@/components/ui/card";
import { useGweets } from "../hooks/use-gweets";
import { InfiniteGweets } from "./infinite-gweets"; import { InfiniteGweets } from "./infinite-gweets";
export const Gweets = () => { export const Gweets = () => {
...@@ -20,7 +18,7 @@ export const Gweets = () => { ...@@ -20,7 +18,7 @@ export const Gweets = () => {
} = useGweets({}); } = useGweets({});
if (isLoading) { if (isLoading) {
return <Icons.spinner className="mr-2 h-4 w-4 animate-spin" />; return <LoadingItem />;
} }
if (isError) { if (isError) {
......
"use client" "use client"
import LoadingItem from "@/components/loading-item";
import { Separator } from "@/components/ui/separator";
import { useEffect } from "react"; import { useEffect } from "react";
import { useInView } from "react-intersection-observer"; import { useInView } from "react-intersection-observer";
import { IInfiniteGweets } from "../types"; import { IInfiniteGweets } from "../types";
import { Icons } from "@/components/icons";
import { Separator } from "@/components/ui/separator";
import { Gweet } from "./gweet"; import { Gweet } from "./gweet";
export const InfiniteGweets = ({ export const InfiniteGweets = ({
...@@ -47,7 +45,7 @@ export const InfiniteGweets = ({ ...@@ -47,7 +45,7 @@ export const InfiniteGweets = ({
)); ));
})} })}
{isFetchingNextPage && <Icons.spinner className="mr-2 h-4 w-4 animate-spin" />} {isFetchingNextPage && <LoadingItem />}
</div> </div>
); );
}; };
\ No newline at end of file
export * from "./components/gweet-header";
import { Icons } from "./icons"
export default function LoadingItem() {
return (
<div className="w-full m-6 flex items-center justify-center">
<Icons.spinner className="h-6 w-6 animate-spin" />
</div>
)
}
\ No newline at end of file
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment