This commit is contained in:
Bill 2022-01-12 23:47:12 -05:00
parent 5d4ab54c8c
commit 783f805907
4 changed files with 32 additions and 19 deletions

View File

@ -123,7 +123,7 @@ export class NotificationUtilities
dispatchUiEvent(new NotificationConfirmEvent(type, this.cleanText(message), onConfirm, onCancel, confirmText, cancelText, title)); dispatchUiEvent(new NotificationConfirmEvent(type, this.cleanText(message), onConfirm, onCancel, confirmText, cancelText, title));
} }
public static simpleAlert(message: string, type: string, clickUrl: string = null, clickUrlText: string = null, title: string = null, imageUrl: string = null): void public static simpleAlert(message: string, type: string = null, clickUrl: string = null, clickUrlText: string = null, title: string = null, imageUrl: string = null): void
{ {
if(!title || !title.length) title = LocalizeText('notifications.broadcast.title'); if(!title || !title.length) title = LocalizeText('notifications.broadcast.title');

View File

@ -1,17 +1,13 @@
.nitro-room-tools { .nitro-room-tools {
position: absolute; position: absolute;
bottom: 125px; bottom: $toolbar-height + 65px;
left: -145px; left: 0;
background: rgba($dark,.95); background: rgba($dark,.95);
box-shadow: inset 0px 5px lighten(rgba($dark,.6),2.5), inset 0 -4px darken(rgba($dark,.6),4); box-shadow: inset 0px 5px lighten(rgba($dark,.6),2.5), inset 0 -4px darken(rgba($dark,.6),4);
border-top-right-radius: $border-radius; border-top-right-radius: $border-radius;
border-bottom-right-radius: $border-radius; border-bottom-right-radius: $border-radius;
transition: all .2s ease; transition: all .2s ease;
&.open {
left: 0px;
}
.list-group-item { .list-group-item {
background: transparent; background: transparent;
padding: 3px 0px; padding: 3px 0px;

View File

@ -1,10 +1,24 @@
import { FC, useMemo } from 'react'; import { CSSProperties, FC, useMemo } from 'react';
import { GetConfiguration } from '../../../api'; import { GetConfiguration } from '../../../api';
import { CurrencyIconProps } from './CurrencyIcon.types'; import { Base, BaseProps } from '../../../common/Base';
export interface CurrencyIconProps extends BaseProps<HTMLDivElement>
{
type: number | string;
}
export const CurrencyIcon: FC<CurrencyIconProps> = props => export const CurrencyIcon: FC<CurrencyIconProps> = props =>
{ {
const { type = '', className = '', style = {}, ...rest } = props; const { type = '', classNames = [], style = {}, ...rest } = props;
const getClassNames = useMemo(() =>
{
const newClassNames: string[] = [ 'nitro-currency-icon' ];
if(classNames.length) newClassNames.push(...classNames);
return newClassNames;
}, [ classNames ]);
const urlString = useMemo(() => const urlString = useMemo(() =>
{ {
@ -15,7 +29,16 @@ export const CurrencyIcon: FC<CurrencyIconProps> = props =>
return `url(${ url })`; return `url(${ url })`;
}, [ type ]); }, [ type ]);
return ( const getStyle = useMemo(() =>
<div className={ 'nitro-currency-icon ' + className } style={ { ...style, backgroundImage: urlString } } { ...rest } /> {
); let newStyle: CSSProperties = {};
newStyle.backgroundImage = urlString;
if(Object.keys(style).length) newStyle = { ...newStyle, ...style };
return newStyle;
}, [ style, urlString ]);
return <Base classNames={ getClassNames } style={ getStyle } { ...rest } />
} }

View File

@ -1,6 +0,0 @@
import { DetailsHTMLAttributes } from 'react';
export interface CurrencyIconProps extends DetailsHTMLAttributes<HTMLDivElement>
{
type: number | string;
}