Skip to content

Commit

Permalink
fix(frontend): some styles were fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
mmtftr committed May 15, 2024
1 parent 68feccc commit 2f71575
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
20 changes: 14 additions & 6 deletions frontend/src/routes/feed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,27 @@ import { Recipe } from "../components/Recipe";
import { FullscreenLoading } from "../components/FullscreenLoading";
import { Alert, AlertDescription, AlertTitle } from "../components/ui/alert";
import { AlertCircle } from "lucide-react";
import { useGetRecipesForEntity } from "../services/api/semanticBrowseComponents";
import { useGetFeed } from "../services/api/semanticBrowseComponents";
import { renderError } from "../services/api/semanticBrowseFetcher";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import SearchFilterPopover from "@/components/SearchFilterPopover";
import { useSearchParams } from "react-router-dom";
import { useState } from "react";

export const Feed = () => {
const { data, isLoading, error } = useGetRecipesForEntity({
const [params, setParams] = useSearchParams();
const {
data: feedData,
isLoading,
error,
} = useGetFeed({
queryParams: {
sort: "topRated",
type: ["explore", "following"].includes(params.get("type") ?? "")
? (params.get("type") as "explore" | "following")
: "explore",
},
});
const [params] = useSearchParams();
const [foodType, setFoodType] = useState(params.get("foodType") || "");
const feedData = { data };

if (isLoading) {
return <FullscreenLoading overlay />;
Expand Down Expand Up @@ -45,7 +50,10 @@ export const Feed = () => {
</h1>
<SearchFilterPopover foodType={foodType} setFoodType={setFoodType} />
</div>
<Tabs defaultValue="explore">
<Tabs
defaultValue="explore"
onValueChange={(val) => setParams((prev) => ({ ...prev, type: val }))}
>
<TabsList>
<TabsTrigger value="following">Following</TabsTrigger>
<TabsTrigger value="explore">Explore</TabsTrigger>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/routes/profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default function Profile() {

const profile = data!.data;
return (
<div key="1" className="container bg-white py-20">
<div key="1" className="container bg-white py-16">
<div className="flex flex-col gap-4 px-4 py-2">
<div className="mb-4 flex items-center justify-between">
<h1 className="">My profile</h1>
Expand Down

0 comments on commit 2f71575

Please sign in to comment.