Skip to content

Commit

Permalink
feat: frontend repository structure + example api requests not using …
Browse files Browse the repository at this point in the history
…context
  • Loading branch information
marinovl7 committed Oct 30, 2024
1 parent 69a2ea4 commit d8f99a3
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 102 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
SERVER_ENDPOINT=https://api.hungermapdata.org/v2
API_URL=https://api.hungermapdata.org/v2
2 changes: 1 addition & 1 deletion .env_template
Original file line number Diff line number Diff line change
@@ -1 +1 @@
SERVER_ENDPOINT=https://api.hungermapdata.org/v2
API_URL=https://api.hungermapdata.org/v2
19 changes: 6 additions & 13 deletions src/app/elements/page.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
import { Suspense } from 'react';
import { Chart } from '@/components/Charts/Chart';
import container from '@/container';
import CountryRepository from '@/domain/repositories/CountryRepository';

import { ClientChart } from '@/components/Charts/ClientChart';

import Providers from './providers';
/**
* You can use this page to try and show off your components.
* It's not accessible from the UI, but you can reach it by manually navigating to /elements
*/

export default function Elements() {
return (
<Suspense fallback={<div className="w-full h-full flex justify-center items-center">Loading...</div>}>
<Providers>
<ClientChart />
</Providers>
</Suspense>
);
export default async function Elements() {
const countryData = await container.resolve<CountryRepository>('CountryRepository').getCountryData(50);
return <Chart data={countryData.fcsGraph} />;
}
15 changes: 0 additions & 15 deletions src/app/elements/providers.tsx

This file was deleted.

38 changes: 0 additions & 38 deletions src/components/Charts/ClientChart.tsx

This file was deleted.

34 changes: 0 additions & 34 deletions src/domain/contexts/CountryContext.tsx

This file was deleted.

0 comments on commit d8f99a3

Please sign in to comment.