forked from kernel-community/services
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adventures: introduce Page component with proper navbar (kernel-commu…
…nity#24) * Adventures: introduce Page component with proper navbar * PR fixes
- Loading branch information
1 parent
935bb00
commit d0fc188
Showing
11 changed files
with
117 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** | ||
* Copyright (c) Kernel | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
*/ | ||
|
||
import { Link } from 'react-router-dom' | ||
|
||
import { Footer, Navbar } from '@kernel/common' | ||
|
||
import AppConfig from 'App.config' | ||
|
||
const editMenuItem = ({ projectHandle }) => { | ||
return ( | ||
<Link | ||
key='edit' | ||
className='text-kernel-white px-3 py-4 lg:px-6 lg:py-2 flex items-center text-sm lowercase font-bold' | ||
to={`/edit/${projectHandle}`} | ||
> | ||
Edit | ||
</Link> | ||
) | ||
} | ||
|
||
const Page = ({ projectHandle, children }) => { | ||
const additionalMenuItems = projectHandle ? [editMenuItem({ projectHandle })] : [] | ||
|
||
return ( | ||
<div className='flex flex-col h-screen justify-between'> | ||
<Navbar | ||
title={AppConfig.appTitle} | ||
logoUrl={AppConfig.logoUrl} | ||
homeUrl={AppConfig.homeUrl} | ||
menuLinks={AppConfig.navbar?.links} | ||
additionalMenuItems={additionalMenuItems} | ||
backgroundColor='bg-kernel-dark' textColor='text-kernel-white' | ||
/> | ||
<div className='mb-auto mt-24 mx-24'> | ||
{children} | ||
</div> | ||
<Footer backgroundColor='bg-kernel-dark' textColor='text-kernel-white'> | ||
built at <a href='https://kernel.community/' className='text-kernel-green-light'>KERNEL</a> | ||
</Footer> | ||
</div> | ||
) | ||
} | ||
|
||
export default Page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters