mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-10 16:21:36 +00:00
Fix tor loading and add highres animations on android
This commit is contained in:
parent
766666f8ef
commit
7fb6319d20
@ -108,6 +108,7 @@ const Onboarding = ({
|
|||||||
<LinearProgress sx={{ height: '0.7em' }} />
|
<LinearProgress sx={{ height: '0.7em' }} />
|
||||||
) : (
|
) : (
|
||||||
<TokenInput
|
<TokenInput
|
||||||
|
autoFocusTarget='copyButton'
|
||||||
inputToken={inputToken}
|
inputToken={inputToken}
|
||||||
setInputToken={setInputToken}
|
setInputToken={setInputToken}
|
||||||
setRobot={setRobot}
|
setRobot={setRobot}
|
||||||
|
@ -1,21 +1,8 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import {
|
import { IconButton, TextField, Tooltip, useTheme } from '@mui/material';
|
||||||
Button,
|
|
||||||
Collapse,
|
|
||||||
Grid,
|
|
||||||
IconButton,
|
|
||||||
TextField,
|
|
||||||
Tooltip,
|
|
||||||
Typography,
|
|
||||||
useTheme,
|
|
||||||
} from '@mui/material';
|
|
||||||
import { useParams } from 'react-router-dom';
|
|
||||||
|
|
||||||
import { Page } from '../NavBar';
|
|
||||||
import { Robot } from '../../models';
|
import { Robot } from '../../models';
|
||||||
import { Casino, Download, ContentCopy, SmartToy, Bolt } from '@mui/icons-material';
|
import { Download, ContentCopy } from '@mui/icons-material';
|
||||||
import RobotAvatar from '../../components/RobotAvatar';
|
|
||||||
import { systemClient } from '../../services/System';
|
import { systemClient } from '../../services/System';
|
||||||
import { saveAsJson } from '../../utils';
|
import { saveAsJson } from '../../utils';
|
||||||
|
|
||||||
@ -26,6 +13,7 @@ interface TokenInputProps {
|
|||||||
fullWidth?: boolean;
|
fullWidth?: boolean;
|
||||||
setRobot: (state: Robot) => void;
|
setRobot: (state: Robot) => void;
|
||||||
inputToken: string;
|
inputToken: string;
|
||||||
|
autoFocusTarget?: 'textfield' | 'copyButton' | 'none';
|
||||||
onPressEnter: () => void;
|
onPressEnter: () => void;
|
||||||
badRequest: string | undefined;
|
badRequest: string | undefined;
|
||||||
setInputToken: (state: string) => void;
|
setInputToken: (state: string) => void;
|
||||||
@ -42,12 +30,12 @@ const TokenInput = ({
|
|||||||
showDownload = false,
|
showDownload = false,
|
||||||
fullWidth = true,
|
fullWidth = true,
|
||||||
onPressEnter,
|
onPressEnter,
|
||||||
|
autoFocusTarget = 'textfield',
|
||||||
inputToken,
|
inputToken,
|
||||||
badRequest,
|
badRequest,
|
||||||
setInputToken,
|
setInputToken,
|
||||||
}: TokenInputProps): JSX.Element => {
|
}: TokenInputProps): JSX.Element => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const theme = useTheme();
|
|
||||||
const [showCopied, setShowCopied] = useState<boolean>(false);
|
const [showCopied, setShowCopied] = useState<boolean>(false);
|
||||||
const createJsonFile = () => {
|
const createJsonFile = () => {
|
||||||
return {
|
return {
|
||||||
@ -66,7 +54,7 @@ const TokenInput = ({
|
|||||||
required={true}
|
required={true}
|
||||||
label={label ? label : undefined}
|
label={label ? label : undefined}
|
||||||
value={inputToken}
|
value={inputToken}
|
||||||
autoFocus
|
autoFocus={autoFocusTarget == 'texfield' ? true : false}
|
||||||
fullWidth={fullWidth}
|
fullWidth={fullWidth}
|
||||||
sx={{ borderColor: 'primary' }}
|
sx={{ borderColor: 'primary' }}
|
||||||
variant={editable ? 'outlined' : 'filled'}
|
variant={editable ? 'outlined' : 'filled'}
|
||||||
@ -93,6 +81,7 @@ const TokenInput = ({
|
|||||||
endAdornment: showCopy ? (
|
endAdornment: showCopy ? (
|
||||||
<Tooltip open={showCopied} title={t('Copied!')}>
|
<Tooltip open={showCopied} title={t('Copied!')}>
|
||||||
<IconButton
|
<IconButton
|
||||||
|
autoFocus={autoFocusTarget == 'copyButton' ? true : false}
|
||||||
color={robot.copiedToken ? 'inherit' : 'primary'}
|
color={robot.copiedToken ? 'inherit' : 'primary'}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
systemClient.copyToClipboard(inputToken);
|
systemClient.copyToClipboard(inputToken);
|
||||||
|
@ -152,7 +152,7 @@ const RobotPage = ({
|
|||||||
setTimeout(() => setRobot(new Robot()), 10);
|
setTimeout(() => setRobot(new Robot()), 10);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (window?.NativeRobosats & (torStatus != 'DONE')) {
|
if (!(window.NativeRobosats === undefined) && !(torStatus == 'DONE' || torStatus == '"Done"')) {
|
||||||
return (
|
return (
|
||||||
<Paper
|
<Paper
|
||||||
elevation={12}
|
elevation={12}
|
||||||
|
10
frontend/src/components/RobotAvatar/placeholder_highres.json
Normal file
10
frontend/src/components/RobotAvatar/placeholder_highres.json
Normal file
File diff suppressed because one or more lines are too long
@ -46,6 +46,18 @@ const configMobile: Configuration = {
|
|||||||
async: true,
|
async: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
test: path.resolve(__dirname, 'src/components/RobotAvatar/placeholder.json'),
|
||||||
|
loader: 'file-replace-loader',
|
||||||
|
options: {
|
||||||
|
condition: 'if-replacement-exists',
|
||||||
|
replacement: path.resolve(
|
||||||
|
__dirname,
|
||||||
|
'src/components/RobotAvatar/placeholder_highres.json',
|
||||||
|
),
|
||||||
|
async: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
|
Loading…
Reference in New Issue
Block a user