From 95ff16d48be89ad87e6b7d58d4dac49181866b6d Mon Sep 17 00:00:00 2001 From: Alibek Date: Wed, 14 Feb 2024 14:21:20 +0600 Subject: [PATCH] added trycatch in news page, removed font Tilda-Sans --- src/App/globals.scss | 5 ++++- src/App/layout.tsx | 2 +- src/App/news/page.tsx | 14 +++++++++++--- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/App/globals.scss b/src/App/globals.scss index 1ebd0de..cae662b 100644 --- a/src/App/globals.scss +++ b/src/App/globals.scss @@ -4,7 +4,10 @@ box-sizing: border-box; padding: 0; margin: 0; - font-family: "Tilda Sans"; + font-family: system-ui, -apple-system, BlinkMacSystemFont, + "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", + "Helvetica Neue", sans-serif; + // font-family: "Tilda Sans"; } button, diff --git a/src/App/layout.tsx b/src/App/layout.tsx index a77af85..42310dd 100644 --- a/src/App/layout.tsx +++ b/src/App/layout.tsx @@ -1,7 +1,7 @@ import type { Metadata } from "next"; import "./globals.scss"; import "./App.scss"; -import "@/shared/fonts/fonts.scss"; +// import "@/shared/fonts/fonts.scss"; import { Providers } from "./Providers"; import Navbar from "@/widgets/Navbar/Navbar"; import Footer from "@/widgets/Footer/Footer"; diff --git a/src/App/news/page.tsx b/src/App/news/page.tsx index 24087b4..3a0290f 100644 --- a/src/App/news/page.tsx +++ b/src/App/news/page.tsx @@ -1,14 +1,22 @@ -import Typography from "@/shared/ui/components/Typography/Typography"; import "./News.scss"; +import Typography from "@/shared/ui/components/Typography/Typography"; import { apiInstance } from "@/shared/config/apiConfig"; import { INewsList } from "@/shared/types/news-type"; import NewsCard from "@/entities/NewsCard/NewsCard"; const News = async () => { const getNews = async () => { - const response = await apiInstance.get("/news/"); + try { + const response = await apiInstance.get("/news/"); - return response.data; + return response.data; + } catch (error) { + console.log(error); + + return { + results: [], + }; + } }; const data = await getNews();