Skip to content

Commit

Permalink
feat(authfooter): dynamically display app version
Browse files Browse the repository at this point in the history
  • Loading branch information
hazzuk committed Jan 24, 2025
1 parent a34faef commit 1232a25
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/components/views/auth/AuthFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,26 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Com
Please see LICENSE files in the repository root for full details.
*/

import React, { ReactElement } from "react";
import React, { ReactElement, useContext, useEffect, useState } from "react";

import SdkConfig from "../../../SdkConfig";
import { _t } from "../../../languageHandler";
import MatrixClientContext from "../../../contexts/MatrixClientContext";

const AuthFooter = (): ReactElement => {
const context = useContext(MatrixClientContext);
const [appVersion, setAppVersion] = useState<string>("");

useEffect(() => {
const version = SdkConfig.get("appVersion") || "unknown";
setAppVersion(version);
}, []);


const brandingConfig = SdkConfig.getObject("branding");
const links = brandingConfig?.get("auth_footer_links") ?? [
{ text: "About", url: "https://elecord.app" },
{ text: "v2.0.1", url: "https://github.com/elecordapp/elecord-web/releases" },
{ text: `v${appVersion}`, url: "https://github.com/elecordapp/elecord-web/releases" },
{ text: "Privacy", url: "https://github.com/elecordapp/elecord-web/blob/master/PRIVACY.md" },
{ text: "GitHub", url: "https://github.com/elecordapp/elecord-web" },
];
Expand Down

0 comments on commit 1232a25

Please sign in to comment.