mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-23 14:40:50 +01:00
Update layout
This commit is contained in:
parent
bbcf8bae96
commit
91ff5d4c66
@ -3,7 +3,7 @@ import { NitroLayoutBaseProps } from './NitroLayoutBase.types';
|
|||||||
|
|
||||||
export const NitroLayoutBase: FC<NitroLayoutBaseProps> = props =>
|
export const NitroLayoutBase: FC<NitroLayoutBaseProps> = props =>
|
||||||
{
|
{
|
||||||
const { className = '', overflow = null, position = null, gap = null, children = null, ...rest } = props;
|
const { className = '', overflow = null, position = null, gap = null, ref = null, innerRef = null, children = null, ...rest } = props;
|
||||||
|
|
||||||
const getClassName = useMemo(() =>
|
const getClassName = useMemo(() =>
|
||||||
{
|
{
|
||||||
@ -21,7 +21,7 @@ export const NitroLayoutBase: FC<NitroLayoutBaseProps> = props =>
|
|||||||
}, [ className, overflow, position, gap ]);
|
}, [ className, overflow, position, gap ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={ getClassName } { ...rest }>
|
<div className={ getClassName } ref={ innerRef } { ...rest }>
|
||||||
{ children }
|
{ children }
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import { DetailedHTMLProps, HTMLAttributes } from 'react';
|
import { DetailedHTMLProps, HTMLAttributes, LegacyRef } from 'react';
|
||||||
import { NitroLayoutOverflow, NitroLayoutPosition, NitroLayoutSpacing } from '../common';
|
import { NitroLayoutOverflow, NitroLayoutPosition, NitroLayoutSpacing } from '../common';
|
||||||
|
|
||||||
export interface NitroLayoutBaseProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>
|
export interface NitroLayoutBaseProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>
|
||||||
{
|
{
|
||||||
|
innerRef?: LegacyRef<HTMLDivElement>;
|
||||||
overflow?: NitroLayoutOverflow;
|
overflow?: NitroLayoutOverflow;
|
||||||
position?: NitroLayoutPosition;
|
position?: NitroLayoutPosition;
|
||||||
gap?: NitroLayoutSpacing;
|
gap?: NitroLayoutSpacing;
|
||||||
|
@ -3,12 +3,10 @@
|
|||||||
&.active {
|
&.active {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background: rgba($white, 0.5);
|
background: rgba($white, 0.5);
|
||||||
|
border-bottom: 1px solid rgba($black, 0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.nitro-card-accordion-set-header {
|
.nitro-card-accordion-set-header {
|
||||||
border-bottom: 1px solid rgba($black, 0.2);
|
border-bottom: 1px solid rgba($black, 0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.nitro-card-accordion-set-content {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
export type NitroLayoutVariant = 'primary' | 'success' | 'danger' | 'secondary';
|
export type NitroLayoutVariant = 'primary' | 'success' | 'danger' | 'secondary' | 'link' | 'black';
|
||||||
|
@ -14,3 +14,4 @@ export * from './notification-alert';
|
|||||||
export * from './notification-bubble';
|
export * from './notification-bubble';
|
||||||
export * from './transitions';
|
export * from './transitions';
|
||||||
export * from './trophy';
|
export * from './trophy';
|
||||||
|
export * from './user-profile-icon';
|
||||||
|
26
src/layout/user-profile-icon/UserProfileIconView.tsx
Normal file
26
src/layout/user-profile-icon/UserProfileIconView.tsx
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
import { FC, useMemo } from 'react';
|
||||||
|
import { GetUserProfile } from '../../api';
|
||||||
|
import { NitroLayoutBase } from '../base';
|
||||||
|
import { UserProfileIconViewProps } from './UserProfileIconView.types';
|
||||||
|
|
||||||
|
export const UserProfileIconView: FC<UserProfileIconViewProps> = props =>
|
||||||
|
{
|
||||||
|
const { userId = 0, userName = null } = props;
|
||||||
|
|
||||||
|
const { className = '', children = null, ...rest } = props;
|
||||||
|
|
||||||
|
const getClassName = useMemo(() =>
|
||||||
|
{
|
||||||
|
let newClassName = 'nitro-friends-spritesheet icon-profile-sm me-1 cursor-pointer';
|
||||||
|
|
||||||
|
if(className && className.length) newClassName += ` ${ className }`;
|
||||||
|
|
||||||
|
return newClassName;
|
||||||
|
}, [ className ]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<NitroLayoutBase className={ getClassName } onClick={ event => GetUserProfile(userId) }>
|
||||||
|
{ children }
|
||||||
|
</NitroLayoutBase>
|
||||||
|
);
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
import { NitroLayoutBaseProps } from '../base';
|
||||||
|
|
||||||
|
export interface UserProfileIconViewProps extends NitroLayoutBaseProps
|
||||||
|
{
|
||||||
|
userId?: number;
|
||||||
|
userName?: string;
|
||||||
|
}
|
2
src/layout/user-profile-icon/index.ts
Normal file
2
src/layout/user-profile-icon/index.ts
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
export * from './UserProfileIconView';
|
||||||
|
export * from './UserProfileIconView.types';
|
@ -1,18 +1,13 @@
|
|||||||
.nitro-chat-history
|
.nitro-chat-history {
|
||||||
{
|
width: $chat-history-width;
|
||||||
width: 300px;
|
height: $chat-history-height;
|
||||||
|
|
||||||
.chat-history-content
|
.chat-history-content {
|
||||||
{
|
.chat-history-container {
|
||||||
|
|
||||||
.chat-history-container
|
|
||||||
{
|
|
||||||
min-height: 200px;
|
min-height: 200px;
|
||||||
|
|
||||||
.chat-history-list
|
.chat-history-list {
|
||||||
{
|
.chathistory-entry {
|
||||||
.chathistory-entry
|
|
||||||
{
|
|
||||||
.light {
|
.light {
|
||||||
background-color: #121f27;
|
background-color: #121f27;
|
||||||
}
|
}
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
import { FC } from 'react';
|
|
||||||
import { GetUserProfile } from '../../../api';
|
|
||||||
import { UserProfileIconViewProps } from './UserProfileIconView.types';
|
|
||||||
|
|
||||||
export const UserProfileIconView: FC<UserProfileIconViewProps> = props =>
|
|
||||||
{
|
|
||||||
const { userId = 0, userName = null } = props;
|
|
||||||
|
|
||||||
return (<>
|
|
||||||
<i className="icon icon-user-profile me-1 cursor-pointer" onClick={ () => GetUserProfile(userId) } />
|
|
||||||
</>);
|
|
||||||
}
|
|
@ -1,5 +0,0 @@
|
|||||||
export interface UserProfileIconViewProps
|
|
||||||
{
|
|
||||||
userId?: number;
|
|
||||||
userName?: string;
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user