mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-27 08:00:51 +01:00
Changes
This commit is contained in:
parent
d55958fef3
commit
653329fa6c
@ -1,5 +1,10 @@
|
||||
import { FC } from 'react';
|
||||
import { BadgeInformationViewProps } from './BadgeInformationView.types';
|
||||
|
||||
interface BadgeInformationViewProps
|
||||
{
|
||||
title: string;
|
||||
description: string;
|
||||
}
|
||||
|
||||
export const BadgeInformationView: FC<BadgeInformationViewProps> = props =>
|
||||
{
|
||||
|
@ -1,5 +0,0 @@
|
||||
export interface BadgeInformationViewProps
|
||||
{
|
||||
title: string;
|
||||
description: string;
|
||||
}
|
@ -1,16 +1,19 @@
|
||||
import { FriendlyTime } from '@nitrots/nitro-renderer';
|
||||
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 =>
|
||||
{
|
||||
const { seconds = 0, isShort = false, ...rest } = props;
|
||||
const { seconds = 0, isShort = false, children = null, ...rest } = props;
|
||||
const [ updateId, setUpdateId ] = useState(-1);
|
||||
|
||||
const getStartSeconds = useMemo(() =>
|
||||
{
|
||||
return (Math.round(new Date().getSeconds()) - seconds);
|
||||
}, [ seconds ]);
|
||||
const getStartSeconds = useMemo(() => (Math.round(new Date().getSeconds()) - seconds), [ seconds ]);
|
||||
|
||||
const getFriendlyTime = useCallback(() =>
|
||||
{
|
||||
@ -28,7 +31,5 @@ export const FriendlyTimeView: FC<FriendlyTimeViewProps> = props =>
|
||||
return () => clearInterval(interval);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div { ...rest }>{ getFriendlyTime() }</div>
|
||||
);
|
||||
return <Base { ...rest }>{ getFriendlyTime() }</Base>;
|
||||
}
|
||||
|
@ -1,7 +0,0 @@
|
||||
import { DetailsHTMLAttributes } from 'react';
|
||||
|
||||
export interface FriendlyTimeViewProps extends DetailsHTMLAttributes<HTMLDivElement>
|
||||
{
|
||||
seconds: number;
|
||||
isShort?: boolean;
|
||||
}
|
@ -1,5 +1,9 @@
|
||||
import { FC } from 'react';
|
||||
import { ItemCountViewProps } from './ItemCountView.types';
|
||||
|
||||
interface ItemCountViewProps
|
||||
{
|
||||
count: number;
|
||||
}
|
||||
|
||||
export const ItemCountView: FC<ItemCountViewProps> = props =>
|
||||
{
|
||||
|
@ -1,4 +0,0 @@
|
||||
export interface ItemCountViewProps
|
||||
{
|
||||
count: number;
|
||||
}
|
@ -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 { 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 =>
|
||||
{
|
||||
|
@ -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;
|
||||
}
|
@ -1,6 +1,10 @@
|
||||
import { FC, useMemo } from 'react';
|
||||
import { Base } from '../../../common/Base';
|
||||
import { RarityLevelViewProps } from './RarityLevelView.types';
|
||||
import { Base, BaseProps } from '../../../common';
|
||||
|
||||
interface RarityLevelViewProps extends BaseProps<HTMLDivElement>
|
||||
{
|
||||
level: number;
|
||||
}
|
||||
|
||||
export const RarityLevelView: FC<RarityLevelViewProps> = props =>
|
||||
{
|
||||
|
@ -1,6 +0,0 @@
|
||||
import { BaseProps } from '../../../common/Base';
|
||||
|
||||
export interface RarityLevelViewProps extends BaseProps<HTMLDivElement>
|
||||
{
|
||||
level: number;
|
||||
}
|
@ -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 { GetNitroInstance } from '../../../api';
|
||||
import { RoomPreviewerViewProps } from './RoomPreviewerView.types';
|
||||
|
||||
interface RoomPreviewerViewProps
|
||||
{
|
||||
roomPreviewer: RoomPreviewer;
|
||||
height?: number;
|
||||
}
|
||||
|
||||
export const RoomPreviewerView: FC<RoomPreviewerViewProps> = props =>
|
||||
{
|
||||
|
@ -1,7 +0,0 @@
|
||||
import { RoomPreviewer } from '@nitrots/nitro-renderer';
|
||||
|
||||
export interface RoomPreviewerViewProps
|
||||
{
|
||||
roomPreviewer: RoomPreviewer;
|
||||
height?: number;
|
||||
}
|
Loading…
Reference in New Issue
Block a user