Make the build not fail

This commit is contained in:
phntxx 2022-04-10 21:31:40 +02:00
parent 765ab6d643
commit 3131110b4c
9 changed files with 214 additions and 434 deletions

View file

@ -55,7 +55,7 @@ export const isBetween = (a: number, b: number, c: number): boolean =>
* @returns {string} a greeting
*/
export const getGreeting = (greetings: Array<IGreetingProps>): string => {
let hours = Math.floor(new Date().getHours());
const hours = Math.floor(new Date().getHours());
let result = "";
greetings.forEach((greeting) => {
@ -95,14 +95,14 @@ export const getDateString = (
months: Array<string>,
format: string,
) => {
let currentDate = new Date();
const currentDate = new Date();
let weekday = weekdays[currentDate.getDay()];
let day = currentDate.getDate();
let month = months[currentDate.getMonth()];
let extension = getExtension(day);
let year = currentDate.getFullYear();
let isodate = currentDate.toISOString().slice(0, 10);
const weekday = weekdays[currentDate.getDay()];
const day = currentDate.getDate();
const month = months[currentDate.getMonth()];
const extension = getExtension(day);
const year = currentDate.getFullYear();
const isodate = currentDate.toISOString().slice(0, 10);
return format
.replace("%wd", weekday)

View file

@ -56,14 +56,14 @@ export const handleQueryWithProvider = (
search: ISearchProps,
query: string,
) => {
let queryArray: Array<string> = query.split(" ");
let prefix: string = queryArray[0];
const queryArray: Array<string> = query.split(" ");
const prefix: string = queryArray[0];
queryArray.shift();
let searchQuery: string = queryArray.join(" ");
const searchQuery: string = queryArray.join(" ");
let providerFound: boolean = false;
let providerFound = false;
if (search.providers) {
search.providers.forEach((provider: ISearchProviderProps) => {
if (provider.prefix === prefix) {
@ -81,15 +81,15 @@ export const handleQueryWithProvider = (
* @param {ISearchBarProps} search - The search providers for the search bar to use
*/
const SearchBar = ({ search }: ISearchBarProps) => {
let [input, setInput] = useState<string>("");
let [buttonsHidden, setButtonsHidden] = useState<boolean>(true);
const [input, setInput] = useState<string>("");
const [buttonsHidden, setButtonsHidden] = useState<boolean>(true);
useEffect(() => setButtonsHidden(input === ""), [input]);
if (search === undefined) return <></>;
const handleSearchQuery = (e: React.FormEvent) => {
var query: string = input || "";
const query: string = input || "";
if (query.split(" ")[0].includes("/")) {
handleQueryWithProvider(search, query);