mirror of
https://gitlab.com/MrFry/qmining-page
synced 2025-04-01 20:23:44 +02:00
Added tabs.json
This commit is contained in:
parent
b7dcc360bc
commit
8a1149d223
5 changed files with 39 additions and 40 deletions
|
@ -1,5 +1,7 @@
|
|||
import Link from 'next/link'
|
||||
|
||||
import tabs from '../data/tabs.json'
|
||||
|
||||
// TODO: activelink prop to set link to active
|
||||
export default function Layout (props) {
|
||||
const { currPageName } = props
|
||||
|
@ -17,26 +19,16 @@ export default function Layout (props) {
|
|||
Frylabs
|
||||
</div>
|
||||
</div>
|
||||
<Link href='/' >
|
||||
<a
|
||||
className={currPageName === 'index' ? 'active' : ''}
|
||||
>home</a>
|
||||
</Link>
|
||||
<Link href='/manual' >
|
||||
<a
|
||||
className={currPageName === 'manual' ? 'active' : ''}
|
||||
>manual</a>
|
||||
</Link>
|
||||
<Link href='/allQuestions' >
|
||||
<a
|
||||
className={currPageName === 'allQuestions' ? 'active' : ''}
|
||||
>AllQuestions</a>
|
||||
</Link>
|
||||
<Link href='/userQuestions' >
|
||||
<a
|
||||
className={currPageName === 'userQuestions' ? 'active' : ''}
|
||||
>userQuestions</a>
|
||||
</Link>
|
||||
{Object.keys(tabs).map((key) => {
|
||||
const item = tabs[key]
|
||||
return (
|
||||
<Link href={item.href} key={key} >
|
||||
<a
|
||||
className={currPageName === key ? 'active' : ''}
|
||||
>{item.text}</a>
|
||||
</Link>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
<div className='content'>
|
||||
{props.children}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue