Skip to content

Commit

Permalink
style: replaced hardcoded links to references to AppPath (#5968)
Browse files Browse the repository at this point in the history
# Motivation

We have hardcoded links in two components: `LinkToSettings` and
`LinkToReporting`. We can replace these with references to the `AppPath`
object, which exports all the routes.

# Changes

- Replace hardcoded values with references to `AppPath`.

# Tests

- Not necessary

# Todos

- [ ] Add entry to changelog (if necessary).
Not necessary
  • Loading branch information
yhabib authored Dec 10, 2024
1 parent c71fe80 commit 375b5fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion frontend/src/lib/components/header/LinkToReporting.svelte
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<script lang="ts">
import { beforeNavigate } from "$app/navigation";
import { AppPath } from "$lib/constants/routes.constants";
import { i18n } from "$lib/stores/i18n";
import { IconDocument } from "@dfinity/gix-components";
import { createEventDispatcher } from "svelte";
const dispatcher = createEventDispatcher();
const linkToReporting = "/reporting";
const linkToReporting = AppPath.Reporting;
beforeNavigate(() => dispatcher("nnsLink"));
</script>
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/lib/components/header/LinkToSettings.svelte
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<script lang="ts">
import { beforeNavigate } from "$app/navigation";
import { AppPath } from "$lib/constants/routes.constants";
import { i18n } from "$lib/stores/i18n";
import { IconSettings } from "@dfinity/gix-components";
import { createEventDispatcher } from "svelte";
const dispatcher = createEventDispatcher();
const linkToSettings = "/settings";
const linkToSettings = AppPath.Settings;
beforeNavigate(() => dispatcher("nnsLink"));
</script>
Expand Down

0 comments on commit 375b5fd

Please sign in to comment.