mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-04 04:48:15 +03:00
more push
This commit is contained in:
@@ -1,7 +1,4 @@
|
||||
import React, { useContext } from "react";
|
||||
import SVG from "react-inlinesvg";
|
||||
import { OverlayTrigger, Tooltip } from "react-bootstrap";
|
||||
import { toAbsoluteUrl } from "../../../_metronic/_helpers";
|
||||
import { UserNotificationsDropdown } from "../../../_metronic/layout/components/extras/dropdowns/UserNotificationsDropdown";
|
||||
import { UserProfileDropdown } from "components/layout/header/UserProfileDropdown";
|
||||
import { UserContext } from "context/UserContext";
|
||||
@@ -19,7 +16,7 @@ export function Topbar() {
|
||||
<>
|
||||
<UserNotificationsDropdown />
|
||||
|
||||
<OverlayTrigger
|
||||
{/* <OverlayTrigger
|
||||
placement="bottom"
|
||||
overlay={<Tooltip id="quick-panel-tooltip">Quick panel</Tooltip>}
|
||||
>
|
||||
@@ -42,7 +39,7 @@ export function Topbar() {
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</OverlayTrigger>
|
||||
</OverlayTrigger> */}
|
||||
|
||||
<UserProfileDropdown user={user} />
|
||||
</>
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
import React, { useState } from "react";
|
||||
import { Collapse } from "react-bootstrap";
|
||||
import { JustChildren } from "types/react";
|
||||
|
||||
export default function DropdownRow({
|
||||
children,
|
||||
dropdown,
|
||||
}: { dropdown: React.ReactNode } & JustChildren) {
|
||||
const [showDropdown, setShowDropdown] = useState(false);
|
||||
return (
|
||||
<>
|
||||
<tr onClick={() => setShowDropdown(!showDropdown)}>{children}</tr>
|
||||
<tr className="expandable-pseudo-row">
|
||||
<td colSpan={100}>
|
||||
<Collapse in={showDropdown}>
|
||||
<div className="tr-dropdown-container">{dropdown}</div>
|
||||
</Collapse>
|
||||
</td>
|
||||
</tr>
|
||||
{/* Fake row to ensure striping stays consistent */}
|
||||
<tr className="fake-row"></tr>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -8,20 +8,23 @@ import {
|
||||
} from "tachi-common";
|
||||
import { SetState } from "types/react";
|
||||
|
||||
export default function SelectableRating<T extends IDStrings>({
|
||||
export default function SelectableRating<I extends IDStrings>({
|
||||
game,
|
||||
playtype,
|
||||
rating,
|
||||
setRating,
|
||||
}: {
|
||||
game: Game;
|
||||
playtype: Playtypes[Game];
|
||||
setRating: SetState<ScoreCalculatedDataLookup[T]>;
|
||||
rating: ScoreCalculatedDataLookup[I];
|
||||
setRating: SetState<ScoreCalculatedDataLookup[I]>;
|
||||
}) {
|
||||
const gptConfig = GetGamePTConfig(game, playtype);
|
||||
return (
|
||||
<th>
|
||||
<select
|
||||
onChange={v => setRating(v.target.value as ScoreCalculatedDataLookup[T])}
|
||||
onChange={v => setRating(v.target.value as ScoreCalculatedDataLookup[I])}
|
||||
value={rating}
|
||||
style={{
|
||||
backgroundColor: "#131313",
|
||||
border: "none",
|
||||
|
||||
@@ -3,7 +3,6 @@ import { FormatDifficulty } from "tachi-common/js/utils/util";
|
||||
import TitleCell from "../cells/TitleCell";
|
||||
import RankingCell from "../cells/RankingCell";
|
||||
import TimestampCell from "../cells/TimestampCell";
|
||||
import BPICell from "../cells/BPICell";
|
||||
import { ChangeOpacity } from "util/color-opacity";
|
||||
import { NumericSOV, StrSOV } from "util/sorts";
|
||||
import SelectableRating from "../components/SelectableRating";
|
||||
@@ -16,6 +15,7 @@ import IndexCell from "../cells/IndexCell";
|
||||
import DeltaCell from "../cells/DeltaCell";
|
||||
import { HumanFriendlyStrToGradeIndex, HumanFriendlyStrToLampIndex } from "util/str-to-num";
|
||||
import { nanoid } from "nanoid";
|
||||
import DropdownRow from "../components/DropdownRow";
|
||||
|
||||
export default function IIDXPBTable({
|
||||
dataset,
|
||||
@@ -45,6 +45,7 @@ export default function IIDXPBTable({
|
||||
key={nanoid()}
|
||||
game="iidx"
|
||||
playtype="SP"
|
||||
rating={rating}
|
||||
setRating={setRating}
|
||||
/>
|
||||
),
|
||||
@@ -81,7 +82,10 @@ export default function IIDXPBTable({
|
||||
}}
|
||||
defaultSortMode={indexCol ? "#" : undefined}
|
||||
rowFunction={pb => (
|
||||
<tr key={pb.chartID}>
|
||||
<DropdownRow
|
||||
dropdown={<div style={{ height: "200px" }}>{pb.chartID}</div>}
|
||||
key={pb.chartID}
|
||||
>
|
||||
{indexCol && <IndexCell index={pb.__related.index} />}
|
||||
<DifficultyCell chart={pb.__related.chart} game={"iidx"} />
|
||||
<TitleCell artist={pb.__related.song.artist} title={pb.__related.song.title} />
|
||||
@@ -105,18 +109,14 @@ export default function IIDXPBTable({
|
||||
<br />
|
||||
<small>[BP: {pb.scoreData.hitMeta.bp ?? "No Data"}]</small>
|
||||
</td>
|
||||
{rating === "BPI" ? (
|
||||
<BPICell bpi={pb.calculatedData.BPI} />
|
||||
) : (
|
||||
<td>
|
||||
{pb.calculatedData[rating]
|
||||
? pb.calculatedData[rating]!.toFixed(2)
|
||||
: "No Data."}
|
||||
</td>
|
||||
)}
|
||||
<td>
|
||||
{pb.calculatedData[rating]
|
||||
? pb.calculatedData[rating]!.toFixed(2)
|
||||
: "No Data."}
|
||||
</td>
|
||||
<RankingCell rankingData={pb.rankingData} />
|
||||
<TimestampCell time={pb.timeAchieved} />
|
||||
</tr>
|
||||
</DropdownRow>
|
||||
)}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -47,6 +47,7 @@ export default function IIDXScoreTable({
|
||||
key={nanoid()}
|
||||
game="iidx"
|
||||
playtype="SP"
|
||||
rating={rating}
|
||||
setRating={setRating}
|
||||
/>
|
||||
),
|
||||
|
||||
@@ -92,7 +92,7 @@ export function useZTable<D>(originalDataset: D[], providedOptions?: Partial<ZTa
|
||||
return `Displaying ${(page - 1) * pageLen + 1} to ${Math.min(
|
||||
page * pageLen,
|
||||
dataset.length
|
||||
)} of ${dataset.length} ${entryName.toLowerCase()}${search !== "" && " (Filtered)"}.`;
|
||||
)} of ${dataset.length} ${entryName.toLowerCase()}${search !== "" ? " (Filtered)" : ""}.`;
|
||||
}, [page, dataset]);
|
||||
|
||||
// Create a sliding window that can be used for pagination.
|
||||
|
||||
@@ -6,13 +6,12 @@ import {
|
||||
FormikErrors,
|
||||
FormikState,
|
||||
FormikTouched,
|
||||
useFormik,
|
||||
} from "formik";
|
||||
import { Dispatch, SetStateAction } from "react";
|
||||
import React, { Dispatch, SetStateAction } from "react";
|
||||
import { Game, Playtypes } from "tachi-common";
|
||||
|
||||
export interface JustChildren {
|
||||
children: (JSX.Element | string)[] | JSX.Element | string;
|
||||
children: React.ReactNode;
|
||||
}
|
||||
|
||||
export type SetState<T> = Dispatch<SetStateAction<T>>;
|
||||
|
||||
Reference in New Issue
Block a user