Skip to content

Commit

Permalink
Merge branch 'main' into feature/league-editor
Browse files Browse the repository at this point in the history
  • Loading branch information
1nayu authored May 20, 2024
2 parents 78ac43d + d665389 commit 2d8a3d7
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 4 deletions.
15 changes: 15 additions & 0 deletions components/teams/teamLinkRenderer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import {ICellRendererParams} from "ag-grid-community";
import Link from "next/link";

export default function TeamLinkRenderer(param: ICellRendererParams) {
return (
<Link
href={`/teams/${param.value}`}
style={{
width: '100%',
}}
>
{param.value}
</Link>
)
}
25 changes: 21 additions & 4 deletions components/teams/teamsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {Team} from "@/src/models/TeamModel";
import {Class} from '@/src/models/ClassModel';
import {TeamTag} from "@/src/models/TeamTagModel";
import {useRouter} from "next/navigation";
import TeamLinkRenderer from "@/components/teams/teamLinkRenderer";

ModuleRegistry.registerModules([ClientSideRowModelModule]);

Expand Down Expand Up @@ -37,10 +38,26 @@ const TeamsAgGrid = (props: TeamsAgGridProps) => {

// Column Definitions: Defines & controls grid columns.
const [colDefs,] = useState<ColDef<IRow>[]>([
{field: "teamId", headerName: "チームID"},
{field: "teamName", headerName: "チーム名"},
{field: "className", headerName: "クラス"},
{field: "teamTagName", headerName: "タグ"},
{
field: "teamId",
headerName: "チームID",
cellRenderer: TeamLinkRenderer,
},
{
field: "teamName",
headerName: "チーム名",
filter: true,
},
{
field: "className",
headerName: "クラス",
filter: true,
},
{
field: "teamTagName",
headerName: "タグ",
filter: true,
},
]);

useEffect(() => {
Expand Down

0 comments on commit 2d8a3d7

Please sign in to comment.