-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PagesEditor: split WorkflowHeader into WorkflowTopLinks and WorkflowTabs
- Loading branch information
1 parent
2bc7dc9
commit 4d513c8
Showing
6 changed files
with
63 additions
and
23 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
25 changes: 25 additions & 0 deletions
25
app/pages/lab-pages-editor/components/WorkflowTopLinks.jsx
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,25 @@ | ||
import ExternalLinkIcon from '../icons/ExternalLinkIcon.jsx'; | ||
import ReturnIcon from '../icons/ReturnIcon.jsx'; | ||
import { useWorkflowContext } from '../context.js'; | ||
import strings from '../strings.json'; | ||
import zooniverseLogo from '../assets/zooniverse-word-white.png' | ||
|
||
const DEFAULT_HANDLER = () => {}; | ||
|
||
export default function WorkflowTopLinks() { | ||
const { project, workflow } = useWorkflowContext(); | ||
const returnUrl = `/lab/${project?.id}/workflows`; | ||
|
||
if (!project || !workflow) return null; | ||
|
||
return ( | ||
<div className="workflow-top-links"> | ||
<a href={returnUrl}> {/* Formerly <Link> from 'react-router', but React was throwing Legacy Context errors. */} | ||
<ReturnIcon /> | ||
{strings.PagesEditor.components.WorkflowTopLinks.return} | ||
</a> | ||
<span className="flex-item" /> | ||
<img className="zooniverse-logo" src={zooniverseLogo} /> | ||
</div> | ||
); | ||
} |
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