-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Use a menu dropdown instead of tabs as we have too many projects * Remove unused imports * Format since removing unused * Add alpha to shovel icon
- Loading branch information
Showing
7 changed files
with
79 additions
and
67 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,52 @@ | ||
import { ChevronDownIcon } from "@chakra-ui/icons"; | ||
import { | ||
HStack, | ||
Text, | ||
Box, | ||
Button, | ||
Menu, | ||
MenuItem, | ||
MenuButton, | ||
MenuList, | ||
} from "@chakra-ui/react"; | ||
import { Link as RemixLink, useNavigate } from "@remix-run/react"; | ||
import { ExcavatorProject } from "excavator-projects"; | ||
|
||
import { toSlug } from "../utils/utils.js"; | ||
|
||
type Props = { | ||
project: ExcavatorProject; | ||
projects: string[]; | ||
}; | ||
|
||
export function ProjectHeader({ project, projects }: Props) { | ||
const navigate = useNavigate(); | ||
|
||
return ( | ||
<HStack> | ||
<Menu> | ||
<MenuButton as={Button} rightIcon={<ChevronDownIcon />}> | ||
{project.name} | ||
</MenuButton> | ||
<MenuList> | ||
{projects.map((p) => ( | ||
<MenuItem key={p} onClick={() => navigate(`../${toSlug(p)}`)}> | ||
{p} | ||
</MenuItem> | ||
))} | ||
</MenuList> | ||
</Menu> | ||
<Text>{project.description}</Text> | ||
<Box flex={1} /> | ||
<Button | ||
as={RemixLink} | ||
size="xs" | ||
rightIcon={<>⬇</>} | ||
to={`../${toSlug(project.name)}.csv`} | ||
reloadDocument | ||
> | ||
<Text display={["none", null, "block"]}>Download Data</Text> | ||
</Button> | ||
</HStack> | ||
); | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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