Skip to content

Commit

Permalink
#42 - rename jbrowse button (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
samrichca authored Sep 15, 2023
1 parent ff1ecba commit 071b2a9
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 20 deletions.
20 changes: 6 additions & 14 deletions components/pages/explorer/Jbrowse/JbrowseLaunchButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
*
*/

import { css, useTheme } from '@emotion/react';
import { find } from 'lodash';
import Button from '@/components/Button';
import { CustomTooltip } from '@/components/Tooltip';
import { css, useTheme } from '@emotion/react';
import { find } from 'lodash';
import { ButtonWrapper } from '../ActionBar';
import { RepositoryTabNames } from '../RepositoryContent';
import { useTabsContext } from '../TabsContext';
Expand Down Expand Up @@ -59,10 +59,10 @@ const JbrowseLaunchButton = () => {
disabled={!jbrowseEnabled}
onClick={() => {
// go to jbrowse tab if open, otherwise add jbrowse tab
if (find(openTabs, { name: RepositoryTabNames.JBROWSE })) {
handleChangeTab(RepositoryTabNames.JBROWSE);
if (find(openTabs, { name: RepositoryTabNames.GENOME_VIEWER })) {
handleChangeTab(RepositoryTabNames.GENOME_VIEWER);
} else {
handleOpenTab({ name: RepositoryTabNames.JBROWSE, canClose: true });
handleOpenTab({ name: RepositoryTabNames.GENOME_VIEWER, canClose: true });
}
}}
>
Expand All @@ -72,15 +72,7 @@ const JbrowseLaunchButton = () => {
align-items: center;
`}
>
<img
src="images/jbrowse-logo.png"
alt=""
width={16}
css={css`
margin-right: 0.3rem;
`}
/>
<span>JBrowse</span>
<span>{RepositoryTabNames.GENOME_VIEWER}</span>
</div>
</Button>
</ButtonWrapper>
Expand Down
3 changes: 1 addition & 2 deletions components/pages/explorer/MobileWarning.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import IconButton from '@/components/IconButton';
import { css, useTheme } from '@emotion/react';
import { useState } from 'react';
import { getConfig } from '../../../global/config';
import { Dismiss as DismissIcon, Error as ErrorIcon } from '../../theme/icons';

const MobileWarning = () => {
Expand All @@ -46,7 +45,7 @@ const MobileWarning = () => {
z-index: 100;
display: none;
@media screen and (max-width: 1024px) {
display: block;
display: flex;
}
`}
>
Expand Down
6 changes: 3 additions & 3 deletions components/pages/explorer/RepositoryContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import { useVisualizationFocusContext } from './VisualizationFocusContext';

export enum RepositoryTabNames {
FILES = 'Files',
JBROWSE = 'JBrowse',
GENOME_VIEWER = 'Genome Viewer',
}

const getTableConfigs = ({
Expand Down Expand Up @@ -161,7 +161,7 @@ const getTableConfigs = ({
},
});

const visualizationTabs = [RepositoryTabNames.JBROWSE];
const visualizationTabs = [RepositoryTabNames.GENOME_VIEWER];

const ContentDisplay = () => {
const { activeTab, handleChangeTab } = useTabsContext();
Expand All @@ -183,7 +183,7 @@ const ContentDisplay = () => {
);
}

case RepositoryTabNames.JBROWSE: {
case RepositoryTabNames.GENOME_VIEWER: {
return <JbrowseWrapper />;
}

Expand Down
5 changes: 4 additions & 1 deletion components/pages/explorer/Tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,13 @@ const TabButton = styled('button')`
padding-top: 2px;
font-size: 12px;
cursor: pointer;
${({ withCloseButton }: { withCloseButton?: boolean }) =>
`padding-right: ${withCloseButton ? 18 : 0}px`}
`;

const CloseButton = styled('button')`
position: absolute;
top: 6px;
top: 5px;
right: -5px;
border: 0;
background: transparent;
Expand All @@ -116,6 +118,7 @@ const Tabs = () => {
onClick={() => {
handleChangeTab(tab.name);
}}
withCloseButton={tab.canClose}
>
{tab.name}
</TabButton>
Expand Down
Binary file removed public/images/jbrowse-logo.png
Binary file not shown.

0 comments on commit 071b2a9

Please sign in to comment.