Spaces:
Running
Running
Try to avoid redirects to HTTP.
Browse files
lynxkite-app/web/src/Directory.tsx
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
import { useState } from "react";
|
2 |
// The directory browser.
|
3 |
-
import { useNavigate, useParams } from "react-router";
|
4 |
import useSWR from "swr";
|
5 |
import type { DirectoryEntry } from "./apiTypes.ts";
|
6 |
|
@@ -173,19 +173,19 @@ export default function () {
|
|
173 |
|
174 |
{path && (
|
175 |
<div className="breadcrumbs">
|
176 |
-
<
|
177 |
<Home />
|
178 |
-
</
|
179 |
<span className="current-folder">{path}</span>
|
180 |
</div>
|
181 |
)}
|
182 |
|
183 |
{list.data.map((item: DirectoryEntry) => (
|
184 |
<div key={item.name} className="entry">
|
185 |
-
<
|
186 |
{item.type === "directory" ? <Folder /> : <File />}
|
187 |
{shortName(item)}
|
188 |
-
</
|
189 |
<button
|
190 |
type="button"
|
191 |
onClick={() => {
|
|
|
1 |
import { useState } from "react";
|
2 |
// The directory browser.
|
3 |
+
import { Link, useNavigate, useParams } from "react-router";
|
4 |
import useSWR from "swr";
|
5 |
import type { DirectoryEntry } from "./apiTypes.ts";
|
6 |
|
|
|
173 |
|
174 |
{path && (
|
175 |
<div className="breadcrumbs">
|
176 |
+
<Link to="/dir/">
|
177 |
<Home />
|
178 |
+
</Link>{" "}
|
179 |
<span className="current-folder">{path}</span>
|
180 |
</div>
|
181 |
)}
|
182 |
|
183 |
{list.data.map((item: DirectoryEntry) => (
|
184 |
<div key={item.name} className="entry">
|
185 |
+
<Link key={link(item)} to={link(item)}>
|
186 |
{item.type === "directory" ? <Folder /> : <File />}
|
187 |
{shortName(item)}
|
188 |
+
</Link>
|
189 |
<button
|
190 |
type="button"
|
191 |
onClick={() => {
|