mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-10 23:45:48 +01:00
Update SearchBar
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { Input, TextInput, Text, ActionIcon, useMantineTheme } from '@mantine/core';
|
import { Input, TextInput, Text, ActionIcon, useMantineTheme, Center } from '@mantine/core';
|
||||||
import { useForm } from '@mantine/hooks';
|
import { useForm } from '@mantine/hooks';
|
||||||
import { showNotification } from '@mantine/notifications';
|
import { showNotification } from '@mantine/notifications';
|
||||||
import { useState, useEffect } from 'react';
|
import { useState, useEffect } from 'react';
|
||||||
@@ -9,9 +9,11 @@ export default function SearchBar(props: any) {
|
|||||||
const theme = useMantineTheme();
|
const theme = useMantineTheme();
|
||||||
const [config, setConfig] = useState<Config>({
|
const [config, setConfig] = useState<Config>({
|
||||||
searchBar: true,
|
searchBar: true,
|
||||||
searchUrl : 'https://www.google.com/search?q=',
|
searchUrl: 'https://www.google.com/search?q=',
|
||||||
});
|
});
|
||||||
|
|
||||||
const querryUrl = config.searchUrl || 'https://www.google.com/search?q=';
|
const querryUrl = config.searchUrl || 'https://www.google.com/search?q=';
|
||||||
|
|
||||||
const form = useForm({
|
const form = useForm({
|
||||||
initialValues: {
|
initialValues: {
|
||||||
querry: '',
|
querry: '',
|
||||||
@@ -41,7 +43,6 @@ export default function SearchBar(props: any) {
|
|||||||
radius="xl"
|
radius="xl"
|
||||||
size="md"
|
size="md"
|
||||||
placeholder="Search the web"
|
placeholder="Search the web"
|
||||||
rightSectionWidth={42}
|
|
||||||
{...props}
|
{...props}
|
||||||
{...form.getInputProps('querry')}
|
{...form.getInputProps('querry')}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user