Skip to content

Commit

Permalink
Refactor/qp (#5012)
Browse files Browse the repository at this point in the history
  • Loading branch information
CamronStaley authored Oct 30, 2024
1 parent 430c3f7 commit 701c0c9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
3 changes: 1 addition & 2 deletions app/packages/app/src/pages/datasets/DatasetPage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Dataset, Snackbar, Starter } from "@fiftyone/core";
import { Dataset, Snackbar, Starter, QueryPerformanceToast } from "@fiftyone/core";
import "@fiftyone/embeddings";
import "@fiftyone/map";
import { OperatorCore } from "@fiftyone/operators";
Expand All @@ -10,7 +10,6 @@ import { usePreloadedQuery } from "react-relay";
import { useRecoilValue } from "recoil";
import { graphql } from "relay-runtime";
import Nav from "../../components/Nav";
import QueryPerformanceToast from "../../components/QueryPerformanceToast";
import type { Route } from "../../routing";
import style from "../index.module.css";
import type { DatasetPageQuery } from "./__generated__/DatasetPageQuery.graphql";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ const QueryPerformanceToast = () => {
return createPortal(
<Toast
duration={SHOWN_FOR}
layout={{ bottom: '100px', vertical: "bottom", horizontal: "center", backgroundColor: theme.custom.toastBackgroundColor}}
layout={{
bottom: "100px",
vertical: "bottom",
horizontal: "center",
backgroundColor: theme.custom.toastBackgroundColor,
}}
primary={(setOpen) => {
return (
<Button
Expand All @@ -54,7 +59,12 @@ const QueryPerformanceToast = () => {
open(QP_MODE, "_blank")?.focus();
setOpen(false);
}}
sx={{ marginLeft: "auto", backgroundColor: theme.primary.main, color: "#FFFFFF", boxShadow: 0 }} // Right align the button
sx={{
marginLeft: "auto",
backgroundColor: theme.primary.main,
color: theme.text.primary,
boxShadow: 0,
}} // Right align the button
>
View Documentation
</Button>
Expand All @@ -64,6 +74,7 @@ const QueryPerformanceToast = () => {
return (
<div>
<Button
data-cy="btn-dismiss-query-performance-toast"
variant="text"
color="secondary"
size="small"
Expand All @@ -84,7 +95,11 @@ const QueryPerformanceToast = () => {
<Bolt sx={{ color: theme.custom.lightning, marginRight: "8px" }} />
<Typography
variant="subtitle1"
sx={{ fontWeight: 500, marginRight: "8px", color: theme.text.primary }}
sx={{
fontWeight: 500,
marginRight: "8px",
color: theme.text.primary,
}}
>
Query Performance is Available!
</Typography>
Expand Down
1 change: 1 addition & 0 deletions app/packages/core/src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ export * from "./Sidebar";
export { default as Snackbar } from "./Snackbar";
export { default as ViewBar, rollbackViewBar } from "./ViewBar/ViewBar";
export * from "./Starter";
export { default as QueryPerformanceToast } from "./QueryPerformanceToast";

0 comments on commit 701c0c9

Please sign in to comment.