From c047e169f2b55f5b91e1074a0a4d5e33c1719627 Mon Sep 17 00:00:00 2001 From: m5r Date: Mon, 6 Jun 2022 00:35:09 +0200 Subject: [PATCH] back button stuff --- app/routes/__app/messages.$recipient.tsx | 7 +++---- app/routes/__app/settings.tsx | 13 +------------ 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/app/routes/__app/messages.$recipient.tsx b/app/routes/__app/messages.$recipient.tsx index 194528f..edff921 100644 --- a/app/routes/__app/messages.$recipient.tsx +++ b/app/routes/__app/messages.$recipient.tsx @@ -1,5 +1,5 @@ import type { MetaFunction } from "@remix-run/node"; -import { Link, useNavigate, useParams } from "@remix-run/react"; +import { Link, useParams } from "@remix-run/react"; import { useLoaderData } from "superjson-remix"; import { IoCall, IoChevronBack } from "react-icons/io5"; @@ -23,7 +23,6 @@ export const action = conversationAction; export const loader = conversationLoader; export default function ConversationPage() { - const navigate = useNavigate(); const params = useParams<{ recipient: string }>(); const recipient = decodeURIComponent(params.recipient ?? ""); const { conversation } = useLoaderData(); @@ -31,9 +30,9 @@ export default function ConversationPage() { return (
- navigate(-1)}> + - + {conversation?.formattedPhoneNumber ?? recipient} diff --git a/app/routes/__app/settings.tsx b/app/routes/__app/settings.tsx index 38adf9f..0627cfd 100644 --- a/app/routes/__app/settings.tsx +++ b/app/routes/__app/settings.tsx @@ -1,8 +1,7 @@ import type { MetaFunction } from "@remix-run/node"; -import { Link, NavLink, Outlet, useNavigate } from "@remix-run/react"; +import { Link, NavLink, Outlet } from "@remix-run/react"; import clsx from "clsx"; import { - IoChevronBack, IoLogOutOutline, IoNotificationsOutline, IoCardOutline, @@ -27,18 +26,8 @@ export const meta: MetaFunction = () => ({ }); export default function SettingsLayout() { - const navigate = useNavigate(); - return (
-
-
- navigate(-1)}> - Back - -
-
-