Skip to content

Commit

Permalink
Add "maintained by SIPB" badge (#80)
Browse files Browse the repository at this point in the history
It was suggested a while back that we add a "maintained by SIPB" badge
to Hydrant; of course, this is all the more relevant now that the spring
2025 listings are up and lots of people are using Hydrant.

This is modelled after the DormSoup project:
https://github.com/DormSoup/dormsoup/blob/main/app/components/SIPBLogo.tsx
  • Loading branch information
psvenk authored Nov 28, 2024
1 parent 3ef72d1 commit a260a16
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
Binary file added public/fuzzball.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import "./App.scss";
import { MatrixLink } from "./MatrixLink";
import { useICSExport } from "../lib/gapi";
import { CalendarIcon } from "@chakra-ui/icons";
import { SIPBLogo } from "./SIPBLogo";

type SemesterData = {
classes: { [cls: string]: RawClass };
Expand Down Expand Up @@ -96,7 +97,7 @@ function useHydrant(): {
/**
* "Integration callbacks" allow other SIPB projects to integrate with Hydrant by redirecting to
* https://hydrant.mit.edu/#/export with a `callback` as a query parameter.
*
*
* Currently, the only application that uses this is the Matrix class group chat picker,
* but in the future, a prompt "[Application name] would like to access your Hydrant class list"
* could be implemented.
Expand All @@ -120,7 +121,7 @@ function HydrantApp() {
useEffect(() => {
// only trigger this code if the URL asked for it
if (!hasIntegrationCallback) return;

// wait until Hydrant loads
if (!hydrant) return;

Expand Down Expand Up @@ -205,6 +206,7 @@ function HydrantApp() {
</Button>
</Tooltip>
<MatrixLink selectedActivities={state.selectedActivities}/>
<SIPBLogo/>
</HStack>
</Center>
<SelectedActivities
Expand Down
25 changes: 25 additions & 0 deletions src/components/SIPBLogo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { Button, Image } from "@chakra-ui/react";

export function SIPBLogo() {
return (
<a
href="https://sipb.mit.edu/"
target="_blank"
rel="noreferrer"
>
<Button
colorScheme="gray"
rightIcon={
<Image
src="/fuzzball.png"
alt="SIPB Logo"
height={6}
/>
}
size="sm"
>
Maintained by SIPB
</Button>
</a>
);
}

0 comments on commit a260a16

Please sign in to comment.