Standardized
This commit is contained in:
@@ -11,7 +11,7 @@ const ApplicationSettings = () => {
|
||||
isFetching: isAppsFetching,
|
||||
isLoading: isAppsLoading,
|
||||
} = useQueryAPI({
|
||||
endpoint: 'api/apps',
|
||||
endpoint: endpoint,
|
||||
});
|
||||
const [applicationData, setApplicationData] = useState<any>([]);
|
||||
|
||||
|
||||
@@ -11,14 +11,14 @@ const BookmarkSettings = () => {
|
||||
isFetching: linksIsFetching,
|
||||
isLoading: linksIsLoading,
|
||||
} = useQueryAPI({
|
||||
endpoint: 'api/links',
|
||||
endpoint: endpoint,
|
||||
});
|
||||
const { data: groupData, isFetched: groupsIsFetched } = useQueryAPI({
|
||||
endpoint: 'api/categories',
|
||||
});
|
||||
const [bookmarkData, setBookmarkData] = useState<any>([]);
|
||||
|
||||
const [groups, setGroups] = useState([]);
|
||||
|
||||
useEffect(() => {
|
||||
if (linkData && linksIsFetched) {
|
||||
setBookmarkData(linkData);
|
||||
|
||||
@@ -13,7 +13,6 @@ const CategorySettings = () => {
|
||||
} = useQueryAPI({
|
||||
endpoint: endpoint,
|
||||
});
|
||||
|
||||
const [groups, setGroups] = useState([]);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -24,6 +23,7 @@ const CategorySettings = () => {
|
||||
setGroups(groupList);
|
||||
}
|
||||
}, [groupData, groupsIsFetched]);
|
||||
|
||||
return (
|
||||
<Stack>
|
||||
<Text className={textClasses.settingsSubTitle} classNames={textClasses}>
|
||||
|
||||
@@ -20,6 +20,7 @@ const MessageSettings = () => {
|
||||
setMessages(messageData);
|
||||
}
|
||||
}, [messageData, isMessagesFetched]);
|
||||
|
||||
return (
|
||||
<Stack>
|
||||
<Text className={textClasses.settingsSubTitle} classNames={textClasses}>
|
||||
|
||||
@@ -14,11 +14,13 @@ const PersonalizationSettings = () => {
|
||||
endpoint: endpoint,
|
||||
});
|
||||
const [personal, setPersonal] = useState<any>([]);
|
||||
|
||||
useEffect(() => {
|
||||
if (personalData && personalIsFetched) {
|
||||
setPersonal(personalData);
|
||||
}
|
||||
}, [personalData, personalIsFetched]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Text className={textClasses.settingsSubTitle} classNames={textClasses}>
|
||||
|
||||
@@ -14,7 +14,6 @@ const SearchProviderSettings = () => {
|
||||
} = useQueryAPI({
|
||||
endpoint: endpoint,
|
||||
});
|
||||
|
||||
const [providerData, setProviderData] = useState<any>([]);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@@ -14,6 +14,7 @@ function ThemeCard({
|
||||
const [hover, setHover] = useState(false);
|
||||
const [shift, setShift] = useState<number>(0);
|
||||
const { handleThemeChange, currentTheme, setCurrentTheme, theme } = useCommonHooks();
|
||||
|
||||
return (
|
||||
<Group
|
||||
gap={0}
|
||||
|
||||
@@ -33,6 +33,7 @@ function ThemeModal({
|
||||
handleSaveTheme,
|
||||
}: any) {
|
||||
const { theme } = useCommonHooks();
|
||||
|
||||
return (
|
||||
<Modal.Root
|
||||
size={'50%'}
|
||||
|
||||
@@ -6,6 +6,7 @@ import { stackClasses } from 'styles';
|
||||
export default function ThemeModalContent({ selectedTheme }: any) {
|
||||
const ExampleApp = (previewTheme: any) => {
|
||||
const [textDecoration, setTextDecoration] = useState<string>('none');
|
||||
|
||||
return (
|
||||
<Box
|
||||
component='a'
|
||||
@@ -69,6 +70,7 @@ export default function ThemeModalContent({ selectedTheme }: any) {
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<Stack
|
||||
style={{
|
||||
|
||||
@@ -16,23 +16,15 @@ function ThemesSettings() {
|
||||
const { data: backgroundData, isFetched: isBackgroundFetched } = useQueryAPI({
|
||||
endpoint: 'api/backgrounds',
|
||||
});
|
||||
const [opened, { open, close }] = useDisclosure(false);
|
||||
const [pickerOpen, { open: openPicker, close: closePicker }] = useDisclosure(false);
|
||||
const [colorId, setColorId] = useState<string>('');
|
||||
const [colorValue, setColorValue] = useState('#000000');
|
||||
|
||||
const [backgroundList, setBackgroundList] = useState<any>(['None']);
|
||||
const [selectedTheme, setSelectedTheme] = useState<any>({});
|
||||
const { mutateAsync: createTheme } = useMutationAPI();
|
||||
const { mutateAsync: deleteTheme } = useMutationAPI();
|
||||
|
||||
const { currentTheme, setCurrentTheme, isMobile, theme } = useCommonHooks();
|
||||
|
||||
useEffect(() => {
|
||||
if (backgroundData && isBackgroundFetched) {
|
||||
setBackgroundList(['None', ...backgroundData]);
|
||||
}
|
||||
}, [backgroundData, isBackgroundFetched]);
|
||||
const [opened, { open, close }] = useDisclosure(false);
|
||||
const [colorId, setColorId] = useState<string>('');
|
||||
const [colorValue, setColorValue] = useState('#000000');
|
||||
const [backgroundList, setBackgroundList] = useState<any>(['None']);
|
||||
const [selectedTheme, setSelectedTheme] = useState<any>({});
|
||||
const [pickerOpen, { open: openPicker, close: closePicker }] = useDisclosure(false);
|
||||
const { currentTheme, setCurrentTheme, theme } = useCommonHooks();
|
||||
|
||||
const handleOpen = (theme: any) => {
|
||||
setSelectedTheme(theme);
|
||||
@@ -66,6 +58,12 @@ function ThemesSettings() {
|
||||
openDeleteConfirmModal(theme);
|
||||
close();
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (backgroundData && isBackgroundFetched) {
|
||||
setBackgroundList(['None', ...backgroundData]);
|
||||
}
|
||||
}, [backgroundData, isBackgroundFetched]);
|
||||
return (
|
||||
<>
|
||||
<ThemeModal
|
||||
|
||||
Reference in New Issue
Block a user