From 67c5275fa804f3425dd6d0ba0e7f560f228b1b7d Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Tue, 25 Feb 2020 15:45:55 +0200 Subject: [PATCH] Fingerprint: add security fingerprint to settings page I was initially trying to add it to the side menu. For a reason I just can't understand the dialog wouldn't show from there, and I unfortunately don't have time to debug it at the moment. Here it just works as is "good enough" for now. --- src/Settings/index.tsx | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/Settings/index.tsx b/src/Settings/index.tsx index 62196d4..13617d0 100644 --- a/src/Settings/index.tsx +++ b/src/Settings/index.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { connect } from 'react-redux'; +import { connect, useSelector } from 'react-redux'; import { History } from 'history'; import Select from '@material-ui/core/Select'; @@ -12,6 +12,26 @@ import { setSettings } from '../store/actions'; import Container from '../widgets/Container'; import AppBarOverride from '../widgets/AppBarOverride'; +import PrettyFingerprint from '../widgets/PrettyFingerprint'; + +function SecurityFingerprint() { + const userInfo = useSelector((state: StoreState) => state.cache.userInfo); + + if (!userInfo) { + return

Security fingerprint error.

; + } + + const publicKey = userInfo.publicKey; + + return ( + <> +

+ Your security fingerprint is: +

+ + + ); +} interface PropsType { history: History; @@ -34,6 +54,8 @@ class Settings extends React.PureComponent { <> +

Security Fingerprint

+

Date & Time