1module Container.Sidebar where
4import Yoga.CSS.Safer (cssSafer)
5import Data.Monoid (guard)
7import React.Basic (JSX)
8import React.Basic.DOM as R
9import React.Basic.Events (handler_)
10import React.Basic.Hooks (ReactComponent, component, element)
11import React.Basic.Hooks as React
12import Yoga.SVG.Icon (ActiveArrowDirection(..), mkMenu)
13import Yoga.Theme.Styles (classNames, makeStyles)
14import Yoga.Theme.Types (CSSTheme)
20 , modifyCollapsed ∷ (Boolean -> Boolean) -> Effect Unit
26 makeStyles \(theme ∷ CSSTheme) ->
29 { background: theme.interfaceColourLighter
30 , fontFamily: theme.textFontFamily
31 , borderRadius: "0 12px 12px 0"
32 , color: theme.textColour
33 , position: "absolute"
34 , marginTop: "calc(100vh + 20px)"
35 , paddingBottom: "20px"
37 , flexDirection: "column"
39 , transitionTimingFunction: "cubic-bezier(.56,-0.32,.36,1)"
43 "0px 0px 60px rgba(0,0,0,0."
44 <> (if theme.isLight then "17" else "43")
47 , sidebarCollapsed: cssSafer { width: "70px" }
48 , sidebarExpanded: cssSafer { width: "220px" }
53 , padding: "0 5px 0 5px"
54 , transition: "0.2s ease-in-out"
55 , transitionDelay: "0.1s"
56 , alignSelf: "flex-end"
60 {} -- transform: "rotate(180deg)"}
63 component "Sidebar" \{ kids, collapsed, modifyCollapsed } -> React.do
64 rawClasses <- useStyles
66 classes = flip classNames rawClasses
72 , if collapsed then _.sidebarCollapsed else _.sidebarExpanded
76 { className: classes [ _.logo, guard collapsed _.logoCollapsed ]
77 , onClick: handler_ $ (modifyCollapsed not)
80 { activeArrowDirection: if collapsed then ArrowPointsRight else ArrowPointsLeft }
87mkSidebarLink ∷ Effect (ReactComponent { name ∷ String, icon ∷ JSX, collapsed ∷ Boolean })
90 makeStyles \(theme ∷ CSSTheme) ->
93 { fontFamily: theme.headingFontFamily
94 , alignSelf: "flex-end"
95 , justifyContent: "space-between"
96 , alignContent: "stretch"
97 , color: theme.textColour
100 , flexDirection: "row"
101 , overflowX: "hidden"
104 , borderRadius: "5px 0 0 5px"
107 { background: theme.highlightColour
109 -- , "&:hover": cssSafer{ opacity: "1.0"}
113 { fontFamily: theme.textFontFamily
114 , color: theme.textColour
115 , paddingLeft: "20px"
116 , textTransform: "uppercase"
124 , padding: "5px 10px 5px 5px"
125 , transition: "0.2s ease-in-out"
126 , transitionDelay: "0.1s"
127 , alignSelf: "flex-end"
128 , fill: theme.textColour <> " !important"
131 component "SidebarLink" \{ name, icon, collapsed } -> React.do
132 rawClasses <- useStyles
134 classes = flip classNames rawClasses
137 { className: classes [ _.sidebarEntry ]
140 { className: classes [ _.label ]
141 , children: [ R.text name ]
144 { className: classes [ _.icon ]
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list