mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-11-20 09:01:20 -08:00
Merge branch 'main' into subprojects
This commit is contained in:
16 files changed
+111
-263
No files matched your search
@@ -139,7 +139,7 @@ export function Dropdown({
|
||||
<div
|
||||
className={classNames(
|
||||
'absolute z-10 rounded shadow min-w-max max-h-[50vh]',
|
||||
'overflow-y-auto dropdown-scroll',
|
||||
'overflow-y-auto dropdown-scroll overflow-x-hidden',
|
||||
display === 'fit' && 'w-fit',
|
||||
display === 'block' && 'w-full',
|
||||
direction === 'up' && 'bottom-[45px]',
|
||||
@@ -155,7 +155,7 @@ export function Dropdown({
|
||||
{items.map((item) => (
|
||||
<li
|
||||
className={classNames(
|
||||
'py-2 px-4 min-w-max cursor-pointer pr-2',
|
||||
'py-2 px-4 min-w-max cursor-pointer',
|
||||
variant == 'primary' &&
|
||||
'hover:bg-background-50 text-background-20 hover:text-background-10',
|
||||
variant == 'secondary' &&
|
||||
|
||||
@@ -1,24 +1,39 @@
|
||||
import { ReactNode } from 'react';
|
||||
import { ReactNode, useState } from 'react';
|
||||
import { useLayout } from '../../hooks/layout';
|
||||
import { useOnboarding } from '../../hooks/onboarding';
|
||||
import { MainLayoutRoute } from '../MainLayout';
|
||||
import { TopBar } from '../TopBar';
|
||||
import { useBreakpoint } from '../../hooks/breakpoint';
|
||||
import { SkipSetupButton } from './SkipSetupButton';
|
||||
import { SkipSetupWarningModal } from './SkipSetupWarningModal';
|
||||
|
||||
export function OnboardingLayout({ children }: { children: ReactNode }) {
|
||||
const { layoutHeight, ref } = useLayout<HTMLDivElement>();
|
||||
const { isMobile } = useBreakpoint('mobile');
|
||||
const { state } = useOnboarding();
|
||||
const { state, skipSetup } = useOnboarding();
|
||||
const [skipWarning, setSkipWarning] = useState(false);
|
||||
|
||||
return !state.alonePage ? (
|
||||
<>
|
||||
<TopBar progress={state.progress}></TopBar>
|
||||
<div
|
||||
ref={ref}
|
||||
className="flex-grow xs:pt-10 mobile:pt-2"
|
||||
className="flex-grow relative"
|
||||
style={{ height: layoutHeight }}
|
||||
>
|
||||
<div className="absolute top-12 mobile:top-0 right-2 z-50">
|
||||
<SkipSetupButton
|
||||
visible={true}
|
||||
modalVisible={skipWarning}
|
||||
onClick={() => setSkipWarning(true)}
|
||||
></SkipSetupButton>
|
||||
</div>
|
||||
{children}
|
||||
<SkipSetupWarningModal
|
||||
accept={skipSetup}
|
||||
onClose={() => setSkipWarning(false)}
|
||||
isOpen={skipWarning}
|
||||
></SkipSetupWarningModal>
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
|
||||
@@ -3,8 +3,6 @@ import { useOnboarding } from '../../../hooks/onboarding';
|
||||
import { Button } from '../../commons/Button';
|
||||
import { Typography } from '../../commons/Typography';
|
||||
import { useMemo, useState } from 'react';
|
||||
import { SkipSetupWarningModal } from '../SkipSetupWarningModal';
|
||||
import { SkipSetupButton } from '../SkipSetupButton';
|
||||
import { ProgressBar } from '../../commons/ProgressBar';
|
||||
import { LoaderIcon, SlimeState } from '../../commons/icon/LoaderIcon';
|
||||
import { useCountdown } from '../../../hooks/countdown';
|
||||
@@ -22,8 +20,7 @@ export const IMU_CALIBRATION_TIME = 4;
|
||||
|
||||
export function CalibrationTutorialPage() {
|
||||
const { l10n } = useLocalization();
|
||||
const { applyProgress, skipSetup } = useOnboarding();
|
||||
const [skipWarning, setSkipWarning] = useState(false);
|
||||
const { applyProgress } = useOnboarding();
|
||||
const [calibrationStatus, setCalibrationStatus] = useState(
|
||||
CalibrationStatus.WAITING
|
||||
);
|
||||
@@ -72,11 +69,6 @@ export function CalibrationTutorialPage() {
|
||||
return (
|
||||
<>
|
||||
<div className="flex flex-col gap-5 h-full items-center w-full justify-center relative">
|
||||
<SkipSetupButton
|
||||
visible={true}
|
||||
modalVisible={skipWarning}
|
||||
onClick={() => setSkipWarning(true)}
|
||||
></SkipSetupButton>
|
||||
<div className="flex w-full h-full justify-center xs:px-20 mobile:px-5 pb-5 gap-14">
|
||||
<div className="flex gap-4 self-center mobile:z-10">
|
||||
<div className="flex flex-col max-w-md gap-3">
|
||||
@@ -160,11 +152,6 @@ export function CalibrationTutorialPage() {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<SkipSetupWarningModal
|
||||
accept={skipSetup}
|
||||
onClose={() => setSkipWarning(false)}
|
||||
isOpen={skipWarning}
|
||||
></SkipSetupWarningModal>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -20,8 +20,6 @@ import { ProgressBar } from '../../commons/ProgressBar';
|
||||
import { TipBox } from '../../commons/TipBox';
|
||||
import { Typography } from '../../commons/Typography';
|
||||
import { TrackerCard } from '../../tracker/TrackerCard';
|
||||
import { SkipSetupWarningModal } from '../SkipSetupWarningModal';
|
||||
import { SkipSetupButton } from '../SkipSetupButton';
|
||||
import { useBnoExists } from '../../../hooks/imu-logic';
|
||||
import { useBreakpoint } from '../../../hooks/breakpoint';
|
||||
|
||||
@@ -60,16 +58,13 @@ const statusProgressMap = {
|
||||
export function ConnectTrackersPage() {
|
||||
const { isMobile } = useBreakpoint('mobile');
|
||||
const { l10n } = useLocalization();
|
||||
const { layoutHeight, ref } = isMobile
|
||||
? { layoutHeight: 0, ref: undefined }
|
||||
: useLayout<HTMLDivElement>();
|
||||
const { layoutHeight, ref } = useLayout<HTMLDivElement>();
|
||||
const { useConnectedTrackers } = useTrackers();
|
||||
const { applyProgress, state, skipSetup } = useOnboarding();
|
||||
const { applyProgress, state } = useOnboarding();
|
||||
const navigate = useNavigate();
|
||||
const { sendRPCPacket, useRPCPacket } = useWebsocketAPI();
|
||||
const [provisioningStatus, setProvisioningStatus] =
|
||||
useState<WifiProvisioningStatus>(WifiProvisioningStatus.NONE);
|
||||
const [skipWarning, setSkipWarning] = useState(false);
|
||||
|
||||
applyProgress(0.4);
|
||||
|
||||
@@ -132,14 +127,9 @@ export function ConnectTrackersPage() {
|
||||
}, [provisioningStatus]);
|
||||
|
||||
return (
|
||||
<div className="flex flex-col h-full items-center relative overflow-y-auto px-4 pb-4">
|
||||
<SkipSetupButton
|
||||
visible={!state.alonePage}
|
||||
modalVisible={skipWarning}
|
||||
onClick={() => setSkipWarning(true)}
|
||||
></SkipSetupButton>
|
||||
<div className="flex flex-col h-full items-center px-4 pb-4">
|
||||
<div className="flex gap-10 mobile:flex-col w-full xs:max-w-7xl">
|
||||
<div className="flex flex-col w-full max-w-sm">
|
||||
<div className="flex flex-col w-full xs:max-w-sm">
|
||||
<Typography variant="main-title">
|
||||
{l10n.getString('onboarding-connect_tracker-title')}
|
||||
</Typography>
|
||||
@@ -237,20 +227,24 @@ export function ConnectTrackersPage() {
|
||||
</Typography>
|
||||
|
||||
<div
|
||||
className="xs:flex-grow xs:overflow-y-scroll"
|
||||
className="overflow-y-scroll mt-2"
|
||||
ref={ref}
|
||||
style={isMobile ? { height: layoutHeight - BOTTOM_HEIGHT } : {}}
|
||||
style={
|
||||
isMobile && state.alonePage
|
||||
? { height: layoutHeight - BOTTOM_HEIGHT }
|
||||
: { height: layoutHeight }
|
||||
}
|
||||
>
|
||||
<div className="grid lg:grid-cols-2 md:grid-cols-1 gap-2 xs:mx-3 pt-3">
|
||||
<div className="grid lg:grid-cols-2 md:grid-cols-1 gap-2 pr-1">
|
||||
{Array.from({
|
||||
...connectedTrackers,
|
||||
length: Math.max(connectedTrackers.length, isMobile ? 1 : 20),
|
||||
length: Math.max(connectedTrackers.length, 1),
|
||||
}).map((tracker, index) => (
|
||||
<div key={index}>
|
||||
{!tracker && (
|
||||
<div
|
||||
className={classNames(
|
||||
'rounded-xl h-16 mobile:animate-pulse',
|
||||
'rounded-xl h-16 animate-pulse',
|
||||
state.alonePage
|
||||
? 'bg-background-80'
|
||||
: 'bg-background-70'
|
||||
@@ -270,11 +264,6 @@ export function ConnectTrackersPage() {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<SkipSetupWarningModal
|
||||
accept={skipSetup}
|
||||
onClose={() => setSkipWarning(false)}
|
||||
isOpen={skipWarning}
|
||||
></SkipSetupWarningModal>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,28 +1,19 @@
|
||||
import { useLocalization } from '@fluent/react';
|
||||
import { useState } from 'react';
|
||||
import { useOnboarding } from '../../../hooks/onboarding';
|
||||
import { Button } from '../../commons/Button';
|
||||
import { SlimeVRIcon } from '../../commons/icon/SimevrIcon';
|
||||
import { LangSelector } from '../../commons/LangSelector';
|
||||
import { Typography } from '../../commons/Typography';
|
||||
import { SkipSetupButton } from '../SkipSetupButton';
|
||||
import { SkipSetupWarningModal } from '../SkipSetupWarningModal';
|
||||
|
||||
export function HomePage() {
|
||||
const { l10n } = useLocalization();
|
||||
const { applyProgress, skipSetup } = useOnboarding();
|
||||
const [skipWarning, setSkipWarning] = useState(false);
|
||||
const { applyProgress } = useOnboarding();
|
||||
|
||||
applyProgress(0.1);
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="flex flex-col gap-5 h-full items-center w-full justify-center relative px-4">
|
||||
<SkipSetupButton
|
||||
visible={true}
|
||||
modalVisible={skipWarning}
|
||||
onClick={() => setSkipWarning(true)}
|
||||
></SkipSetupButton>
|
||||
<div className="flex flex-col gap-5 h-full items-center w-full justify-center px-4">
|
||||
<div className="flex flex-col gap-5 items-center z-10 scale-150 mb-20">
|
||||
<SlimeVRIcon></SlimeVRIcon>
|
||||
<Typography variant="mobile-title">
|
||||
@@ -64,11 +55,6 @@ export function HomePage() {
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<SkipSetupWarningModal
|
||||
accept={skipSetup}
|
||||
onClose={() => setSkipWarning(false)}
|
||||
isOpen={skipWarning}
|
||||
></SkipSetupWarningModal>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -3,8 +3,6 @@ import { useOnboarding } from '../../../hooks/onboarding';
|
||||
import { Button } from '../../commons/Button';
|
||||
import { Typography } from '../../commons/Typography';
|
||||
import { useState, useMemo, useEffect } from 'react';
|
||||
import { SkipSetupWarningModal } from '../SkipSetupWarningModal';
|
||||
import { SkipSetupButton } from '../SkipSetupButton';
|
||||
import {
|
||||
BodyPart,
|
||||
ResetResponseT,
|
||||
@@ -23,8 +21,7 @@ import { useBreakpoint } from '../../../hooks/breakpoint';
|
||||
export function ResetTutorialPage() {
|
||||
const { isMobile } = useBreakpoint('mobile');
|
||||
const { l10n } = useLocalization();
|
||||
const { applyProgress, skipSetup } = useOnboarding();
|
||||
const [skipWarning, setSkipWarning] = useState(false);
|
||||
const { applyProgress } = useOnboarding();
|
||||
const { useAssignedTrackers } = useTrackers();
|
||||
const { useRPCPacket, sendRPCPacket } = useWebsocketAPI();
|
||||
const [curIndex, setCurIndex] = useState(0);
|
||||
@@ -122,11 +119,6 @@ export function ResetTutorialPage() {
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-5 h-full items-center w-full xs:justify-center relative overflow-y-auto">
|
||||
<SkipSetupButton
|
||||
visible={true}
|
||||
modalVisible={skipWarning}
|
||||
onClick={() => setSkipWarning(true)}
|
||||
></SkipSetupButton>
|
||||
<div className="flex xs:flex-row mobile:flex-col w-full h-full xs:justify-center xs:px-20 mobile:px-4 gap-8 self-center">
|
||||
<div className="flex flex-col gap-3 xs:w-96 self-center">
|
||||
<Typography variant="main-title">
|
||||
@@ -197,11 +189,6 @@ export function ResetTutorialPage() {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<SkipSetupWarningModal
|
||||
accept={skipSetup}
|
||||
onClose={() => setSkipWarning(false)}
|
||||
isOpen={skipWarning}
|
||||
></SkipSetupWarningModal>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -4,19 +4,15 @@ import { useWifiForm } from '../../../hooks/wifi-form';
|
||||
import { Button } from '../../commons/Button';
|
||||
import { Input } from '../../commons/Input';
|
||||
import { Typography } from '../../commons/Typography';
|
||||
import { useState } from 'react';
|
||||
import { SkipSetupWarningModal } from '../SkipSetupWarningModal';
|
||||
import { SkipSetupButton } from '../SkipSetupButton';
|
||||
import classNames from 'classnames';
|
||||
import { useTrackers } from '../../../hooks/tracker';
|
||||
import { useBnoExists } from '../../../hooks/imu-logic';
|
||||
|
||||
export function WifiCredsPage() {
|
||||
const { l10n } = useLocalization();
|
||||
const { applyProgress, skipSetup, state } = useOnboarding();
|
||||
const { applyProgress, state } = useOnboarding();
|
||||
const { control, handleSubmit, submitWifiCreds, formState } = useWifiForm();
|
||||
const { useConnectedTrackers } = useTrackers();
|
||||
const [skipWarning, setSkipWarning] = useState(false);
|
||||
const connectedTrackers = useConnectedTrackers();
|
||||
|
||||
applyProgress(0.2);
|
||||
@@ -29,11 +25,6 @@ export function WifiCredsPage() {
|
||||
onSubmit={handleSubmit(submitWifiCreds)}
|
||||
>
|
||||
<div className="flex flex-col w-full h-full xs:justify-center items-center relative ">
|
||||
<SkipSetupButton
|
||||
visible={true}
|
||||
modalVisible={skipWarning}
|
||||
onClick={() => setSkipWarning(true)}
|
||||
></SkipSetupButton>
|
||||
<div className="flex mobile:flex-col xs:gap-10 px-4">
|
||||
<div className="flex flex-col max-w-sm">
|
||||
<Typography variant="main-title">
|
||||
@@ -117,11 +108,6 @@ export function WifiCredsPage() {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<SkipSetupWarningModal
|
||||
accept={skipSetup}
|
||||
onClose={() => setSkipWarning(false)}
|
||||
isOpen={skipWarning}
|
||||
></SkipSetupWarningModal>
|
||||
</form>
|
||||
);
|
||||
}
|
||||
@@ -2,9 +2,6 @@ import { useLocalization } from '@fluent/react';
|
||||
import { useOnboarding } from '../../../../hooks/onboarding';
|
||||
import { Button } from '../../../commons/Button';
|
||||
import { Typography } from '../../../commons/Typography';
|
||||
import { useState } from 'react';
|
||||
import { SkipSetupWarningModal } from '../../SkipSetupWarningModal';
|
||||
import { SkipSetupButton } from '../../SkipSetupButton';
|
||||
import { useTrackers } from '../../../../hooks/tracker';
|
||||
import { useBnoExists } from '../../../../hooks/imu-logic';
|
||||
import { StickerSlime } from './StickerSlime';
|
||||
@@ -13,8 +10,7 @@ import { ExtensionArrow } from './ExtensionArrow';
|
||||
|
||||
export function AssignmentTutorialPage() {
|
||||
const { l10n } = useLocalization();
|
||||
const { applyProgress, skipSetup } = useOnboarding();
|
||||
const [skipWarning, setSkipWarning] = useState(false);
|
||||
const { applyProgress } = useOnboarding();
|
||||
const { useConnectedTrackers } = useTrackers();
|
||||
const connectedTrackers = useConnectedTrackers();
|
||||
const bnoExists = useBnoExists(connectedTrackers);
|
||||
@@ -23,83 +19,71 @@ export function AssignmentTutorialPage() {
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="flex flex-col gap-5 h-full items-center w-full justify-center relative">
|
||||
<SkipSetupButton
|
||||
visible={true}
|
||||
modalVisible={skipWarning}
|
||||
onClick={() => setSkipWarning(true)}
|
||||
></SkipSetupButton>
|
||||
<div className="flex flex-col w-full h-full justify-center xs:px-20 gap-3 pb-2">
|
||||
<div className="overflow-y-auto px-4">
|
||||
<div className="mb-10 self-center">
|
||||
<Typography variant="main-title">
|
||||
{l10n.getString('onboarding-assignment_tutorial')}
|
||||
</Typography>
|
||||
<div className="flex flex-col gap-5 h-full items-center overflow-y-auto w-full xs:justify-center relative py-2">
|
||||
<div className="flex flex-col w-full xs:justify-center xs:px-20 gap-3 pb-2 px-4">
|
||||
<div className="mb-10 self-center">
|
||||
<Typography variant="main-title">
|
||||
{l10n.getString('onboarding-assignment_tutorial')}
|
||||
</Typography>
|
||||
</div>
|
||||
<div className="flex flex-col self-center justify-center gap-5 px-2">
|
||||
<div className="flex gap-12 xs:flex-row mobile:flex-col self-center justify-center">
|
||||
<div className="flex flex-col gap-5 xs:w-1/4">
|
||||
<div>
|
||||
<Typography variant="section-title">
|
||||
{l10n.getString(
|
||||
'onboarding-assignment_tutorial-first_step'
|
||||
)}
|
||||
</Typography>
|
||||
</div>
|
||||
<div className="stroke-background-10 fill-background-10 flex justify-center">
|
||||
<StickerSlime width="65%"></StickerSlime>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-col gap-10 xs:w-1/4">
|
||||
<div>
|
||||
<Typography variant="section-title">
|
||||
{l10n.getString(
|
||||
'onboarding-assignment_tutorial-second_step'
|
||||
)}
|
||||
</Typography>
|
||||
</div>
|
||||
<div className="fill-background-10 stroke-background-10 flex justify-center">
|
||||
<TrackerArrow width="75%"></TrackerArrow>
|
||||
</div>
|
||||
<div>
|
||||
<Typography variant="section-title">
|
||||
{l10n.getString(
|
||||
'onboarding-assignment_tutorial-second_step-continuation'
|
||||
)}
|
||||
</Typography>
|
||||
</div>
|
||||
<div className="fill-background-10 stroke-background-10 flex justify-center">
|
||||
<ExtensionArrow width="75%"></ExtensionArrow>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-col self-center justify-center gap-5 px-2">
|
||||
<div className="flex gap-12 xs:flex-row mobile:flex-col self-center justify-center">
|
||||
<div className="flex flex-col gap-5 xs:w-1/4">
|
||||
<div>
|
||||
<Typography variant="section-title">
|
||||
{l10n.getString(
|
||||
'onboarding-assignment_tutorial-first_step'
|
||||
)}
|
||||
</Typography>
|
||||
</div>
|
||||
<div className="stroke-background-10 fill-background-10 flex justify-center">
|
||||
<StickerSlime width="65%"></StickerSlime>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-col gap-10 xs:w-1/4">
|
||||
<div>
|
||||
<Typography variant="section-title">
|
||||
{l10n.getString(
|
||||
'onboarding-assignment_tutorial-second_step'
|
||||
)}
|
||||
</Typography>
|
||||
</div>
|
||||
<div className="fill-background-10 stroke-background-10 flex justify-center">
|
||||
<TrackerArrow width="75%"></TrackerArrow>
|
||||
</div>
|
||||
<div>
|
||||
<Typography variant="section-title">
|
||||
{l10n.getString(
|
||||
'onboarding-assignment_tutorial-second_step-continuation'
|
||||
)}
|
||||
</Typography>
|
||||
</div>
|
||||
<div className="fill-background-10 stroke-background-10 flex justify-center">
|
||||
<ExtensionArrow width="75%"></ExtensionArrow>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex">
|
||||
<Button
|
||||
variant="secondary"
|
||||
to={
|
||||
bnoExists
|
||||
? '/onboarding/calibration-tutorial'
|
||||
: '/onboarding/wifi-creds'
|
||||
}
|
||||
>
|
||||
{l10n.getString('onboarding-previous_step')}
|
||||
</Button>
|
||||
<Button
|
||||
variant="primary"
|
||||
to="/onboarding/trackers-assign"
|
||||
className="ml-auto"
|
||||
>
|
||||
{l10n.getString('onboarding-assignment_tutorial-done')}
|
||||
</Button>
|
||||
</div>
|
||||
<div className="flex">
|
||||
<Button
|
||||
variant="secondary"
|
||||
to={
|
||||
bnoExists
|
||||
? '/onboarding/calibration-tutorial'
|
||||
: '/onboarding/wifi-creds'
|
||||
}
|
||||
>
|
||||
{l10n.getString('onboarding-previous_step')}
|
||||
</Button>
|
||||
<Button
|
||||
variant="primary"
|
||||
to="/onboarding/trackers-assign"
|
||||
className="ml-auto"
|
||||
>
|
||||
{l10n.getString('onboarding-assignment_tutorial-done')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<SkipSetupWarningModal
|
||||
accept={skipSetup}
|
||||
onClose={() => setSkipWarning(false)}
|
||||
isOpen={skipWarning}
|
||||
></SkipSetupWarningModal>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { useLocalization } from '@fluent/react';
|
||||
import { useState } from 'react';
|
||||
import { RpcMessage, SkeletonResetAllRequestT } from 'solarxr-protocol';
|
||||
import {
|
||||
AutoboneContextC,
|
||||
@@ -16,16 +15,13 @@ import { PutTrackersOnStep } from './autobone-steps/PutTrackersOn';
|
||||
import { Recording } from './autobone-steps/Recording';
|
||||
import { StartRecording } from './autobone-steps/StartRecording';
|
||||
import { VerifyResultsStep } from './autobone-steps/VerifyResults';
|
||||
import { SkipSetupWarningModal } from '../../SkipSetupWarningModal';
|
||||
import { SkipSetupButton } from '../../SkipSetupButton';
|
||||
import { useCountdown } from '../../../../hooks/countdown';
|
||||
|
||||
export function AutomaticProportionsPage() {
|
||||
const { l10n } = useLocalization();
|
||||
const { applyProgress, skipSetup, state } = useOnboarding();
|
||||
const { applyProgress, state } = useOnboarding();
|
||||
const { sendRPCPacket } = useWebsocketAPI();
|
||||
const context = useProvideAutobone();
|
||||
const [skipWarning, setSkipWarning] = useState(false);
|
||||
const { isCounting, startCountdown, timer } = useCountdown({
|
||||
onCountdownEnd: () => {
|
||||
sendRPCPacket(
|
||||
@@ -39,13 +35,8 @@ export function AutomaticProportionsPage() {
|
||||
|
||||
return (
|
||||
<AutoboneContextC.Provider value={context}>
|
||||
<div className="flex flex-col gap-5 h-full items-center w-full xs:justify-center relative px-4 pb-4">
|
||||
<SkipSetupButton
|
||||
visible={!state.alonePage}
|
||||
modalVisible={skipWarning}
|
||||
onClick={() => setSkipWarning(true)}
|
||||
></SkipSetupButton>
|
||||
<div className="flex flex-col w-full h-full justify-center max-w-3xl gap-5">
|
||||
<div className="flex flex-col gap-5 h-full items-center w-full xs:justify-center overflow-y-auto overflow-x-hidden relative px-4 pb-4">
|
||||
<div className="flex flex-col w-full xs:h-full xs:justify-center max-w-3xl gap-5">
|
||||
<div className="flex flex-col max-w-lg gap-3">
|
||||
<Typography variant="main-title">
|
||||
{l10n.getString('onboarding-automatic_proportions-title')}
|
||||
@@ -85,11 +76,6 @@ export function AutomaticProportionsPage() {
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<SkipSetupWarningModal
|
||||
accept={skipSetup}
|
||||
onClose={() => setSkipWarning(false)}
|
||||
isOpen={skipWarning}
|
||||
></SkipSetupWarningModal>
|
||||
</AutoboneContextC.Provider>
|
||||
);
|
||||
}
|
||||
@@ -8,9 +8,7 @@ import { PersonFrontIcon } from '../../../commons/PersonFrontIcon';
|
||||
import { Typography } from '../../../commons/Typography';
|
||||
import { BodyProportions } from './BodyProportions';
|
||||
import { useLocalization } from '@fluent/react';
|
||||
import { useEffect, useMemo, useState } from 'react';
|
||||
import { SkipSetupWarningModal } from '../../SkipSetupWarningModal';
|
||||
import { SkipSetupButton } from '../../SkipSetupButton';
|
||||
import { useEffect, useMemo } from 'react';
|
||||
import { useBreakpoint } from '../../../../hooks/breakpoint';
|
||||
|
||||
export function ButtonsControl() {
|
||||
@@ -49,8 +47,7 @@ export function ButtonsControl() {
|
||||
export function ManualProportionsPage() {
|
||||
const { isMobile } = useBreakpoint('mobile');
|
||||
const { l10n } = useLocalization();
|
||||
const { applyProgress, skipSetup, state } = useOnboarding();
|
||||
const [skipWarning, setSkipWarning] = useState(false);
|
||||
const { applyProgress, state } = useOnboarding();
|
||||
|
||||
applyProgress(0.9);
|
||||
|
||||
@@ -68,11 +65,6 @@ export function ManualProportionsPage() {
|
||||
return (
|
||||
<>
|
||||
<div className="flex flex-col gap-5 h-full items-center w-full xs:justify-center overflow-y-auto relative">
|
||||
<SkipSetupButton
|
||||
visible={!state.alonePage}
|
||||
modalVisible={skipWarning}
|
||||
onClick={() => setSkipWarning(true)}
|
||||
></SkipSetupButton>
|
||||
<div className="flex flex-col w-full h-full xs:max-w-5xl xs:justify-center">
|
||||
<div className="flex gap-8 justify-center">
|
||||
<div className="flex flex-col w-full xs:max-w-2xl gap-3 items-center">
|
||||
@@ -118,11 +110,6 @@ export function ManualProportionsPage() {
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<SkipSetupWarningModal
|
||||
accept={skipSetup}
|
||||
onClose={() => setSkipWarning(false)}
|
||||
isOpen={skipWarning}
|
||||
></SkipSetupWarningModal>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,8 +1,6 @@
|
||||
import { useOnboarding } from '../../../../hooks/onboarding';
|
||||
import { useLocalization } from '@fluent/react';
|
||||
import { useState } from 'react';
|
||||
import { SkipSetupWarningModal } from '../../SkipSetupWarningModal';
|
||||
import { SkipSetupButton } from '../../SkipSetupButton';
|
||||
import classNames from 'classnames';
|
||||
import { Typography } from '../../../commons/Typography';
|
||||
import { Button } from '../../../commons/Button';
|
||||
@@ -20,8 +18,7 @@ import { useIsTauri } from '../../../../hooks/breakpoint';
|
||||
export function ProportionsChoose() {
|
||||
const isTauri = useIsTauri();
|
||||
const { l10n } = useLocalization();
|
||||
const { applyProgress, skipSetup, state } = useOnboarding();
|
||||
const [skipWarning, setSkipWarning] = useState(false);
|
||||
const { applyProgress, state } = useOnboarding();
|
||||
const { useRPCPacket, sendRPCPacket } = useWebsocketAPI();
|
||||
const [animated, setAnimated] = useState(false);
|
||||
|
||||
@@ -58,11 +55,6 @@ export function ProportionsChoose() {
|
||||
return (
|
||||
<>
|
||||
<div className="flex flex-col gap-5 h-full items-center w-full xs:justify-center mobile:overflow-y-auto relative px-4 pb-4">
|
||||
<SkipSetupButton
|
||||
visible={!state.alonePage}
|
||||
modalVisible={skipWarning}
|
||||
onClick={() => setSkipWarning(true)}
|
||||
></SkipSetupButton>
|
||||
<div className="flex flex-col gap-4 justify-center">
|
||||
<Typography variant="main-title">
|
||||
{l10n.getString('onboarding-choose_proportions')}
|
||||
@@ -191,11 +183,6 @@ export function ProportionsChoose() {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<SkipSetupWarningModal
|
||||
accept={skipSetup}
|
||||
onClose={() => setSkipWarning(false)}
|
||||
isOpen={skipWarning}
|
||||
></SkipSetupWarningModal>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -6,9 +6,6 @@ import { MountingResetStep } from './mounting-steps/MountingReset';
|
||||
import { PreparationStep } from './mounting-steps/Preparation';
|
||||
import { PutTrackersOnStep } from './mounting-steps/PutTrackersOn';
|
||||
import { useLocalization } from '@fluent/react';
|
||||
import { SkipSetupWarningModal } from '../../SkipSetupWarningModal';
|
||||
import { useState } from 'react';
|
||||
import { SkipSetupButton } from '../../SkipSetupButton';
|
||||
|
||||
const steps: Step[] = [
|
||||
{ type: 'numbered', component: PutTrackersOnStep },
|
||||
@@ -18,19 +15,13 @@ const steps: Step[] = [
|
||||
];
|
||||
export function AutomaticMountingPage() {
|
||||
const { l10n } = useLocalization();
|
||||
const { applyProgress, skipSetup, state } = useOnboarding();
|
||||
const [skipWarning, setSkipWarning] = useState(false);
|
||||
const { applyProgress, state } = useOnboarding();
|
||||
|
||||
applyProgress(0.7);
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="flex flex-col gap-2 h-full items-center w-full xs:justify-center relative overflow-y-auto overflow-x-hidden px-4 pb-4">
|
||||
<SkipSetupButton
|
||||
visible={!state.alonePage}
|
||||
modalVisible={skipWarning}
|
||||
onClick={() => setSkipWarning(true)}
|
||||
></SkipSetupButton>
|
||||
<div className="flex flex-col w-full h-full xs:justify-center xs:max-w-3xl gap-5">
|
||||
<div className="flex flex-col xs:max-w-lg gap-3">
|
||||
<Typography variant="main-title">
|
||||
@@ -48,11 +39,6 @@ export function AutomaticMountingPage() {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<SkipSetupWarningModal
|
||||
accept={skipSetup}
|
||||
onClose={() => setSkipWarning(false)}
|
||||
isOpen={skipWarning}
|
||||
></SkipSetupWarningModal>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -11,16 +11,13 @@ import { Typography } from '../../../commons/Typography';
|
||||
import { BodyAssignment } from '../../BodyAssignment';
|
||||
import { MountingSelectionMenu } from './MountingSelectionMenu';
|
||||
import { useLocalization } from '@fluent/react';
|
||||
import { SkipSetupWarningModal } from '../../SkipSetupWarningModal';
|
||||
import { SkipSetupButton } from '../../SkipSetupButton';
|
||||
import { useBreakpoint } from '../../../../hooks/breakpoint';
|
||||
|
||||
export function ManualMountingPage() {
|
||||
const { isMobile } = useBreakpoint('mobile');
|
||||
const { l10n } = useLocalization();
|
||||
const { applyProgress, skipSetup, state } = useOnboarding();
|
||||
const { applyProgress, state } = useOnboarding();
|
||||
const { sendRPCPacket } = useWebsocketAPI();
|
||||
const [skipWarning, setSkipWarning] = useState(false);
|
||||
|
||||
const [selectedRole, setSelectRole] = useState<BodyPart>(BodyPart.NONE);
|
||||
|
||||
@@ -70,11 +67,6 @@ export function ManualMountingPage() {
|
||||
onDirectionSelected={onDirectionSelected}
|
||||
></MountingSelectionMenu>
|
||||
<div className="flex flex-col gap-5 h-full items-center w-full xs:justify-center relative overflow-y-auto">
|
||||
<SkipSetupButton
|
||||
visible={!state.alonePage}
|
||||
modalVisible={skipWarning}
|
||||
onClick={() => setSkipWarning(true)}
|
||||
></SkipSetupButton>
|
||||
<div className="flex xs:flex-row mobile:flex-col h-full px-8 xs:w-full xs:justify-center mobile:px-4 items-center">
|
||||
<div className="flex flex-col w-full xs:max-w-sm gap-3">
|
||||
<Typography variant="main-title">
|
||||
@@ -109,11 +101,6 @@ export function ManualMountingPage() {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<SkipSetupWarningModal
|
||||
accept={skipSetup}
|
||||
onClose={() => setSkipWarning(false)}
|
||||
isOpen={skipWarning}
|
||||
></SkipSetupWarningModal>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -2,7 +2,6 @@ import { useOnboarding } from '../../../../hooks/onboarding';
|
||||
import { useLocalization } from '@fluent/react';
|
||||
import { useState } from 'react';
|
||||
import { SkipSetupWarningModal } from '../../SkipSetupWarningModal';
|
||||
import { SkipSetupButton } from '../../SkipSetupButton';
|
||||
import classNames from 'classnames';
|
||||
import { Typography } from '../../../commons/Typography';
|
||||
import { Button } from '../../../commons/Button';
|
||||
@@ -18,11 +17,6 @@ export function MountingChoose() {
|
||||
return (
|
||||
<>
|
||||
<div className="flex flex-col gap-5 h-full items-center w-full xs:justify-center relative overflow-y-auto px-4 pb-4">
|
||||
<SkipSetupButton
|
||||
visible={!state.alonePage}
|
||||
modalVisible={skipWarning}
|
||||
onClick={() => setSkipWarning(true)}
|
||||
></SkipSetupButton>
|
||||
<div className="flex flex-col gap-4 justify-center">
|
||||
<div className="xs:w-10/12 xs:max-w-[666px]">
|
||||
<Typography variant="main-title">
|
||||
|
||||
@@ -26,8 +26,6 @@ import { Typography } from '../../../commons/Typography';
|
||||
import { ASSIGNMENT_RULES, BodyAssignment } from '../../BodyAssignment';
|
||||
import { NeckWarningModal } from '../../NeckWarningModal';
|
||||
import { TrackerSelectionMenu } from './TrackerSelectionMenu';
|
||||
import { SkipSetupWarningModal } from '../../SkipSetupWarningModal';
|
||||
import { SkipSetupButton } from '../../SkipSetupButton';
|
||||
import { useConfig } from '../../../../hooks/config';
|
||||
import { playTapSetupSound } from '../../../../sounds/sounds';
|
||||
import { useBreakpoint } from '../../../../hooks/breakpoint';
|
||||
@@ -48,7 +46,7 @@ export function TrackersAssignPage() {
|
||||
const { isMobile } = useBreakpoint('mobile');
|
||||
const { l10n } = useLocalization();
|
||||
const { useAssignedTrackers, trackers } = useTrackers();
|
||||
const { applyProgress, skipSetup, state } = useOnboarding();
|
||||
const { applyProgress, state } = useOnboarding();
|
||||
const { sendRPCPacket, useRPCPacket } = useWebsocketAPI();
|
||||
|
||||
const { control, watch } = useForm<{ advanced: boolean }>({
|
||||
@@ -57,7 +55,6 @@ export function TrackersAssignPage() {
|
||||
const { advanced } = watch();
|
||||
const [selectedRole, setSelectRole] = useState<BodyPart>(BodyPart.NONE);
|
||||
const assignedTrackers = useAssignedTrackers();
|
||||
const [skipWarning, setSkipWarning] = useState(false);
|
||||
|
||||
const { config } = useConfig();
|
||||
const [tapDetectionSettings, setTapDetectionSettings] = useState<Omit<
|
||||
@@ -255,13 +252,6 @@ export function TrackersAssignPage() {
|
||||
onClose={() => closeChokerWarning(true)}
|
||||
accept={() => closeChokerWarning(false)}
|
||||
></NeckWarningModal>
|
||||
<div className="relative mx-4 top-4">
|
||||
<SkipSetupButton
|
||||
visible={!state.alonePage}
|
||||
modalVisible={skipWarning}
|
||||
onClick={() => setSkipWarning(true)}
|
||||
></SkipSetupButton>
|
||||
</div>
|
||||
<div className="flex flex-col gap-5 h-full items-center w-full justify-center">
|
||||
<div className="flex flex-col w-full overflow-y-auto px-4 xs:items-center">
|
||||
<div className="flex mobile:flex-col md:gap-8 mobile:gap-4 mobile:pb-4">
|
||||
@@ -330,11 +320,6 @@ export function TrackersAssignPage() {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<SkipSetupWarningModal
|
||||
accept={skipSetup}
|
||||
onClose={() => setSkipWarning(false)}
|
||||
isOpen={skipWarning}
|
||||
></SkipSetupWarningModal>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -164,6 +164,8 @@ public class ProvisioningHandler implements SerialListener {
|
||||
|
||||
@Override
|
||||
public void onNewSerialDevice(SerialPort port) {
|
||||
if (!isRunning)
|
||||
return;
|
||||
this.initSerial(this.preferredPort);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user