-
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.
Merge pull request #44 from weaponsforge/dev
v1.0.6
- Loading branch information
Showing
10 changed files
with
303 additions
and
217 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import Link from 'next/link' | ||
import PropTypes from 'prop-types' | ||
|
||
// Layout | ||
import AppContainer from '@/components/layout/appcontainer' | ||
import AppCard from '@/layout/appcard' | ||
import SimpleContainer from '@/layout/simplecontainer' | ||
|
||
function AppFrame ({ | ||
children, | ||
navigation = [], | ||
maxWidth = 'sm' | ||
}) { | ||
return ( | ||
<AppContainer maxWidth={maxWidth}> | ||
<AppCard> | ||
{ children } | ||
</AppCard> | ||
|
||
{navigation.length > 0 && | ||
<SimpleContainer> | ||
{navigation.map((item, index) => { | ||
const link = (index < navigation.length - 1) | ||
? <span key={index}> | ||
<Link href={item.href}>{item.name}</Link> | | ||
</span> | ||
: <Link key={index} href={item.href}>{item.name}</Link> | ||
|
||
return link | ||
})} | ||
</SimpleContainer> | ||
} | ||
</AppContainer> | ||
) | ||
} | ||
|
||
AppFrame.propTypes = { | ||
/** React/DOM elements */ | ||
children: PropTypes.node, | ||
/** Array of navigation links i.e, [{ href: '/', name: 'Home' },... ] */ | ||
navigation: PropTypes.array, | ||
/** MUI maxWidth xs, sm, md, lg, xl */ | ||
maxWidth: PropTypes.string | ||
} | ||
|
||
export default AppFrame |
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
Oops, something went wrong.