change host

master
gman 3 years ago
parent d5f8e46d00
commit aa6bb5a51a

@ -2,7 +2,7 @@ import { Box } from '@mantine/core';
import { import {
createBrowserRouter, createBrowserRouter,
RouterProvider, RouterProvider,
useLoaderData, // useLoaderData,
} from 'react-router-dom'; } from 'react-router-dom';
import { KartaPage } from './KartaPage'; import { KartaPage } from './KartaPage';
@ -14,12 +14,6 @@ import headerLinks from './assets/header.json';
import footerLinks from './assets/footer.json'; import footerLinks from './assets/footer.json';
const articleLoader = async function({ params }) {
const response = await fetch("http://strapi.wg.gateway.ts/api/articles?filters[id][$eq]=3")
const article = await response.json()
return article;
}
const router = createBrowserRouter([ const router = createBrowserRouter([
{ {
path: "/", path: "/",
@ -33,7 +27,7 @@ const router = createBrowserRouter([
path: "/article/:id", path: "/article/:id",
element: <Article />, element: <Article />,
loader: async ({ params }) => { loader: async ({ params }) => {
return fetch(`http://strapi.wg.gateway.ts/api/articles?populate=*&filters[id][$eq]=${params.id}`); return fetch(`https://strapi.iamonlyherefortheicecream.gq/api/articles?populate=*&filters[id][$eq]=${params.id}`);
}, },
} }
]) ])

@ -38,7 +38,7 @@ export function Article() {
if (articleData.data[0].attributes.carousel.data) { if (articleData.data[0].attributes.carousel.data) {
return ( return (
<Carousel slideSize="70%" height={500} slideGap="md" loop> <Carousel slideSize="70%" height={500} slideGap="md" loop>
{articleData.data[0].attributes.carousel.data.map(image => <Carousel.Slide><Image fit='fill' height={500} mx="auto" radius="md" src={`http://strapi.wg.gateway.ts${image.attributes.url}`} alt="Random image" /></Carousel.Slide>)} {articleData.data[0].attributes.carousel.data.map(image => <Carousel.Slide><Image fit='fill' height={500} mx="auto" radius="md" src={`https://strapi.iamonlyherefortheicecream.gq${image.attributes.url}`} alt="Random image" /></Carousel.Slide>)}
</Carousel> </Carousel>
) )
} }

Loading…
Cancel
Save