Skip to content

Commit

Permalink
Merge pull request #3 from ScilifelabDataCentre/header_branch
Browse files Browse the repository at this point in the history
Header added + some organizing of code
  • Loading branch information
JanProgrammierung authored Dec 21, 2023
2 parents da752b0 + 1e42080 commit bf8ecee
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 2 deletions.
Binary file added react-app/public/images/scilifelogo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions react-app/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import FooterComponent from './components/FooterComponent';
import HeaderComponent from './components/HeaderComponent';

export default function App() {
let body = (
Expand All @@ -9,6 +10,7 @@ export default function App() {
)
return (
<html data-theme="light" className="min-h-screen bg-white">
{HeaderComponent()}
{body}
{FooterComponent()}
</html>
Expand Down
2 changes: 0 additions & 2 deletions react-app/src/components/FooterComponent.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react';

export default function FooterComponent() {
return (
<footer className="footer p-10 bg-base-300 text-base-content fixed bottom-0">
Expand Down
39 changes: 39 additions & 0 deletions react-app/src/components/HeaderComponent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import {ILink} from '../interfaces/types';

export default function HeaderComponent() {
var links: { [id: string] : ILink; } = {
'l1': { text: 'Random text for now', classes: 'pointer-events-none', href: '/#' },
'l2': { text: 'Data', classes: 'link link-hover', href: '/#' },
'l3': { text: 'Events & News', classes: 'link link-hover', href: '/#' },
'l4': { text: 'Contact', classes: 'link link-hover', href: '/#' },
'l5': { text: 'About', classes: 'link link-hover', href: '/#' },
};

var buttons: { [id: string] : ILink; } = {
'b1': { text: 'Sign In', classes: 'btn bg-fuchsia-950 text-white', href: '/#' },
};

return (
// use bg-zinc-200 instead? similar to daisyUI light-theme footer
<div className="navbar h-[8rem] bg-black text-white">
<div className="navbar-start">
<a href="/">
<img className="w-[340px] h-[82px] border border-black" src="/images/scilifelogo.jpg" alt="SciLifeLab Logo" />
</a>
</div>
<div className="navbar-center hidden lg:flex">
<ul className="menu menu-horizontal px-1">
{Object.keys(links).map( key => (
<li>{<a className={links[key].classes} href={links[key].href}>{links[key].text}</a>}</li>
))}
</ul>
</div>
{Object.keys(buttons).map( key => (
<div className="navbar-end">
{<a className={buttons[key].classes} href={buttons[key].href}>{buttons[key].text}</a>}
</div>
))}
</div>
)
}

5 changes: 5 additions & 0 deletions react-app/src/interfaces/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export interface ILink {
text: string;
classes: string;
href: string;
};

0 comments on commit bf8ecee

Please sign in to comment.