Skip to content

Commit cfb98ff

Browse files
authored
Merge pull request #57 from the-collab-lab/revert-44-ma/view-list-name
Revert "Issue #43 Users should be able to view the list name"
2 parents 36baf23 + 384722e commit cfb98ff

File tree

13 files changed

+12
-245
lines changed

13 files changed

+12
-245
lines changed

src/App.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,6 @@ export function App() {
7070
path="/list"
7171
element={<List data={data} listPath={listPath} />}
7272
/>
73-
<Route
74-
path="/list/:listName"
75-
element={<List data={data} listPath={listPath} />}
76-
/>
7773
<Route
7874
path="/manage-list"
7975
element={<ManageList listPath={listPath} data={data || []} />}

src/components/AuthenticatedNavBar 2.css

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/components/AuthenticatedNavBar.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ export function AuthenticatedNavBar() {
1212
<NavLink to="/" className="Nav__link" aria-label="Home">
1313
Home
1414
</NavLink>
15-
15+
<NavLink to="/list" className="Nav__link" aria-label="List">
16+
List
17+
</NavLink>
1618
<NavLink
1719
to="/manage-list"
1820
className="Nav__link"

src/components/CreateList.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ export function CreateList({ user, setListPath }: Props) {
3232
toast.success("Success: Your New List is Created!");
3333
// Delay for toast notification before redirecting
3434
setTimeout(() => {
35-
const listName = path.split("/").pop();
36-
navigate(`/list/${listName}`);
35+
navigate("/list");
3736
}, 1500); // 1.5 seconds delay
3837
} catch (error) {
3938
console.error("Error creating list:", error);

src/components/ListItem 2.css

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/components/SingleList 2.css

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/components/SingleList.tsx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
2-
import "./SingleList.css";
1+
import * as api from "../api/firebase";
32
import Button from "react-bootstrap/Button";
43
import "./SingleList.scss";
5-
import { useNavigate } from "react-router-dom";
6-
7-
export function SingleList({ name }: { name: string }) {
8-
const navigate = useNavigate();
94

5+
interface Props extends Pick<api.List, "name" | "path"> {
6+
setListPath: (path: string) => void;
7+
}
108

9+
export function SingleList({ name, path, setListPath }: Props) {
1110
function handleClick() {
12-
setTimeout(() => {
13-
navigate(`/list/${name}`);
14-
}, 200);
11+
setListPath(path);
1512
}
1613

1714
return (

src/components/forms/AddItemForm.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,7 @@ export function AddItemForm({ listPath, data: unfilteredListItems }: Props) {
8787
}
8888
};
8989
const navigateToListPage = () => {
90-
if (listPath) {
91-
const listName = listPath.split("/").pop();
92-
navigate(`/list/${listName}`);
93-
}
90+
navigate("/list");
9491
};
9592

9693
return (

src/index 2.css

Lines changed: 0 additions & 101 deletions
This file was deleted.

src/views/Home 2.css

Whitespace-only changes.

0 commit comments

Comments
 (0)