[examples/][xs]: Renamed catalog to ckan

This commit is contained in:
virgoaugustine
2022-01-12 11:22:16 +00:00
parent 05d6935407
commit 04d750f5d5
73 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
import { GetServerSideProps } from 'next';
import Head from 'next/head';
import { initializeApollo } from '../../../lib/apolloClient';
import Nav from '../../../components/home/Nav';
import Post from '../../../components/static/Post';
import { GET_POST_QUERY } from '../../../graphql/queries';
type Props = {
variables: any;
};
const PostItem: React.FC<Props> = ({ variables }) => (
<>
<Head>
<title>Portal | {variables.slug}</title>
<link rel="icon" href="/favicon.ico" />
</Head>
<Nav />
<main className="p-6">
<Post variables={variables} />
</main>
</>
);
export const getServerSideProps: GetServerSideProps = async (context) => {
const variables = {
slug: context.query.post,
};
const apolloClient = initializeApollo();
await apolloClient.query({
query: GET_POST_QUERY,
variables,
});
return {
props: {
initialApolloState: apolloClient.cache.extract(),
variables,
},
};
};
export default PostItem;

View File

@@ -0,0 +1,35 @@
import { GetServerSideProps } from 'next';
import Head from 'next/head';
import { initializeApollo } from '../../lib/apolloClient';
import Nav from '../../components/home/Nav';
import List from '../../components/static/List';
import { GET_POSTS_QUERY } from '../../graphql/queries';
const PostList: React.FC = () => (
<>
<Head>
<title>Portal | Blog</title>
<link rel="icon" href="/favicon.ico" />
</Head>
<Nav />
<main className="p-6">
<List />
</main>
</>
);
export const getServerSideProps: GetServerSideProps = async () => {
const apolloClient = initializeApollo();
await apolloClient.query({
query: GET_POSTS_QUERY,
});
return {
props: {
initialApolloState: apolloClient.cache.extract(),
},
};
};
export default PostList;