Skip to content

Commit

Permalink
Adding Footer (#118)
Browse files Browse the repository at this point in the history
* Addin Web UI version

* add beta logo and footer styles

* add GH link

* Adding link on version

---------

Co-authored-by: Agustín Longoni <agustin.longoni@altoros.com>
  • Loading branch information
henrypalacios and alongoni authored Jan 5, 2024
1 parent abacad8 commit 7f783e7
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 2 deletions.
4 changes: 4 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/** @type {import('next').NextConfig} */

const { config } = require("./src/services/squid/squidConfig");
const { version } = require("./package.json");

const nextConfig = {
reactStrictMode: true,
Expand All @@ -12,6 +13,9 @@ const nextConfig = {
transform: "@mui/icons-material/{{member}}",
},
},
publicRuntimeConfig: {
version,
},
async rewrites() {
return [
{
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "multisig-ui",
"version": "0.1.0",
"version": "0.1.0-beta",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down
17 changes: 17 additions & 0 deletions public/xSigners-logo-beta.svg
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 src/components/layout/AppLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { TopBar } from "@/components/layout/TopBar";
import { useSettingsTheme } from "@/context/SettingsThemeConsumer";
import { scalePixels } from "@/themes/spacing";

import { Footer } from "./Footer";
import { VerticalMenuBar } from "./VerticalMenuBar";

const ContentWrapper = styled(Box)<BoxProps & { drawerwidth: number }>(
Expand Down Expand Up @@ -45,6 +46,7 @@ export const AppLayout: React.FC<PropsWithChildren> = ({ children }) => {
<ContentWrapper drawerwidth={marginLeft} component="main">
{children}
</ContentWrapper>
<Footer />
</MainContentWrapper>
</VerticalLayoutWrapper>
);
Expand Down
46 changes: 46 additions & 0 deletions src/components/layout/Footer/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { Link, Stack, Tooltip, Typography } from "@mui/material";
import getConfig from "next/config";
import React from "react";

import { FooterContainer } from "./styled";

const { publicRuntimeConfig } = getConfig();
const version = publicRuntimeConfig?.version;

function isBetaVersion(_version: string): boolean {
const betaRegex = /-beta|-alpha|-rc/;

return betaRegex.test(_version);
}

export const Footer: React.FC = () => {
const isBeta = isBetaVersion(version);

return (
<FooterContainer>
{isBeta && (
<Tooltip
title="This project is in beta. Use at your own risk."
placement="top"
>
<Typography variant="caption">Beta version</Typography>
</Tooltip>
)}
{version && (
<Typography variant="caption">
<Stack display={"flex"} direction={"row"}>
UI: &nbsp;
<Link
underline="hover"
target="_blank"
rel="noopener noreferrer"
href="https://github.com/protofire/ink-multisig-ui"
>
v{version}
</Link>
</Stack>
</Typography>
)}
</FooterContainer>
);
};
15 changes: 15 additions & 0 deletions src/components/layout/Footer/styled.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { styled } from "@mui/material/styles";

export const FooterContainer = styled("footer")(({ theme }) => ({
display: "flex",
alignItems: "flex-end",
boxSizing: "border-box",
fontSize: "1.2rem",
padding: "1rem 0 1rem 15.5rem",
flex: "1 1 auto",
color: theme.palette.text.secondary,
width: "100%",
justifyContent: "center",
margin: "0",
gap: "1rem",
}));
2 changes: 1 addition & 1 deletion src/components/layout/TopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function TopBar({
<Stack direction="row" gap={1} sx={{ flexGrow: 1 }}>
<Link href={ROUTES.Home} passHref>
<Image
src="/xSigners-logo.svg"
src="/xSigners-logo-beta.svg"
alt="xSigners Wallet"
priority
width={160}
Expand Down

0 comments on commit 7f783e7

Please sign in to comment.