Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ronny-mysten committed Oct 18, 2023
1 parent 94de39f commit cb6b8e1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions docs/site/src/components/Cards/index.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
// Copyright (c) Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0

import React from "react";
import React, { useEffect, useState } from "react";
import { useLocation, useHistory } from "@docusaurus/router";

export function Card(props) {
const location = useLocation();
const history = useHistory();
const isHome = location.pathname === "/";
const [href, setHref] = useState();

const handleClick = (href) => {
history.push(href);
useEffect(() => {
if (href) {
window.open(href, "_blank");
}
return true;
}, [href]);

const handleClick = (loc) => {
if (loc.match(/^https?/)) {
setHref(loc);
} else {
history.push(loc);
}
};

let classList =
Expand Down
File renamed without changes.

0 comments on commit cb6b8e1

Please sign in to comment.