This commit is contained in:
Bill 2022-03-01 11:20:25 -05:00
parent d55958fef3
commit 653329fa6c
12 changed files with 48 additions and 60 deletions

View File

@ -1,5 +1,10 @@
import { FC } from 'react'; import { FC } from 'react';
import { BadgeInformationViewProps } from './BadgeInformationView.types';
interface BadgeInformationViewProps
{
title: string;
description: string;
}
export const BadgeInformationView: FC<BadgeInformationViewProps> = props => export const BadgeInformationView: FC<BadgeInformationViewProps> = props =>
{ {

View File

@ -1,5 +0,0 @@
export interface BadgeInformationViewProps
{
title: string;
description: string;
}

View File

@ -1,16 +1,19 @@
import { FriendlyTime } from '@nitrots/nitro-renderer'; import { FriendlyTime } from '@nitrots/nitro-renderer';
import { FC, useCallback, useEffect, useMemo, useState } from 'react'; import { FC, useCallback, useEffect, useMemo, useState } from 'react';
import { FriendlyTimeViewProps } from './FriendlyTimeView.types'; import { Base, BaseProps } from '../../../common';
interface FriendlyTimeViewProps extends BaseProps<HTMLDivElement>
{
seconds: number;
isShort?: boolean;
}
export const FriendlyTimeView: FC<FriendlyTimeViewProps> = props => export const FriendlyTimeView: FC<FriendlyTimeViewProps> = props =>
{ {
const { seconds = 0, isShort = false, ...rest } = props; const { seconds = 0, isShort = false, children = null, ...rest } = props;
const [ updateId, setUpdateId ] = useState(-1); const [ updateId, setUpdateId ] = useState(-1);
const getStartSeconds = useMemo(() => const getStartSeconds = useMemo(() => (Math.round(new Date().getSeconds()) - seconds), [ seconds ]);
{
return (Math.round(new Date().getSeconds()) - seconds);
}, [ seconds ]);
const getFriendlyTime = useCallback(() => const getFriendlyTime = useCallback(() =>
{ {
@ -28,7 +31,5 @@ export const FriendlyTimeView: FC<FriendlyTimeViewProps> = props =>
return () => clearInterval(interval); return () => clearInterval(interval);
}, []); }, []);
return ( return <Base { ...rest }>{ getFriendlyTime() }</Base>;
<div { ...rest }>{ getFriendlyTime() }</div>
);
} }

View File

@ -1,7 +0,0 @@
import { DetailsHTMLAttributes } from 'react';
export interface FriendlyTimeViewProps extends DetailsHTMLAttributes<HTMLDivElement>
{
seconds: number;
isShort?: boolean;
}

View File

@ -1,5 +1,9 @@
import { FC } from 'react'; import { FC } from 'react';
import { ItemCountViewProps } from './ItemCountView.types';
interface ItemCountViewProps
{
count: number;
}
export const ItemCountView: FC<ItemCountViewProps> = props => export const ItemCountView: FC<ItemCountViewProps> = props =>
{ {

View File

@ -1,4 +0,0 @@
export interface ItemCountViewProps
{
count: number;
}

View File

@ -1,7 +1,19 @@
import { PetFigureData, TextureUtils, Vector3d } from '@nitrots/nitro-renderer'; import { PetCustomPart, PetFigureData, TextureUtils, Vector3d } from '@nitrots/nitro-renderer';
import { FC, useEffect, useRef, useState } from 'react'; import { FC, useEffect, useRef, useState } from 'react';
import { GetRoomEngine } from '../../../api'; import { GetRoomEngine } from '../../../api';
import { PetImageViewProps } from './PetImageView.types';
interface PetImageViewProps
{
figure?: string;
typeId?: number;
paletteId?: number;
color?: number;
customParts?: PetCustomPart[];
posture?: string;
headOnly?: boolean;
direction?: number;
scale?: number;
}
export const PetImageView: FC<PetImageViewProps> = props => export const PetImageView: FC<PetImageViewProps> = props =>
{ {

View File

@ -1,14 +0,0 @@
import { PetCustomPart } from '@nitrots/nitro-renderer';
export interface PetImageViewProps
{
figure?: string;
typeId?: number;
paletteId?: number;
color?: number;
customParts?: PetCustomPart[];
posture?: string;
headOnly?: boolean;
direction?: number;
scale?: number;
}

View File

@ -1,6 +1,10 @@
import { FC, useMemo } from 'react'; import { FC, useMemo } from 'react';
import { Base } from '../../../common/Base'; import { Base, BaseProps } from '../../../common';
import { RarityLevelViewProps } from './RarityLevelView.types';
interface RarityLevelViewProps extends BaseProps<HTMLDivElement>
{
level: number;
}
export const RarityLevelView: FC<RarityLevelViewProps> = props => export const RarityLevelView: FC<RarityLevelViewProps> = props =>
{ {

View File

@ -1,6 +0,0 @@
import { BaseProps } from '../../../common/Base';
export interface RarityLevelViewProps extends BaseProps<HTMLDivElement>
{
level: number;
}

View File

@ -1,7 +1,12 @@
import { ColorConverter, IRoomRenderingCanvas, TextureUtils } from '@nitrots/nitro-renderer'; import { ColorConverter, IRoomRenderingCanvas, RoomPreviewer, TextureUtils } from '@nitrots/nitro-renderer';
import { FC, useCallback, useEffect, useRef, useState } from 'react'; import { FC, useCallback, useEffect, useRef, useState } from 'react';
import { GetNitroInstance } from '../../../api'; import { GetNitroInstance } from '../../../api';
import { RoomPreviewerViewProps } from './RoomPreviewerView.types';
interface RoomPreviewerViewProps
{
roomPreviewer: RoomPreviewer;
height?: number;
}
export const RoomPreviewerView: FC<RoomPreviewerViewProps> = props => export const RoomPreviewerView: FC<RoomPreviewerViewProps> = props =>
{ {

View File

@ -1,7 +0,0 @@
import { RoomPreviewer } from '@nitrots/nitro-renderer';
export interface RoomPreviewerViewProps
{
roomPreviewer: RoomPreviewer;
height?: number;
}