Typing
This commit is contained in:
@@ -27,7 +27,7 @@ export function Settings() {
|
||||
const { tabValue } = useParams();
|
||||
return (
|
||||
<Stack h={'100%'} gap={0}>
|
||||
<Group pos={'relative'} gap={0} pb={'1rem'}>
|
||||
<Group gap={0} style={{ position: 'relative', paddingBottom: '1rem' }}>
|
||||
<ActionIcon
|
||||
className={actionIconClasses.backButton}
|
||||
classNames={actionIconClasses}
|
||||
@@ -51,9 +51,6 @@ export function Settings() {
|
||||
onChange={(value) =>
|
||||
navigate(`/${import.meta.env.VITE_BASE_URL}/settings/${value}`)
|
||||
}
|
||||
style={{
|
||||
overflow: 'hidden',
|
||||
}}
|
||||
>
|
||||
<Tabs.List style={{ justifyContent: isMobile ? 'space-between' : undefined }}>
|
||||
<Tabs.Tab px={isMobile ? '.9rem' : undefined} value='personalization'>
|
||||
|
||||
@@ -45,7 +45,7 @@ const ApplicationSettings = () => {
|
||||
});
|
||||
const [applicationData, setApplicationData] = useState<Application[]>([]);
|
||||
const [applicationList, setApplicationList] = useState<Application[]>([]);
|
||||
const { theme, isMobile } = useCommonHooks();
|
||||
const { theme, isMobile, reorder } = useCommonHooks();
|
||||
const [newApplication, setNewApplication] = useState<Application>(defaultApplication);
|
||||
const { mutateAsync } = useMutationAPI();
|
||||
const [searchValue, setSearchValue] = useState('');
|
||||
@@ -53,13 +53,6 @@ const ApplicationSettings = () => {
|
||||
const [dragging, setDragging] = useState(false);
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
|
||||
const reorder = (list: any, startIndex: any, endIndex: any) => {
|
||||
const result = Array.from(list);
|
||||
const [removed]: any = result.splice(startIndex, 1);
|
||||
result.splice(endIndex, 0, removed);
|
||||
return result;
|
||||
};
|
||||
|
||||
function onDragEnd(result: any) {
|
||||
if (!result.destination) {
|
||||
return;
|
||||
|
||||
@@ -28,19 +28,12 @@ const BookmarkSettings = () => {
|
||||
const [groups, setGroups] = useState<BookmarkGroup[]>([]);
|
||||
const [newGroup, setNewGroup] = useState<BookmarkGroup>(defaultGroup);
|
||||
const [groupList, setGroupList] = useState<BookmarkGroup[]>([]);
|
||||
const { theme, isMobile } = useCommonHooks();
|
||||
const { theme, isMobile, reorder } = useCommonHooks();
|
||||
const { mutateAsync } = useMutationAPI();
|
||||
const [searchValue, setSearchValue] = useState('');
|
||||
const [debouncedGroupSearch] = useDebouncedValue(searchValue, 500);
|
||||
const [modalOpened, { open: openModal, close: closeModal }] = useDisclosure(false);
|
||||
|
||||
const reorder = (list: any, startIndex: any, endIndex: any) => {
|
||||
const result = Array.from(list);
|
||||
const [removed]: any = result.splice(startIndex, 1);
|
||||
result.splice(endIndex, 0, removed);
|
||||
return result;
|
||||
};
|
||||
|
||||
const handleClose = () => {
|
||||
setNewGroup(defaultGroup);
|
||||
closeModal();
|
||||
|
||||
@@ -27,7 +27,7 @@ function DebouncedGroupSettingsItem({
|
||||
bookmarks,
|
||||
searchTerm,
|
||||
}: { bookmarkGroup: BookmarkGroup; bookmarks: Bookmark[]; searchTerm: string }) {
|
||||
const { theme, isMobile, handleDelete } = useCommonHooks();
|
||||
const { theme, isMobile, handleDelete, reorder } = useCommonHooks();
|
||||
const [modalOpened, { open: openModal, close: closeModal }] = useDisclosure(false);
|
||||
const [popoverOpened, setPopoverOpened] = useState(false);
|
||||
const { mutateAsync } = useMutationAPI();
|
||||
@@ -44,12 +44,6 @@ function DebouncedGroupSettingsItem({
|
||||
const [bookmarkList, setBookmarkList] = useState<Bookmark[]>(bookmarks);
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
|
||||
const reorder = (list: any, startIndex: any, endIndex: any) => {
|
||||
const result = Array.from(list);
|
||||
const [removed]: any = result.splice(startIndex, 1);
|
||||
result.splice(endIndex, 0, removed);
|
||||
return result;
|
||||
};
|
||||
function onDragEnd(result: any) {
|
||||
if (!result.destination) {
|
||||
return;
|
||||
|
||||
@@ -62,7 +62,10 @@ const PersonalizationSettings = () => {
|
||||
setSearchValue={() => {}}
|
||||
searchPlaceholder={undefined}
|
||||
/>
|
||||
<Stack mt={'6rem'} mb={'1rem'} w={'100%'} align='center'>
|
||||
<Stack
|
||||
align='center'
|
||||
style={{ marginTop: '6rem', marginBottom: '1rem', width: '100%' }}
|
||||
>
|
||||
<Grid w={'75%'} pos={'relative'}>
|
||||
{personalIsFetching && (
|
||||
<Overlay
|
||||
|
||||
Reference in New Issue
Block a user