mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-11 00:31:34 +00:00
Add testnet bitcoin styles
This commit is contained in:
parent
d7e464eb2e
commit
0ce3aff484
@ -1,6 +1,6 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { HashRouter, BrowserRouter, Switch, Route, useHistory } from 'react-router-dom';
|
import { HashRouter, BrowserRouter, Switch, Route, useHistory } from 'react-router-dom';
|
||||||
import { useTheme, Box, Slide } from '@mui/material';
|
import { useTheme, Box, Slide, Typography } from '@mui/material';
|
||||||
|
|
||||||
import UserGenPage from './UserGenPage';
|
import UserGenPage from './UserGenPage';
|
||||||
import MakerPage from './MakerPage';
|
import MakerPage from './MakerPage';
|
||||||
@ -29,6 +29,7 @@ import { checkVer, getHost } from '../utils';
|
|||||||
import { sha256 } from 'js-sha256';
|
import { sha256 } from 'js-sha256';
|
||||||
|
|
||||||
import defaultCoordinators from '../../static/federation.json';
|
import defaultCoordinators from '../../static/federation.json';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
const getWindowSize = function (fontSize: number) {
|
const getWindowSize = function (fontSize: number) {
|
||||||
// returns window size in EM units
|
// returns window size in EM units
|
||||||
@ -49,6 +50,8 @@ interface MainProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const Main = ({ settings, setSettings }: MainProps): JSX.Element => {
|
const Main = ({ settings, setSettings }: MainProps): JSX.Element => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
// All app data structured
|
// All app data structured
|
||||||
const [book, setBook] = useState<Book>({ orders: [], loading: true });
|
const [book, setBook] = useState<Book>({ orders: [], loading: true });
|
||||||
const [limits, setLimits] = useState<{ list: LimitList; loading: boolean }>({
|
const [limits, setLimits] = useState<{ list: LimitList; loading: boolean }>({
|
||||||
@ -117,7 +120,6 @@ const Main = ({ settings, setSettings }: MainProps): JSX.Element => {
|
|||||||
: coordinators[0].testnetOnion;
|
: coordinators[0].testnetOnion;
|
||||||
}
|
}
|
||||||
setBaseUrl(`http://${host}`);
|
setBaseUrl(`http://${host}`);
|
||||||
console.log(`http://${host}`);
|
|
||||||
}, [settings.network]);
|
}, [settings.network]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -225,6 +227,16 @@ const Main = ({ settings, setSettings }: MainProps): JSX.Element => {
|
|||||||
baseUrl={baseUrl}
|
baseUrl={baseUrl}
|
||||||
onLoad={() => setRobot({ ...robot, avatarLoaded: true })}
|
onLoad={() => setRobot({ ...robot, avatarLoaded: true })}
|
||||||
/>
|
/>
|
||||||
|
{settings.network === 'testnet' ? (
|
||||||
|
<div style={{ height: 0 }}>
|
||||||
|
<Typography color='secondary' align='center'>
|
||||||
|
<i>{t('Using Testnet Bitcoin')}</i>
|
||||||
|
</Typography>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<></>
|
||||||
|
)}
|
||||||
|
|
||||||
<Box
|
<Box
|
||||||
style={{
|
style={{
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
@ -343,6 +355,7 @@ const Main = ({ settings, setSettings }: MainProps): JSX.Element => {
|
|||||||
</Box>
|
</Box>
|
||||||
<NavBar
|
<NavBar
|
||||||
nickname={robot.avatarLoaded ? robot.nickname : null}
|
nickname={robot.avatarLoaded ? robot.nickname : null}
|
||||||
|
color={settings.network === 'mainnet' ? 'primary' : 'secondary'}
|
||||||
width={windowSize.width}
|
width={windowSize.width}
|
||||||
height={navbarHeight}
|
height={navbarHeight}
|
||||||
page={page}
|
page={page}
|
||||||
|
@ -33,6 +33,7 @@ interface NavBarProps {
|
|||||||
currentOrder: number | null;
|
currentOrder: number | null;
|
||||||
hasRobot: boolean;
|
hasRobot: boolean;
|
||||||
baseUrl: string;
|
baseUrl: string;
|
||||||
|
color: 'primary' | 'secondary';
|
||||||
}
|
}
|
||||||
|
|
||||||
const NavBar = ({
|
const NavBar = ({
|
||||||
@ -48,6 +49,7 @@ const NavBar = ({
|
|||||||
currentOrder,
|
currentOrder,
|
||||||
hasRobot = false,
|
hasRobot = false,
|
||||||
baseUrl,
|
baseUrl,
|
||||||
|
color,
|
||||||
}: NavBarProps): JSX.Element => {
|
}: NavBarProps): JSX.Element => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@ -100,6 +102,8 @@ const NavBar = ({
|
|||||||
TabIndicatorProps={{ sx: { height: '0.3em', position: 'absolute', top: 0 } }}
|
TabIndicatorProps={{ sx: { height: '0.3em', position: 'absolute', top: 0 } }}
|
||||||
variant='fullWidth'
|
variant='fullWidth'
|
||||||
value={page}
|
value={page}
|
||||||
|
indicatorColor={color}
|
||||||
|
textColor={color}
|
||||||
onChange={changePage}
|
onChange={changePage}
|
||||||
>
|
>
|
||||||
<Tab
|
<Tab
|
||||||
|
@ -44,7 +44,7 @@ class BaseSettings {
|
|||||||
public fontSize: number = 14;
|
public fontSize: number = 14;
|
||||||
public language?: Language;
|
public language?: Language;
|
||||||
public freezeViewports: boolean = false;
|
public freezeViewports: boolean = false;
|
||||||
public network: 'mainnet' | 'testnet' | undefined = 'mainnet';
|
public network: 'mainnet' | 'testnet' | undefined = 'testnet';
|
||||||
public coordinator: Coordinator | undefined = undefined;
|
public coordinator: Coordinator | undefined = undefined;
|
||||||
public host?: string;
|
public host?: string;
|
||||||
public unsafeClient: boolean = false;
|
public unsafeClient: boolean = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user