Mobile improvements and packages updates
This commit is contained in:
@@ -280,16 +280,20 @@ export default function Search({
|
||||
const [showFillButton, setShowFillButton] = useState(false);
|
||||
if (item.option.searchTerm !== undefined) {
|
||||
const m = new Date(item.option.dateTimeStamp);
|
||||
const year = m.getUTCFullYear();
|
||||
const year = `${m.getUTCFullYear()}`.slice(-2);
|
||||
const month = `0${m.getUTCMonth() + 1}`.slice(-2);
|
||||
const day = `0${m.getUTCDate()}`.slice(-2);
|
||||
const hours = `0${m.getUTCHours()}`.slice(-2);
|
||||
const minutes = `0${m.getUTCMinutes()}`.slice(-2);
|
||||
const seconds = `0${m.getUTCSeconds()}`.slice(-2);
|
||||
const dateString = `${year}/${month}/${day} ${hours}:${minutes}:${seconds}`;
|
||||
const dateString = isMobile
|
||||
? `${month}/${day}/${year}`
|
||||
: `${month}/${day}/${year} ${hours}:${minutes}`;
|
||||
return (
|
||||
<Group
|
||||
w={'100%'}
|
||||
display={'flex'}
|
||||
justify={'space-between'}
|
||||
gap={0}
|
||||
onClick={() => {
|
||||
handleSearchHistoryItem(item);
|
||||
}}
|
||||
@@ -300,7 +304,7 @@ export default function Search({
|
||||
setShowFillButton(false);
|
||||
}}
|
||||
>
|
||||
<Group w={'15%'}>
|
||||
<Group m={0} p={0} miw={'160px'} style={{ overflow: 'hidden' }}>
|
||||
<Text
|
||||
style={{
|
||||
backgroundColor: `${theme.primaryColor}33`,
|
||||
@@ -324,32 +328,57 @@ export default function Search({
|
||||
</ActionIcon>
|
||||
)}
|
||||
</Group>
|
||||
<Group justify='space-between' w={'80%'}>
|
||||
<Text c={'var(--mantine-color-primary-0)'}>{item.option.searchTerm}</Text>
|
||||
<Group
|
||||
m={0}
|
||||
p={0}
|
||||
gap={0}
|
||||
justify='space-between'
|
||||
w={'65%'}
|
||||
style={{
|
||||
whiteSpace: 'nowrap',
|
||||
overflow: 'hidden',
|
||||
boxSizing: 'border-box',
|
||||
position: 'relative',
|
||||
}}
|
||||
>
|
||||
<Text
|
||||
w={'75%'}
|
||||
c={'var(--mantine-color-primary-0)'}
|
||||
style={{
|
||||
overflow: 'hidden',
|
||||
textOverflow: 'ellipsis',
|
||||
}}
|
||||
>
|
||||
{item.option.searchTerm}
|
||||
</Text>
|
||||
<Text
|
||||
w={'25%'}
|
||||
style={{
|
||||
color: `${theme.primaryColor}55`,
|
||||
textAlign: 'right',
|
||||
}}
|
||||
>
|
||||
{dateString}
|
||||
</Text>
|
||||
</Group>
|
||||
{showFillButton && (
|
||||
<ActionIcon
|
||||
className={actionIconClasses.selectOptionActions}
|
||||
classNames={actionIconClasses}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
mutateAsync({
|
||||
method: 'DELETE',
|
||||
endpoint: searchEndpoint,
|
||||
body: { id: item.option.id },
|
||||
});
|
||||
}}
|
||||
>
|
||||
<FiTrash />
|
||||
</ActionIcon>
|
||||
)}
|
||||
<Group m={0} p={0} right={16} w={'24px'}>
|
||||
{showFillButton && (
|
||||
<ActionIcon
|
||||
className={actionIconClasses.selectOptionActions}
|
||||
classNames={actionIconClasses}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
mutateAsync({
|
||||
method: 'DELETE',
|
||||
endpoint: searchEndpoint,
|
||||
body: { id: item.option.id },
|
||||
});
|
||||
}}
|
||||
>
|
||||
<FiTrash />
|
||||
</ActionIcon>
|
||||
)}
|
||||
</Group>
|
||||
</Group>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user