commit
This commit is contained in:
parent
89f563278f
commit
015ac84e20
|
|
@ -37,7 +37,7 @@ export class Queries {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async getlastNews(): Promise<NewsModel> {
|
public static async getlastNews(): Promise<NewsModel> {
|
||||||
return await fetch(`${baseUrl.NEWS_SRC}${routes.news}?locale=tm&count=5`, {
|
return await fetch(`https://turkmentv.gov.tm/v2/api/slider?type=small3`, {
|
||||||
next: { revalidate: 3600 },
|
next: { revalidate: 3600 },
|
||||||
}).then((res) => res.json().then((res) => res as NewsModel));
|
}).then((res) => res.json().then((res) => res as NewsModel));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
'use client';
|
'use client';
|
||||||
// src/app/layout.tsx
|
// src/app/layout.tsx
|
||||||
import { AuthProvider } from '@/context/AuthContext';
|
import { AuthProvider } from '@/context/AuthContext';
|
||||||
import { SmsContext, SmsProvider } from '@/context/SmsContext';
|
import { PropsWithChildren } from 'react';
|
||||||
import { PropsWithChildren, useState } from 'react';
|
|
||||||
|
|
||||||
export default function SmsLayout({ children }: PropsWithChildren) {
|
export default function SmsLayout({ children }: PropsWithChildren) {
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ const SmallSwiperNews = () => {
|
||||||
<Link href={item ? `news/${item.id}` : ''} className="relative ">
|
<Link href={item ? `news/${item.id}` : ''} className="relative ">
|
||||||
<div className="relative w-full h-full">
|
<div className="relative w-full h-full">
|
||||||
<Image
|
<Image
|
||||||
src={item.featured_images[0].path}
|
src={item.image}
|
||||||
alt="small_banner"
|
alt="small_banner"
|
||||||
fill
|
fill
|
||||||
unoptimized
|
unoptimized
|
||||||
|
|
|
||||||
|
|
@ -1,73 +1,90 @@
|
||||||
|
// export interface NewsModel {
|
||||||
|
// data: Datum[];
|
||||||
|
// links: Links;
|
||||||
|
// meta: Meta;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// export interface Datum {
|
||||||
|
// id: number;
|
||||||
|
// title: string;
|
||||||
|
// slug: string;
|
||||||
|
// excerpt: string;
|
||||||
|
// published_at: string;
|
||||||
|
// type: Type;
|
||||||
|
// awtor: Awtor;
|
||||||
|
// featured_images: FeaturedImage[];
|
||||||
|
// video: string;
|
||||||
|
// categories: Category[];
|
||||||
|
// }
|
||||||
|
|
||||||
|
// export enum Awtor {
|
||||||
|
// Hhm = "HHM",
|
||||||
|
// Миц = "МИЦ",
|
||||||
|
// Ннм = "ННМ",
|
||||||
|
// }
|
||||||
|
|
||||||
|
// export interface Category {
|
||||||
|
// id: number;
|
||||||
|
// name: string;
|
||||||
|
// powerseo_title: Powerseo | null;
|
||||||
|
// powerseo_description: Powerseo | null;
|
||||||
|
// powerseo_keywords: Powerseo | null;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// export enum Powerseo {
|
||||||
|
// Novosti = "Novosti",
|
||||||
|
// VTurkmenistane = "V Turkmenistane",
|
||||||
|
// }
|
||||||
|
|
||||||
|
// export interface FeaturedImage {
|
||||||
|
// id: number;
|
||||||
|
// disk_name: string;
|
||||||
|
// file_name: string;
|
||||||
|
// path: string;
|
||||||
|
// extension: Extension;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// export enum Extension {
|
||||||
|
// JPEG = "jpeg",
|
||||||
|
// Jpg = "jpg",
|
||||||
|
// PNG = "png",
|
||||||
|
// }
|
||||||
|
|
||||||
|
// export enum Type {
|
||||||
|
// Photo = "photo",
|
||||||
|
// Video = "video",
|
||||||
|
// }
|
||||||
|
|
||||||
|
// export interface Links {
|
||||||
|
// first: string;
|
||||||
|
// last: string;
|
||||||
|
// prev: null;
|
||||||
|
// next: string;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// export interface Meta {
|
||||||
|
// current_page: number;
|
||||||
|
// from: number;
|
||||||
|
// last_page: number;
|
||||||
|
// path: string;
|
||||||
|
// per_page: number;
|
||||||
|
// to: number;
|
||||||
|
// total: number;
|
||||||
|
// }
|
||||||
|
|
||||||
export interface NewsModel {
|
export interface NewsModel {
|
||||||
data: Datum[];
|
data: Datum[];
|
||||||
links: Links;
|
|
||||||
meta: Meta;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Datum {
|
export interface Datum {
|
||||||
id: number;
|
id: number;
|
||||||
title: string;
|
title: string;
|
||||||
slug: string;
|
url: null | string;
|
||||||
excerpt: string;
|
image: string;
|
||||||
published_at: string;
|
type: string;
|
||||||
type: Type;
|
status: number;
|
||||||
awtor: Awtor;
|
description: null;
|
||||||
featured_images: FeaturedImage[];
|
page_id: null;
|
||||||
video: string;
|
created_at: Date;
|
||||||
categories: Category[];
|
updated_at: Date;
|
||||||
}
|
|
||||||
|
|
||||||
export enum Awtor {
|
|
||||||
Hhm = "HHM",
|
|
||||||
Миц = "МИЦ",
|
|
||||||
Ннм = "ННМ",
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Category {
|
|
||||||
id: number;
|
|
||||||
name: string;
|
|
||||||
powerseo_title: Powerseo | null;
|
|
||||||
powerseo_description: Powerseo | null;
|
|
||||||
powerseo_keywords: Powerseo | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum Powerseo {
|
|
||||||
Novosti = "Novosti",
|
|
||||||
VTurkmenistane = "V Turkmenistane",
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface FeaturedImage {
|
|
||||||
id: number;
|
|
||||||
disk_name: string;
|
|
||||||
file_name: string;
|
|
||||||
path: string;
|
|
||||||
extension: Extension;
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum Extension {
|
|
||||||
JPEG = "jpeg",
|
|
||||||
Jpg = "jpg",
|
|
||||||
PNG = "png",
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum Type {
|
|
||||||
Photo = "photo",
|
|
||||||
Video = "video",
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Links {
|
|
||||||
first: string;
|
|
||||||
last: string;
|
|
||||||
prev: null;
|
|
||||||
next: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Meta {
|
|
||||||
current_page: number;
|
|
||||||
from: number;
|
|
||||||
last_page: number;
|
|
||||||
path: string;
|
|
||||||
per_page: number;
|
|
||||||
to: number;
|
|
||||||
total: number;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue