Routing for all
This commit is contained in:
@@ -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,
|
||||
},
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user