Compare commits
2 Commits
ff752985c6
...
3f252a8abd
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3f252a8abd | ||
|
|
0740072a60 |
@@ -2,6 +2,7 @@ import type { AnyFieldMeta } from '@tanstack/react-form';
|
|||||||
import { LucideEye, LucideEyeClosed } from 'lucide-react';
|
import { LucideEye, LucideEyeClosed } from 'lucide-react';
|
||||||
import { useCallback, useId, useState } from 'react';
|
import { useCallback, useId, useState } from 'react';
|
||||||
import { InfoIcon, type InfoIconProps } from '../info';
|
import { InfoIcon, type InfoIconProps } from '../info';
|
||||||
|
import { Text } from '@radix-ui/themes';
|
||||||
|
|
||||||
export type TextFieldProps = {
|
export type TextFieldProps = {
|
||||||
label?: string;
|
label?: string;
|
||||||
@@ -32,6 +33,11 @@ export function TextField({ label, value, onChange, labelProps, labelDivProps, s
|
|||||||
{label && (
|
{label && (
|
||||||
<div style={{ fontSize: 12, color: 'var(--gray-9)', marginBottom: 6, display: 'flex', alignItems: 'center' }} {...labelDivProps}>
|
<div style={{ fontSize: 12, color: 'var(--gray-9)', marginBottom: 6, display: 'flex', alignItems: 'center' }} {...labelDivProps}>
|
||||||
{label}
|
{label}
|
||||||
|
{rest?.required && (
|
||||||
|
<Text size="3" style={{ color: 'var(--red-9)', marginLeft: 2 }}>
|
||||||
|
*
|
||||||
|
</Text>
|
||||||
|
)}
|
||||||
{infoIconProps && <InfoIcon {...infoIconProps} style={{ marginLeft: 4, verticalAlign: 'middle' }} />}
|
{infoIconProps && <InfoIcon {...infoIconProps} style={{ marginLeft: 4, verticalAlign: 'middle' }} />}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ export function useQueryMessage(
|
|||||||
|
|
||||||
messageStr.current = queryMessageString;
|
messageStr.current = queryMessageString;
|
||||||
if (displayMessages) {
|
if (displayMessages) {
|
||||||
toast[queryMessage.type](queryMessage.code, {
|
toast[queryMessage.type](queryMessage.message, {
|
||||||
position: 'top-center',
|
position: 'top-center',
|
||||||
autoClose: 5000,
|
autoClose: 5000,
|
||||||
hideProgressBar: false,
|
hideProgressBar: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user