Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
Update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
obulat committed Jan 31, 2023
1 parent f6c28ce commit 42f525f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/composables/use-match-routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import usePages from "~/composables/use-pages"

/**
* Reactive property that returns true only on the matching routes.
* Note that routes are matched by the url path.
* Note that routes are matched by their non-localized name.
*
*/
export const useMatchRoute = (
Expand All @@ -15,8 +15,9 @@ export const useMatchRoute = (
const router = useRouter()

/**
* The route is localized, so it includes the locale code after `__`.
* We need to extract the route name to match it with the routes array.
* The route name is localized, so it includes the locale code after `__`.
* We remove the locale from the route name to match it with the
* non-localized routes array.
*
* @param route - the localized route name (e.g. `search__en`)
*/
Expand Down Expand Up @@ -50,8 +51,8 @@ export const useMatchSearchRoutes = () => {
}

/**
* Reactive property that returns true only on the `search` routes.
* Homepage, single image result and other content pages return `false`
* Reactive property that returns true only on the `single result` routes.
* Homepage, search results and other content pages return `false`
*/
export const useMatchSingleResultRoutes = () => {
const routes = [
Expand All @@ -69,7 +70,8 @@ export const useMatchSingleResultRoutes = () => {
}

/**
* Matches the content pages (about, search help, etc.) and the preferences page.
* Reactive property that returns true only on the 'content' routes:
* about, search help, etc. and the preferences page.
*/
export const useMatchContentPageRoutes = () => {
const routes = usePages()
Expand Down

0 comments on commit 42f525f

Please sign in to comment.