1import React from 'react';
2import { Grid, Flex, H5 } from 'indigo-react';
4import { formatDotsWithTime } from 'lib/dateFormat';
5import { segmentNetworkKey } from 'lib/keys';
7import { usePointCache } from 'store/pointCache';
8import { useRollerStore } from 'store/rollerStore';
10const renderNetworkKey = key => {
11 const segments = segmentNetworkKey(key);
17 return segments.join('\n');
20export default function NetworkKeys() {
21 const { getRekeyDate } = usePointCache();
22 const { point } = useRollerStore();
33 const renderNetworkKeySection = (title, key) => (
35 <Grid.Item full as={H5} className="mt3 gray4">
40 <Grid.Item full as="div" className="f5 mono">
43 <Grid.Item full as="code" className="f5 mono wrap">
44 {renderNetworkKey(key)}
48 <Grid.Item full as="code" className="f5 mono gray4">
55 const renderDetail = (title, value) => (
56 <Flex.Item as={Flex} row>
57 <Flex.Item style={{ minWidth: 192, marginBottom: 8 }} as={H5}>
60 {value === 'Not set' ? (
61 <Flex.Item as={H5} className="f5 gray4">
65 <Flex.Item as={H5}>{value}</Flex.Item>
70 const revisionTime = networkKeysSet
71 ? ` at ${getRekeyDate(point.value)
74 Ok: r => formatDotsWithTime(r.value),
75 Error: () => 'No date available',
80 Just: ({ value }) => value,
86 <h5 className="fw-bold">Network Keys</h5>
87 <h5 className="gray4">
88 Revision {keyRevisionNumber} {revisionTime}
90 {renderNetworkKeySection('Authentication Key', authenticationKey)}
91 {renderNetworkKeySection('Encryption Key', encryptionKey)}
92 <Grid.Item full as={Flex} col justify="between" className="mt3">
93 {renderDetail('Continuity Era', continuityNumber)}
94 {renderDetail('Crypto Suite Version', cryptoSuiteVersion)}
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list