Skip to content

Commit

Permalink
fix: update viewTransition to react router links
Browse files Browse the repository at this point in the history
  • Loading branch information
boojack committed Oct 21, 2024
1 parent 755fdac commit f394b17
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion frontend/web/src/components/CollectionView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const CollectionView = (props: Props) => {
<div className="bg-gray-100 dark:bg-zinc-800 px-3 py-2 w-full flex flex-row justify-between items-center rounded-t-lg">
<div className="w-auto flex flex-col justify-start items-start mr-2">
<div className="w-full truncate">
<Link className="leading-6 font-medium dark:text-gray-400" to={`/c/${collection.name}`} unstable_viewTransition>
<Link className="leading-6 font-medium dark:text-gray-400" to={`/c/${collection.name}`} viewTransition>
{collection.title}
</Link>
<span className="ml-1 leading-6 text-gray-500 dark:text-gray-400" onClick={handleCopyCollectionLink}>
Expand Down
10 changes: 5 additions & 5 deletions frontend/web/src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const Header: React.FC = () => {
<div className="w-full bg-gray-50 dark:bg-black border-b border-b-gray-200 dark:border-b-zinc-800">
<div className="w-full max-w-8xl mx-auto px-4 sm:px-6 md:px-12 py-3 flex flex-row justify-between items-center">
<div className="flex flex-row justify-start items-center shrink mr-2">
<Link to="/" className="cursor-pointer flex flex-row justify-start items-center dark:text-gray-400" unstable_viewTransition>
<Link to="/" className="cursor-pointer flex flex-row justify-start items-center dark:text-gray-400" viewTransition>
<Logo className="mr-2" />
Slash
</Link>
Expand All @@ -57,14 +57,14 @@ const Header: React.FC = () => {
<Link
className="w-full px-2 flex flex-row justify-start items-center text-left dark:text-gray-400 leading-8 cursor-pointer rounded hover:bg-gray-100 dark:hover:bg-zinc-800 disabled:cursor-not-allowed disabled:bg-gray-100 disabled:opacity-60"
to="/shortcuts"
unstable_viewTransition
viewTransition
>
<Icon.SquareSlash className="w-5 h-auto mr-2 opacity-70" /> Shortcuts
</Link>
<Link
className="w-full px-2 flex flex-row justify-start items-center text-left dark:text-gray-400 leading-8 cursor-pointer rounded hover:bg-gray-100 dark:hover:bg-zinc-800 disabled:cursor-not-allowed disabled:bg-gray-100 disabled:opacity-60"
to="/collections"
unstable_viewTransition
viewTransition
>
<Icon.LibrarySquare className="w-5 h-auto mr-2 opacity-70" /> Collections
</Link>
Expand All @@ -88,15 +88,15 @@ const Header: React.FC = () => {
<Link
className="w-full px-2 flex flex-row justify-start items-center text-left dark:text-gray-400 leading-8 cursor-pointer rounded hover:bg-gray-100 dark:hover:bg-zinc-800 disabled:cursor-not-allowed disabled:bg-gray-100 disabled:opacity-60"
to="/setting/general"
unstable_viewTransition
viewTransition
>
<Icon.User className="w-5 h-auto mr-2 opacity-70" /> {t("user.profile")}
</Link>
{isAdmin && (
<Link
className="w-full px-2 flex flex-row justify-start items-center text-left dark:text-gray-400 leading-8 cursor-pointer rounded hover:bg-gray-100 dark:hover:bg-zinc-800 disabled:cursor-not-allowed disabled:bg-gray-100 disabled:opacity-60"
to="/setting/workspace"
unstable_viewTransition
viewTransition
>
<Icon.Settings className="w-5 h-auto mr-2 opacity-70" /> {t("settings.self")}
</Link>
Expand Down
4 changes: 2 additions & 2 deletions frontend/web/src/components/ShortcutCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const ShortcutCard = (props: Props) => {
<Link
className={classNames("w-8 h-8 flex justify-center items-center overflow-clip shrink-0")}
to={`/shortcut/${shortcut.id}`}
unstable_viewTransition
viewTransition
>
<LinkFavicon url={shortcut.link} />
</Link>
Expand Down Expand Up @@ -129,7 +129,7 @@ const ShortcutCard = (props: Props) => {
<Link
className="w-auto leading-5 flex flex-row justify-start items-center flex-nowrap whitespace-nowrap cursor-pointer text-gray-400 text-sm"
to={`/shortcut/${shortcut.id}#analytics`}
unstable_viewTransition
viewTransition
>
<Icon.BarChart2 className="w-4 h-auto mr-1 opacity-70" />
{t("shortcut.visits", { count: shortcut.viewCount })}
Expand Down
2 changes: 1 addition & 1 deletion frontend/web/src/pages/SignIn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const SignIn: React.FC = () => {
{!workspaceStore.setting.disallowUserRegistration && !workspaceStore.setting.disallowPasswordAuth && (
<p className="w-full mt-4 text-sm">
<span className="dark:text-gray-500">{"Don't have an account yet?"}</span>
<Link className="cursor-pointer ml-2 text-blue-600 hover:underline" to="/auth/signup" unstable_viewTransition>
<Link className="cursor-pointer ml-2 text-blue-600 hover:underline" to="/auth/signup" viewTransition>
{t("auth.sign-up")}
</Link>
</p>
Expand Down
2 changes: 1 addition & 1 deletion frontend/web/src/pages/SignUp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ const SignUp: React.FC = () => {
) : (
<p className="w-full mt-4 text-sm">
<span className="dark:text-gray-500">{"Already has an account?"}</span>
<Link className="cursor-pointer ml-2 text-blue-600 hover:underline" to="/auth" unstable_viewTransition>
<Link className="cursor-pointer ml-2 text-blue-600 hover:underline" to="/auth" viewTransition>
{t("auth.sign-in")}
</Link>
</p>
Expand Down
2 changes: 1 addition & 1 deletion frontend/web/src/pages/WorkspaceSetting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const WorkspaceSetting = () => {
<div className="mt-2">
<span className="text-gray-500 mr-2">Current plan:</span>
<span className="text-2xl mr-4 dark:text-gray-400">{stringifyPlanType(workspaceStore.getSubscription().plan)}</span>
<Link to="/setting/subscription" unstable_viewTransition>
<Link to="/setting/subscription" viewTransition>
<Button size="sm" variant="outlined" startDecorator={<Icon.Settings className="w-4 h-auto" />}>
Manage
</Button>
Expand Down

0 comments on commit f394b17

Please sign in to comment.