Skip to content

Commit

Permalink
Merge pull request #156 from dolthub/taylor/changes
Browse files Browse the repository at this point in the history
web: Some fixes
  • Loading branch information
tbantle22 authored Apr 2, 2024
2 parents 91878ef + 2a40116 commit 476e717
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion web/components/TableList/ColumnList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function ColumnItem({ col }: { col: ColumnForTableListFragment }) {
);
}

const collateRegex = /COLLATE UTF8MB4_0900_(AI_CI|BIN)/;
const collateRegex = /\s+COLLATE\s+\w+/i;

function getConstraints(c: Column): string {
return c.constraints?.some(con => con.notNull) ? " NOT NULL" : "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { CommitForHistoryFragment } from "@gen/graphql-types";
import { useCommitListForBranch } from "@hooks/useCommitListForBranch";
import { RefParams } from "@lib/params";
import { useRouter } from "next/router";
import { useEffect, useState } from "react";
import InfiniteScroll from "react-infinite-scroller";
import CommitGraphButton from "./CommitGraphButton";
import CommitHeader from "./CommitHeader";
Expand All @@ -26,6 +27,22 @@ function Inner({ commits, ...props }: InnerProps) {
const router = useRouter();
useAnchorTag();
const { isMobile } = useReactiveWidth(1024);
const [activeHash, setActiveHash] = useState(
router.asPath.split("#")[1] || "",
);

useEffect(() => {
const handleHashChange = () => {
const hash = window.location.hash.replace("#", "");
setActiveHash(hash);
};

window.addEventListener("hashchange", handleHashChange, false);

return () => {
window.removeEventListener("hashchange", handleHashChange, false);
};
}, []);

return (
<div>
Expand Down Expand Up @@ -63,7 +80,7 @@ function Inner({ commits, ...props }: InnerProps) {
{...props}
key={c._id}
commit={c}
activeHash={router.asPath.split("#")[1]}
activeHash={activeHash}
/>
</>
);
Expand Down

0 comments on commit 476e717

Please sign in to comment.