ISSUE-005 - Further work on Workspaces. Re-using MenuItem component and figuring out a new method for hover-over highlighting using SASS & selection.
This commit is contained in:
1 parent
02132bdbe2
commit
5dcc3f3940
10 files changed
+87
-32
No files matched your search
@@ -0,0 +1,7 @@
|
||||
import { useParams } from "react-router-dom";
|
||||
|
||||
export const Workspace = () => {
|
||||
const params = useParams();
|
||||
return <h1>{params.workspaceName}</h1>;
|
||||
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
export * from "./Workspace";
|
||||
@@ -1,10 +1,32 @@
|
||||
import { WorkspaceListBox } from "./styles";
|
||||
import { Stack } from "@bedrock-layout/stack";
|
||||
import { NavLink } from "react-router-dom";
|
||||
import { MenuItem } from "../../Common/MenuItem.styled";
|
||||
|
||||
export const WorkspaceList = () => (
|
||||
<WorkspaceListBox>
|
||||
<ul>
|
||||
<li>what</li>
|
||||
<li>what</li>
|
||||
</ul>
|
||||
<Stack as="ul" gutter="md">
|
||||
<WorkspaceListNavLink to="workspace1" label="Workspace 1" />
|
||||
<WorkspaceListNavLink to="workspace2" label="Workspace 2" />
|
||||
<WorkspaceListNavLink to="workspace3" label="Workspace 3" />
|
||||
<WorkspaceListNavLink to="workspace4" label="Workspace 4" />
|
||||
<WorkspaceListNavLink to="workspace5" label="Workspace 5 is longer than the rest" />
|
||||
</Stack>
|
||||
</WorkspaceListBox>
|
||||
);
|
||||
|
||||
type WorkspaceListNavLinkProps = {
|
||||
to: string,
|
||||
label: string,
|
||||
};
|
||||
const WorkspaceListNavLink = ({ to, label }: WorkspaceListNavLinkProps) => (
|
||||
<li>
|
||||
<NavLink to={to} style={{ textDecoration: "none" }}>
|
||||
{({ isActive }) => (
|
||||
<MenuItem isActive={isActive}>
|
||||
{label}
|
||||
</MenuItem>
|
||||
)}
|
||||
</NavLink>
|
||||
</li>
|
||||
);
|
||||
@@ -2,7 +2,7 @@ import styled from "styled-components";
|
||||
import { PadBox } from "@bedrock-layout/padbox";
|
||||
|
||||
export const WorkspaceListBox = styled(PadBox).attrs(() => ({
|
||||
padding: ["lg", "sm"],
|
||||
padding: ["lg", "md"],
|
||||
}))`
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
|
||||
@@ -12,7 +12,7 @@ export default function Workspaces() {
|
||||
|
||||
return (
|
||||
<FullScreenContainer minHeight={700} minWidth={900} heightCutoff={height}>
|
||||
<LayoutGrid columns={[1, 5]} rows={1}>
|
||||
<LayoutGrid columns={["180px", 5]} rows={1}>
|
||||
<LayoutGridItem column={1} row={1}>
|
||||
<WorkspaceList />
|
||||
</LayoutGridItem>
|
||||
|
||||
Reference in new issue
Block a user