generated from profydev/prolog-app
-
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.
* Implement the footer * Test footer rendering * Adjust navigation tests to pass with the added footer
- Loading branch information
1 parent
e8bde88
commit 82b126b
Showing
9 changed files
with
186 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
describe("Footer", () => { | ||
beforeEach(() => { | ||
cy.visit("http://localhost:3000/dashboard"); | ||
}); | ||
|
||
it("renders the footer", () => { | ||
cy.get("footer").should("be.visible"); | ||
cy.get("footer").find("a").should("have.length", 4); | ||
cy.get("footer") | ||
.find("img") | ||
.should("have.attr", "src", "/icons/logo-small.svg"); | ||
}); | ||
}); |
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,16 @@ | ||
@use "@styles/color"; | ||
@use "@styles/font"; | ||
@use "@styles/space"; | ||
@use "@styles/breakpoint"; | ||
@use "@styles/misc"; | ||
|
||
.listItem { | ||
list-style-type: none; | ||
display: inline; | ||
margin: 0 space.$s3; | ||
} | ||
|
||
.anchor { | ||
text-decoration: none; | ||
color: inherit; | ||
} |
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,18 @@ | ||
import Link from "next/link"; | ||
import React from "react"; | ||
import styles from "./footer-link.module.scss"; | ||
|
||
type FooterLinkProps = { | ||
text: string; | ||
href: string; | ||
}; | ||
|
||
export function FooterLink({ text, href }: FooterLinkProps) { | ||
return ( | ||
<li className={styles.listItem}> | ||
<Link className={styles.anchor} href={href}> | ||
{text} | ||
</Link> | ||
</li> | ||
); | ||
} |
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,68 @@ | ||
@use "@styles/color"; | ||
@use "@styles/font"; | ||
@use "@styles/space"; | ||
@use "@styles/breakpoint"; | ||
@use "@styles/misc"; | ||
|
||
.container { | ||
display: flex; | ||
flex-direction: column; | ||
text-align: center; | ||
background: color.$gray-50; | ||
padding: 0 space.$s6; | ||
|
||
@media (min-width: breakpoint.$desktop) { | ||
flex-direction: row; | ||
} | ||
} | ||
|
||
.content { | ||
align-items: center; | ||
display: flex; | ||
flex-direction: column; | ||
|
||
@media (min-width: breakpoint.$desktop) { | ||
width: 100%; | ||
flex-direction: row; | ||
justify-content: space-between; | ||
} | ||
} | ||
|
||
.linkList { | ||
order: 1; | ||
margin: space.$s6; | ||
padding: 0; | ||
|
||
@media (min-width: breakpoint.$desktop) { | ||
order: 2; | ||
} | ||
} | ||
|
||
.version { | ||
color: color.$gray-400; | ||
margin: space.$s6 0; | ||
order: 3; | ||
|
||
@media (min-width: breakpoint.$desktop) { | ||
order: 1; | ||
} | ||
} | ||
|
||
.links { | ||
color: color.$gray-500; | ||
order: 1; | ||
|
||
@media (min-width: breakpoint.$desktop) { | ||
order: 2; | ||
} | ||
} | ||
|
||
.logo { | ||
padding: 0; | ||
margin: 0; | ||
order: 2; | ||
|
||
@media (min-width: breakpoint.$desktop) { | ||
order: 3; | ||
} | ||
} |
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,45 @@ | ||
import { version } from "../../../package.json"; | ||
import { FooterLink } from "./footer-link"; | ||
import styles from "./footer.module.scss"; | ||
|
||
const footerLinks = [ | ||
{ | ||
text: "Docs", | ||
href: "#", | ||
}, | ||
{ | ||
text: "API", | ||
href: "#", | ||
}, | ||
{ | ||
text: "Help", | ||
href: "#", | ||
}, | ||
{ | ||
text: "Community", | ||
href: "#", | ||
}, | ||
]; | ||
|
||
export const Footer = () => ( | ||
<footer> | ||
<div className={styles.container}> | ||
<div className={styles.content}> | ||
<p className={styles.version}>Version: {version}</p> | ||
<div className={styles.links}> | ||
<ul className={styles.linkList}> | ||
{footerLinks.map((footerLink, index) => ( | ||
<FooterLink key={index} {...footerLink} /> | ||
))} | ||
</ul> | ||
</div> | ||
{/* eslint-disable-next-line @next/next/no-img-element */} | ||
<img | ||
className={styles.logo} | ||
src="/icons/logo-small.svg" | ||
alt="Prolog Logo" | ||
/> | ||
</div> | ||
</div> | ||
</footer> | ||
); |
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 @@ | ||
export { Footer } from "./footer"; |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from "./page-container"; | ||
export * from "./sidebar-navigation"; | ||
export * from "./footer"; |
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