Routing for all

This commit is contained in:
Max Lynch
2020-12-30 17:08:19 -06:00
parent e115a5a7ce
commit 3939786d02
9 changed files with 82 additions and 76 deletions
+22
View File
@@ -0,0 +1,22 @@
import AppShell from '../../components/AppShell';
import ListDetailPage from '../../components/pages/ListDetail';
import { lists } from '../../mock';
export default function ListDetail({ list }) {
return <AppShell page={ListDetailPage} pageProps={{ list }} />;
}
export const getServerSideProps = context => {
const {
params: { listId },
} = context;
const list = lists.find(l => l.id === listId);
console.log('Loaded list', list);
return {
props: {
list,
},
};
};