feat(layout): add Software Name + Version + License in Layout footer@@ -10,6 +10,7 @@ import InstantRouterIndicator from "../islands/InstantRouterIndicator";
interface LayoutProps extends CommonViewProps {
foo?: boolean;
+ appVersion: string;
}
const BRANDLINE_HEIGHT = 4;
@@ -20,7 +21,7 @@ function removeCommentsAndSpacing(str = "") {
}
export const Layout: FC<LayoutProps & WithThemeSchemeProp> = (commonProps) => {
- const { children, themeScheme } = commonProps;
+ const { appVersion, children, themeScheme } = commonProps;
const sharedProps = {
themeScheme,
@@ -80,6 +81,13 @@ export const Layout: FC<LayoutProps & WithThemeSchemeProp> = (commonProps) => {
{children}
</StyledChildrenWrapper>
</StyledPageWrapper>
+ <StyledFooterWrapper>
+ <p>
+ <a href={"https://gitfoss.io/ethicdevs/gitfoss"}>
+ GitFOSS - v{appVersion} - MIT License
+ </a>
+ </p>
+ </StyledFooterWrapper>
</StyledLayoutWrapper>
</>
);
@@ -164,3 +172,20 @@ const StyledChildrenWrapper = styled.div`
flex: 1;
width: 100%;
`;
+
+const StyledFooterWrapper = styled.div`
+ display: flex;
+ flex-flow: row wrap;
+ justify-content: center;
+ align-items: center;
+
+ width: 100%;
+ min-height: 44px;
+ height: 44px;
+
+ & > p {
+ margin: 0 0 24px 0;
+ opacity: 0.67;
+ font-size: 12px;
+ }
+`;
@@ -25,6 +25,7 @@ export interface AppSessionData extends Prisma.JsonObject {
}
export interface CommonViewProps {
+ appVersion: string;
authenticated: boolean;
currentUserAvatarUri: string | null;
currentUserId: string | null;
@@ -1,6 +1,8 @@
// 3rd-party
import type { ViewContext } from "@ethicdevs/fastify-stream-react-views";
import type { FastifyReply, FastifyRequest } from "fastify";
+// app root
+import pkgJson from "../../../package.json";
// app
import type { CommonViewProps } from "../../types";
import { Const } from "../../const";
@@ -37,6 +39,7 @@ export const makeRequestHandler = {
const viewProps: T & { commonProps: CommonViewProps } = {
...props,
commonProps: {
+ appVersion: pkgJson.version,
authenticated,
currentUserAvatarUri: curr_user_avatar_uri,
currentUserId: curr_user_uid,