Fixes for SidebarSubmenuItem to use external links
Signed-off-by: Jonathan Ash <jonathan-ash@users.noreply.github.com>
This commit is contained in:
@@ -30,7 +30,7 @@ import ArrowDropDownIcon from '@material-ui/icons/ArrowDropDown';
|
||||
import ArrowDropUpIcon from '@material-ui/icons/ArrowDropUp';
|
||||
import { SidebarItemWithSubmenuContext } from './config';
|
||||
import { isLocationMatch } from './utils';
|
||||
import { Link as BackstageLink } from '../../';
|
||||
import { Link as BackstageLink } from '../../components/Link';
|
||||
import { isExternalLink } from './utils';
|
||||
|
||||
const useStyles = makeStyles<BackstageTheme>(theme => ({
|
||||
|
||||
@@ -34,4 +34,4 @@ export function isLocationMatch(currentLocation: Location, toLocation: Path) {
|
||||
return matching;
|
||||
}
|
||||
|
||||
export const isExternalLink = (link: string) => /^http/.test(link);
|
||||
export const isExternalLink = (link: string) => /^https?:/.test(link);
|
||||
|
||||
Reference in New Issue
Block a user