mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-18 23:46:03 +01:00
feat(web/textui) bottom center position(#507)
This commit is contained in:
@@ -4,7 +4,7 @@ import { CSSProperties } from 'react';
|
|||||||
type IconAnimation = 'spin' | 'spinPulse' | 'spinReverse' | 'pulse' | 'beat' | 'fade' | 'beatFade' | 'bounce' | 'shake';
|
type IconAnimation = 'spin' | 'spinPulse' | 'spinReverse' | 'pulse' | 'beat' | 'fade' | 'beatFade' | 'bounce' | 'shake';
|
||||||
|
|
||||||
interface OptionsProps {
|
interface OptionsProps {
|
||||||
position?: 'right-center' | 'left-center' | 'top-center';
|
position?: 'right-center' | 'left-center' | 'top-center' | 'bottom-center';
|
||||||
icon?: IconName | [IconPrefix, IconName];
|
icon?: IconName | [IconPrefix, IconName];
|
||||||
iconColor?: string;
|
iconColor?: string;
|
||||||
iconAnimation?: IconAnimation;
|
iconAnimation?: IconAnimation;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
---@class TextUIOptions
|
---@class TextUIOptions
|
||||||
---@field position? 'right-center' | 'left-center' | 'top-center';
|
---@field position? 'right-center' | 'left-center' | 'top-center' | 'bottom-center';
|
||||||
---@field icon? string | {[1]: IconProp, [2]: string};
|
---@field icon? string | {[1]: IconProp, [2]: string};
|
||||||
---@field iconColor? string;
|
---@field iconColor? string;
|
||||||
---@field style? string | table;
|
---@field style? string | table;
|
||||||
|
|||||||
@@ -14,9 +14,12 @@ const useStyles = createStyles((theme, params: { position?: TextUiPosition }) =>
|
|||||||
width: '100%',
|
width: '100%',
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
alignItems: params.position === 'top-center' ? 'baseline' : 'center',
|
alignItems:
|
||||||
justifyContent:
|
params.position === 'top-center' ? 'baseline' :
|
||||||
params.position === 'right-center' ? 'flex-end' : params.position === 'left-center' ? 'flex-start' : 'center',
|
params.position === 'bottom-center' ? 'flex-end' : 'center',
|
||||||
|
justifyContent:
|
||||||
|
params.position === 'right-center' ? 'flex-end' :
|
||||||
|
params.position === 'left-center' ? 'flex-start' : 'center',
|
||||||
},
|
},
|
||||||
container: {
|
container: {
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { IconAnimation } from '../components/LibIcon';
|
import { IconAnimation } from '../components/LibIcon';
|
||||||
|
|
||||||
export type TextUiPosition = 'right-center' | 'left-center' | 'top-center';
|
export type TextUiPosition = 'right-center' | 'left-center' | 'top-center' | 'bottom-center';
|
||||||
|
|
||||||
export interface TextUiProps {
|
export interface TextUiProps {
|
||||||
text: string;
|
text: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user