Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Teams Link #4127

Merged
merged 6 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 31 additions & 67 deletions app/packages/app/src/components/Nav.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {
Button,
DocsLink,
GitHubLink,
Header,
Expand All @@ -13,9 +12,7 @@ import { useRefresh } from "@fiftyone/state";
import { isElectron } from "@fiftyone/utilities";
import { DarkMode, LightMode } from "@mui/icons-material";
import { useColorScheme } from "@mui/material";
import { AnimatePresence, motion } from "framer-motion";
import React, { Suspense, useEffect, useMemo } from "react";
import ReactDOM from "react-dom";
import ReactGA from "react-ga4";
import { useFragment, usePaginationFragment } from "react-relay";
import { useDebounce } from "react-use";
Expand Down Expand Up @@ -113,82 +110,49 @@ const Nav: React.FC<{
fragment NavFragment on Query {
...NavDatasets
...NavGA

teamsSubmission
}
`,
fragment
);
useGA(data);
const useSearch = getUseSearch(data);

const [teams, setTeams] = useRecoilState(fos.appTeamsIsOpen);
const refresh = useRefresh();
const { mode, setMode } = useColorScheme();
const [_, setTheme] = useRecoilState(fos.theme);

return (
<>
<Header
title={"FiftyOne"}
onRefresh={refresh}
navChildren={<DatasetSelector useSearch={useSearch} />}
>
{hasDataset && (
<Suspense fallback={<div style={{ flex: 1 }}></div>}>
<ViewBar />
</Suspense>
)}
{!hasDataset && <div style={{ flex: 1 }}></div>}
<div className={iconContainer}>
{!data.teamsSubmission && (
<Button
onClick={() => {
setTeams(true);
}}
>
Have a Team?
</Button>
)}
<IconButton
title={mode === "dark" ? "Light mode" : "Dark mode"}
onClick={() => {
const nextMode = mode === "dark" ? "light" : "dark";
setMode(nextMode);
setTheme(nextMode);
}}
sx={{
color: (theme) => theme.palette.text.secondary,
pr: 0,
}}
>
{mode === "dark" ? <LightMode color="inherit" /> : <DarkMode />}
</IconButton>
<SlackLink />
<GitHubLink />
<DocsLink />
</div>
</Header>
{ReactDOM.createPortal(
<AnimatePresence>
{teams && (
<motion.div
initial={{ opacity: 0, height: 0 }}
animate={{
opacity: 1,
height: "auto",
}}
exit={{ opacity: 0, height: 0 }}
transition={{ duration: 0.2 }}
key={"teams"}
>
<Teams />
</motion.div>
)}
</AnimatePresence>,
document.getElementById("teams") as HTMLDivElement
<Header
title={"FiftyOne"}
onRefresh={refresh}
navChildren={<DatasetSelector useSearch={useSearch} />}
>
{hasDataset && (
<Suspense fallback={<div style={{ flex: 1 }}></div>}>
<ViewBar />
</Suspense>
)}
</>
{!hasDataset && <div style={{ flex: 1 }}></div>}
<div className={iconContainer}>
<Teams />
<IconButton
title={mode === "dark" ? "Light mode" : "Dark mode"}
onClick={() => {
const nextMode = mode === "dark" ? "light" : "dark";
setMode(nextMode);
setTheme(nextMode);
}}
sx={{
color: (theme) => theme.palette.text.secondary,
pr: 0,
}}
>
{mode === "dark" ? <LightMode color="inherit" /> : <DarkMode />}
</IconButton>
<SlackLink />
<GitHubLink />
<DocsLink />
</div>
</Header>
);
};

Expand Down
12 changes: 12 additions & 0 deletions app/packages/app/src/components/Teams.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Button, ExternalLink } from "@fiftyone/components";
import React from "react";

export default function Teams() {
return (
<ExternalLink
href={"https://voxel51.com/book-a-demo/?utm_source=FiftyOneApp"}
>
<Button>Have a Team?</Button>
</ExternalLink>
);
}
54 changes: 0 additions & 54 deletions app/packages/app/src/components/Teams/Teams.module.css

This file was deleted.

166 changes: 0 additions & 166 deletions app/packages/app/src/components/Teams/Teams.tsx

This file was deleted.

Loading
Loading