Skip to content

Commit 3e0735e

Browse files
committed
added report link to footer
resolves #1885
1 parent f8dcb1b commit 3e0735e

File tree

4 files changed

+53
-15
lines changed

4 files changed

+53
-15
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!--- Provide a general summary of the issue in the Title above -->
2+
3+
## Expected Behavior
4+
5+
<!--- Tell us what should happen -->
6+
7+
## Current Behavior
8+
9+
<!--- Tell us what happens instead of the expected behavior -->
Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { makeStyles } from "@material-ui/core/styles"
12
import { FC } from "react"
23
import { Footer } from "../Footer/Footer"
34
import { Navbar } from "../Navbar/Navbar"
@@ -10,12 +11,27 @@ interface AuthAndFrameProps {
1011
/**
1112
* Wraps page in RequireAuth and renders it between Navbar and Footer
1213
*/
13-
export const AuthAndFrame: FC<AuthAndFrameProps> = ({ children }) => (
14-
<RequireAuth>
15-
<>
16-
<Navbar />
17-
{children}
18-
<Footer />
19-
</>
20-
</RequireAuth>
21-
)
14+
export const AuthAndFrame: FC<AuthAndFrameProps> = ({ children }) => {
15+
const styles = useStyles()
16+
17+
return (
18+
<RequireAuth>
19+
<div className={styles.site}>
20+
<Navbar />
21+
<div className={styles.siteContent}>{children}</div>
22+
<Footer />
23+
</div>
24+
</RequireAuth>
25+
)
26+
}
27+
28+
const useStyles = makeStyles(() => ({
29+
site: {
30+
display: "flex",
31+
minHeight: "100vh",
32+
flexDirection: "column",
33+
},
34+
siteContent: {
35+
flex: 1,
36+
},
37+
}))
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { Story } from "@storybook/react"
2+
import { Footer } from "./Footer"
3+
4+
export default {
5+
title: "components/Footer",
6+
component: Footer,
7+
}
8+
9+
const Template: Story = () => <Footer />
10+
11+
export const Example = Template.bind({})
12+
Example.args = {}

site/src/components/Footer/Footer.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import Link from "@material-ui/core/Link"
22
import { makeStyles } from "@material-ui/core/styles"
3-
import Typography from "@material-ui/core/Typography"
43
import { useActor } from "@xstate/react"
54
import React, { useContext } from "react"
65
import * as TypesGen from "../../api/typesGenerated"
@@ -10,21 +9,23 @@ export const Language = {
109
buildInfoText: (buildInfo: TypesGen.BuildInfoResponse): string => {
1110
return `Coder ${buildInfo.version}`
1211
},
12+
copyrightText: `Copyright \u00a9 ${new Date().getFullYear()} Coder Technologies, Inc. All rights reserved.`,
13+
reportBugLink: "Report an issue ->",
1314
}
1415

1516
export const Footer: React.FC = ({ children }) => {
1617
const styles = useFooterStyles()
1718
const xServices = useContext(XServiceContext)
1819
const [buildInfoState] = useActor(xServices.buildInfoXService)
20+
const githubUrl = `https://github.com/coder/coder/issues/new?labels=bug,needs+grooming&title=Bug+in+${buildInfoState.context.buildInfo?.version}:&template=external_bug_report.md`
1921

2022
return (
2123
<div className={styles.root}>
2224
{children}
23-
<div className={styles.copyRight}>
24-
<Typography color="textSecondary" variant="caption">
25-
{`Copyright \u00a9 ${new Date().getFullYear()} Coder Technologies, Inc. All rights reserved.`}
26-
</Typography>
27-
</div>
25+
<Link className={styles.link} variant="caption" target="_blank" href={githubUrl}>
26+
&#129714;&nbsp;{Language.reportBugLink}
27+
</Link>
28+
<div className={styles.copyRight}>{Language.copyrightText}</div>
2829
{buildInfoState.context.buildInfo && (
2930
<div className={styles.buildInfo}>
3031
<Link

0 commit comments

Comments
 (0)