mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-20 10:58:33 +00:00
fix: toggle metadata file
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
import React, { useCallback, useRef, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import ResizeBar from '../../../resize-bar';
|
import ResizeBar from '../../../resize-bar';
|
||||||
@@ -7,7 +7,8 @@ import { DRAG_HANDLER_HEIGHT } from '../../../resize-bar/constants';
|
|||||||
import './index.css';
|
import './index.css';
|
||||||
|
|
||||||
const Detail = ({ children, className }) => {
|
const Detail = ({ children, className }) => {
|
||||||
const [width, setWidth] = useState(300);
|
const lastSettingsValue = localStorage.getItem('sf_cur_view_detail_width');
|
||||||
|
const [width, setWidth] = useState(lastSettingsValue ? parseInt(lastSettingsValue) : 300);
|
||||||
const [isResizing, setResizing] = useState(false);
|
const [isResizing, setResizing] = useState(false);
|
||||||
const resizeBarRef = useRef(null);
|
const resizeBarRef = useRef(null);
|
||||||
const dragHandlerRef = useRef(null);
|
const dragHandlerRef = useRef(null);
|
||||||
@@ -42,12 +43,6 @@ const Detail = ({ children, className }) => {
|
|||||||
setDragHandlerTop(dragHandlerRefTop);
|
setDragHandlerTop(dragHandlerRefTop);
|
||||||
}, [setDragHandlerTop]);
|
}, [setDragHandlerTop]);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
const lastSettingsValue = localStorage.getItem('sf_cur_view_detail_width');
|
|
||||||
const width = lastSettingsValue ? parseInt(lastSettingsValue) : 300;
|
|
||||||
setWidth(width);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={classnames('cur-view-detail', className, {
|
className={classnames('cur-view-detail', className, {
|
||||||
|
Reference in New Issue
Block a user