-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui): add the ability to turn off auto-refresh of projects (#4414)
* feat(ui): add the ability to turn off auto-refresh of projects * cleanup * Update app/src/hooks/useInterval.ts
- Loading branch information
1 parent
d15c6e3
commit 4a792d2
Showing
7 changed files
with
86 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React from "react"; | ||
|
||
import { Switch } from "@arizeai/components"; | ||
|
||
import { usePreferencesContext } from "@phoenix/contexts/PreferencesContext"; | ||
|
||
/** | ||
* Enable / Disable auto refresh for projects | ||
*/ | ||
export function ProjectsAutoRefreshToggle() { | ||
const autoRefreshEnabled = usePreferencesContext( | ||
(state) => state.projectsAutoRefreshEnabled | ||
); | ||
const setAutoRefreshEnabled = usePreferencesContext( | ||
(state) => state.setProjectAutoRefreshEnabled | ||
); | ||
|
||
return ( | ||
<Switch | ||
labelPlacement="start" | ||
isSelected={autoRefreshEnabled} | ||
onChange={() => { | ||
setAutoRefreshEnabled(!autoRefreshEnabled); | ||
}} | ||
> | ||
Auto-Refresh | ||
</Switch> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
app/src/pages/projects/__generated__/ProjectsPageProjectsFragment.graphql.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
10 changes: 5 additions & 5 deletions
10
app/src/pages/projects/__generated__/ProjectsPageProjectsQuery.graphql.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
10 changes: 5 additions & 5 deletions
10
app/src/pages/projects/__generated__/ProjectsPageQuery.graphql.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters