Mobile and style improvements
This commit is contained in:
@@ -21,6 +21,7 @@ import { FiHelpCircle, FiPlus } from 'react-icons/fi';
|
||||
import {
|
||||
actionIconClasses,
|
||||
buttonClasses,
|
||||
cardClasses,
|
||||
modalClasses,
|
||||
textClasses,
|
||||
textInputClasses,
|
||||
@@ -125,65 +126,67 @@ const BookmarkSettings = () => {
|
||||
<Modal.CloseButton />
|
||||
</Modal.Header>
|
||||
<Modal.Body pb={'2rem'}>
|
||||
<Stack gap={0} w={'100%'} align='center'>
|
||||
<Group w={'100%'} justify='center'>
|
||||
<TextInput
|
||||
label={'Category Name'}
|
||||
className={textInputClasses.settingsItem}
|
||||
pt={16}
|
||||
classNames={textInputClasses}
|
||||
defaultValue={newGroup.categoryName}
|
||||
onChange={(event) => {
|
||||
setNewGroup({
|
||||
...newGroup,
|
||||
categoryName: event.target.value,
|
||||
});
|
||||
}}
|
||||
/>
|
||||
<TextInput
|
||||
label={'Filter Name'}
|
||||
className={textInputClasses.settingsItem}
|
||||
pt={16}
|
||||
classNames={textInputClasses}
|
||||
defaultValue={newGroup.filterName}
|
||||
onChange={(event) => {
|
||||
setNewGroup({
|
||||
...newGroup,
|
||||
filterName: event.target.value,
|
||||
});
|
||||
}}
|
||||
/>
|
||||
</Group>
|
||||
|
||||
<Divider color='black' my='sm' />
|
||||
<Group pos={'absolute'} bottom={8}>
|
||||
<Button
|
||||
color={'green'}
|
||||
styles={{ label: { color: 'black' } }}
|
||||
onClick={() => {
|
||||
if (newGroup) {
|
||||
mutateAsync({
|
||||
method: 'POST',
|
||||
endpoint: 'api/categories',
|
||||
body: { ...newGroup, categoryIndex: groups.length },
|
||||
<Card className={cardClasses.settingsItem} classNames={cardClasses}>
|
||||
<Stack gap={0} w={'100%'} align='center'>
|
||||
<Group w={'100%'} justify='center'>
|
||||
<TextInput
|
||||
label={'Category Name'}
|
||||
className={textInputClasses.settingsItem}
|
||||
pt={16}
|
||||
classNames={textInputClasses}
|
||||
defaultValue={newGroup.categoryName}
|
||||
onChange={(event) => {
|
||||
setNewGroup({
|
||||
...newGroup,
|
||||
categoryName: event.target.value,
|
||||
});
|
||||
}}
|
||||
/>
|
||||
<TextInput
|
||||
label={'Filter Name'}
|
||||
className={textInputClasses.settingsItem}
|
||||
pt={16}
|
||||
classNames={textInputClasses}
|
||||
defaultValue={newGroup.filterName}
|
||||
onChange={(event) => {
|
||||
setNewGroup({
|
||||
...newGroup,
|
||||
filterName: event.target.value,
|
||||
});
|
||||
}}
|
||||
/>
|
||||
</Group>
|
||||
|
||||
<Divider color='black' my='lg' />
|
||||
<Group pos={'absolute'} bottom={8}>
|
||||
<Button
|
||||
color={'green'}
|
||||
styles={{ label: { color: 'black' } }}
|
||||
onClick={() => {
|
||||
if (newGroup) {
|
||||
mutateAsync({
|
||||
method: 'POST',
|
||||
endpoint: 'api/categories',
|
||||
body: { ...newGroup, categoryIndex: groups.length },
|
||||
});
|
||||
closeModal();
|
||||
}
|
||||
}}
|
||||
>
|
||||
Save
|
||||
</Button>
|
||||
<Button
|
||||
color={'red'}
|
||||
styles={{ label: { color: 'black' } }}
|
||||
onClick={() => {
|
||||
closeModal();
|
||||
}
|
||||
}}
|
||||
>
|
||||
Save
|
||||
</Button>
|
||||
<Button
|
||||
color={'red'}
|
||||
styles={{ label: { color: 'black' } }}
|
||||
onClick={() => {
|
||||
closeModal();
|
||||
}}
|
||||
>
|
||||
Cancel
|
||||
</Button>
|
||||
</Group>
|
||||
</Stack>
|
||||
}}
|
||||
>
|
||||
Cancel
|
||||
</Button>
|
||||
</Group>
|
||||
</Stack>
|
||||
</Card>
|
||||
</Modal.Body>
|
||||
</Modal.Content>
|
||||
</Modal.Root>
|
||||
@@ -253,7 +256,7 @@ const BookmarkSettings = () => {
|
||||
pos={isMobile ? undefined : 'absolute'}
|
||||
className={textInputClasses.settingsItem}
|
||||
classNames={textInputClasses}
|
||||
autoFocus
|
||||
autoFocus={!isMobile}
|
||||
placeholder='Search...'
|
||||
value={searchValue}
|
||||
onInput={(event: any) => {
|
||||
@@ -261,16 +264,23 @@ const BookmarkSettings = () => {
|
||||
}}
|
||||
/>
|
||||
<Switch
|
||||
label={'Reorder'}
|
||||
label={<Text c={theme.primaryColor}>Reorder</Text>}
|
||||
labelPosition='left'
|
||||
pos={'absolute'}
|
||||
right={isMobile ? '2rem' : '1rem'}
|
||||
top={isMobile ? '9.5rem' : undefined}
|
||||
top={isMobile ? '10rem' : undefined}
|
||||
onChange={(e) => {
|
||||
setDragging(e.target.checked);
|
||||
}}
|
||||
color={theme.primaryColor}
|
||||
styles={{ label: { color: theme.primaryColor } }}
|
||||
styles={{
|
||||
label: {
|
||||
color: theme.primaryColor,
|
||||
top: isMobile ? -22 : 0,
|
||||
left: isMobile ? -8 : 0,
|
||||
position: isMobile ? 'absolute' : undefined,
|
||||
},
|
||||
}}
|
||||
/>
|
||||
</Group>
|
||||
{dragging ? (
|
||||
@@ -352,7 +362,7 @@ const BookmarkSettings = () => {
|
||||
</DragDropContext>
|
||||
) : (
|
||||
<Stack w={'100%'} align='center'>
|
||||
<Group w={'75%'} align='start'>
|
||||
<Group w={isMobile ? undefined : '75%'} align='start'>
|
||||
{groups?.map((group: BookmarkGroup) => (
|
||||
<DebouncedGroupSettingsItem
|
||||
key={group.id}
|
||||
|
||||
Reference in New Issue
Block a user