Skip to content

Commit

Permalink
highlight submit system button (#521)
Browse files Browse the repository at this point in the history
* highlight submit system button

* change button color

* fix import
  • Loading branch information
qjiang002 authored Nov 18, 2022
1 parent a946e04 commit 8d28c4b
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions frontend/src/components/SystemsTable/SystemTableTools.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -273,16 +273,29 @@ export function SystemTableTools({
}

function NewSystemButton(props: ButtonProps) {
const { state } = useUser();
const { login, state } = useUser();
if (state === LoginState.yes)
return (
<Button type="primary" {...props}>
New
<Button
style={{ backgroundColor: "#28a745", borderColor: "#28a745" }}
type="primary"
{...props}
>
Submit New System
</Button>
);
return (
<Tooltip title="Please log in to submit new systems" placement="topLeft">
<Button disabled>New</Button>
<Tooltip
title="Please log in to submit new systems"
placement="topLeft"
defaultVisible
>
<Button
onClick={login}
style={{ borderColor: "#28a745", color: "#28a745" }}
>
Submit New System
</Button>
</Tooltip>
);
}

0 comments on commit 8d28c4b

Please sign in to comment.