mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 12:55:00 +00:00
@@ -78,7 +78,7 @@ const MobileTextValue = ({
|
||||
}: PropertyValueProps) => {
|
||||
const [open, setOpen] = useState(false);
|
||||
|
||||
const [tempValue, setTempValue] = useState<string>(value);
|
||||
const [tempValue, setTempValue] = useState<string>(value || '');
|
||||
const handleClick = useCallback((e: React.MouseEvent) => {
|
||||
e.stopPropagation();
|
||||
setOpen(true);
|
||||
@@ -111,20 +111,21 @@ const MobileTextValue = ({
|
||||
}, [onChange, tempValue]);
|
||||
const t = useI18n();
|
||||
useEffect(() => {
|
||||
setTempValue(value);
|
||||
setTempValue(value || '');
|
||||
}, [value]);
|
||||
|
||||
return (
|
||||
<PropertyValue
|
||||
className={styles.textPropertyValueContainer}
|
||||
onClick={handleClick}
|
||||
isEmpty={!value}
|
||||
>
|
||||
<div className={styles.mobileTextareaPlain} data-empty={!tempValue}>
|
||||
{tempValue ||
|
||||
t['com.affine.page-properties.property-value-placeholder']()}
|
||||
</div>
|
||||
|
||||
<>
|
||||
<PropertyValue
|
||||
className={styles.textPropertyValueContainer}
|
||||
onClick={handleClick}
|
||||
isEmpty={!value}
|
||||
>
|
||||
<div className={styles.mobileTextareaPlain} data-empty={!tempValue}>
|
||||
{tempValue ||
|
||||
t['com.affine.page-properties.property-value-placeholder']()}
|
||||
</div>
|
||||
</PropertyValue>
|
||||
<ConfigModal
|
||||
open={open}
|
||||
onOpenChange={setOpen}
|
||||
@@ -154,7 +155,7 @@ const MobileTextValue = ({
|
||||
</div>
|
||||
</div>
|
||||
</ConfigModal>
|
||||
</PropertyValue>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -44,9 +44,6 @@ export const ConfigModal = ({
|
||||
animation="slideBottom"
|
||||
withoutCloseButton
|
||||
contentOptions={{
|
||||
onClick: e => {
|
||||
e.stopPropagation();
|
||||
},
|
||||
className:
|
||||
variant === 'page'
|
||||
? styles.pageModalContent
|
||||
|
||||
@@ -64,7 +64,11 @@ export const SettingDropdownSelect = <
|
||||
))}
|
||||
{...menuOptions}
|
||||
>
|
||||
<div className={clsx(styles.root, className)} {...attrs}>
|
||||
<div
|
||||
data-testid="dropdown-select-trigger"
|
||||
className={clsx(styles.root, className)}
|
||||
{...attrs}
|
||||
>
|
||||
<span className={styles.label}>{selectedItem?.label ?? ''}</span>
|
||||
|
||||
<ArrowDownSmallIcon className={styles.icon} />
|
||||
|
||||
@@ -10,7 +10,10 @@ export const RowLayout = ({
|
||||
href,
|
||||
}: PropsWithChildren<{ label: ReactNode; href?: string }>) => {
|
||||
const content = (
|
||||
<ConfigModal.Row className={styles.baseSettingItem}>
|
||||
<ConfigModal.Row
|
||||
data-testid="setting-row"
|
||||
className={styles.baseSettingItem}
|
||||
>
|
||||
<div className={styles.baseSettingItemName}>{label}</div>
|
||||
<div className={styles.baseSettingItemAction}>
|
||||
{children ||
|
||||
|
||||
@@ -75,6 +75,7 @@ export const HomeHeader = () => {
|
||||
onClick={openSetting}
|
||||
size={28}
|
||||
icon={<SettingsIcon />}
|
||||
data-testid="settings-button"
|
||||
/>
|
||||
</SafeArea>
|
||||
</>
|
||||
|
||||
@@ -97,7 +97,8 @@ const MobileRichTextCell = ({
|
||||
const [open, setOpen] = useState(false);
|
||||
const name = useLiveData(cell.property.name$);
|
||||
return (
|
||||
<PropertyValue onClick={() => setOpen(true)}>
|
||||
<>
|
||||
<PropertyValue onClick={() => setOpen(true)}></PropertyValue>
|
||||
<ConfigModal
|
||||
onBack={() => setOpen(false)}
|
||||
open={open}
|
||||
@@ -125,7 +126,7 @@ const MobileRichTextCell = ({
|
||||
onChange={onChange}
|
||||
rowId={rowId}
|
||||
/>
|
||||
</PropertyValue>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user