-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
_
- Loading branch information
Showing
17 changed files
with
1,972 additions
and
5,671 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
import LoadingScreen from '@/app/loading'; | ||
import LoadingScreen from '@/app/components/reusables/loading-screen'; | ||
export default LoadingScreen; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import pkg from '../../../package.json'; | ||
import { nextJS } from '../env'; | ||
|
||
abstract class BaseErr extends Error { | ||
private readonly version = pkg.version; | ||
readonly caughtError?: Error; | ||
|
||
constructor( | ||
readonly message: string, | ||
readonly error?: Error | ||
) { | ||
super(message, error); | ||
this.caughtError = error; | ||
} | ||
|
||
toJSON(): _SerializedErr { | ||
return { | ||
version: 'v' + this.version, | ||
caughtError: this.caughtError?.name, | ||
message: this.caughtError?.message || this.message, | ||
stack: | ||
nextJS.NEXT_NODE_ENV === 'production' | ||
? 'HIDDEN' | ||
: this.caughtError?.stack || this.stack, | ||
cause: | ||
JSON.stringify(this.caughtError?.cause) || JSON.stringify(this.cause), | ||
}; | ||
} | ||
} | ||
|
||
type _SerializedErr = { | ||
version: string; | ||
caughtError?: string; | ||
message: string; | ||
stack?: string; | ||
cause: string; | ||
}; | ||
|
||
declare class Err extends BaseErr {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
'use client'; | ||
|
||
import { useState, useEffect } from 'react'; | ||
import type { MouseEvent, TouchEvent } from 'react'; | ||
|
||
const useToggleDropDownMenu = ({ | ||
menuId, | ||
}: { | ||
menuId: string; | ||
}): [boolean, () => void] => { | ||
const initialState = false; | ||
const [isOpened, setIsOpened] = useState(initialState); | ||
|
||
const toggleMenu: () => void = () => { | ||
setIsOpened(!isOpened); | ||
}; | ||
|
||
useEffect(() => { | ||
const handleClickOutside = (e: MouseEvent | TouchEvent) => { | ||
if (!document.getElementById(menuId)?.contains(e.target as Node)) { | ||
setIsOpened(initialState); | ||
} | ||
}; | ||
// @ts-expect-error it just works, no time to set types | ||
window.addEventListener('click', handleClickOutside); | ||
|
||
return () => { | ||
// @ts-expect-error it just works, no time to set types | ||
window.removeEventListener('click', handleClickOutside); | ||
}; | ||
}, [menuId]); | ||
|
||
return [isOpened, toggleMenu]; | ||
}; | ||
export default useToggleDropDownMenu; |
Oops, something went wrong.