Skip to content

Commit

Permalink
feat: add hairlines prop to where it is used
Browse files Browse the repository at this point in the history
  • Loading branch information
nolimits4web committed Aug 26, 2021
1 parent a392310 commit 21c5822
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 14 deletions.
8 changes: 3 additions & 5 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
- Tooling

- Lint - double check rules

- Components

- `hairline` prop everywhere it is used
- navbar/toolbar

- add text colors customization
Expand All @@ -20,3 +15,6 @@

- add darktheme to provider (to exclude `dark:` classes from output)
- rename themeClasses helpers to `c` `i` and `m`

- React
- DTS
5 changes: 4 additions & 1 deletion src/react/components/ListButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ const ListButton = (props) => {
className,
colors: colorsProp,

hairlines = true,

// Link props
href,
target,
Expand Down Expand Up @@ -58,7 +60,8 @@ const ListButton = (props) => {
button: {
common: cls(
positionClass('relative', className),
`flex items-center justify-center px-4 space-x-1 active:bg-opacity-15 w-full duration-300 active:duration-0 focus:outline-none hairline-b active:hairline-transparent ${colors.text} ${colors.activeBg} ${colors.touchRipple} overflow-hidden`
hairlines && 'hairline-b active:hairline-transparent',
`flex items-center justify-center px-4 space-x-1 active:bg-opacity-15 w-full duration-300 active:duration-0 focus:outline-none ${colors.text} ${colors.activeBg} ${colors.touchRipple} overflow-hidden`
),
ios: 'h-11',
material: 'h-12',
Expand Down
10 changes: 7 additions & 3 deletions src/react/components/ListInput.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ const ListInput = (props) => {
clearButton,
dropdown,

hairlines = true,

// input props
inputId,
inputStyle,
Expand Down Expand Up @@ -162,9 +164,11 @@ const ListInput = (props) => {
inputWrap: {
common: 'relative',
ios: '-mb-2.5',
material: `hairline-b hairline-duration-200 ${getHairlineColor()} ${
isFocused || error ? 'hairline-b-scale' : ''
}`,
material: hairlines
? `hairline-b hairline-duration-200 ${getHairlineColor()} ${
isFocused || error ? 'hairline-b-scale' : ''
}`
: '',
inline: {
common: `flex-shrink-10 w-full`,
ios: '-mt-2.5',
Expand Down
9 changes: 6 additions & 3 deletions src/react/components/ListItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ const ListItem = (props) => {
menuListItem,
menuListItemActive,

hairlines = true,

// Enable divider
divider,
groupTitle,
Expand Down Expand Up @@ -99,7 +101,8 @@ const ListItem = (props) => {
`flex items-center ${contentClassName}`
),
link: cls(
'duration-300 active:duration-0 active:hairline-transparent cursor-pointer select-none',
'duration-300 active:duration-0 cursor-pointer select-none',
hairlines && 'active:hairline-transparent',
needsTouchRipple &&
'relative overflow-hidden dark:touch-ripple-white z-10',
isMenuListItemActive
Expand All @@ -116,7 +119,7 @@ const ListItem = (props) => {
inner: {
common: cls(
'pr-4 w-full relative',
!menuListItem && 'hairline-b',
!menuListItem && hairlines && 'hairline-b',
innerClassName
),
ios: 'py-2.5',
Expand Down Expand Up @@ -145,7 +148,7 @@ const ListItem = (props) => {
common: `bg-list-divider-light dark:bg-list-divider-dark text-black dark:text-white text-opacity-55 dark:text-opacity-55 px-4 py-1 flex items-center z-10 ${
divider ? 'relative' : 'sticky top-0'
}`,
ios: `h-8 hairline-t -m-0.5`,
ios: `h-8${hairlines ? ' hairline-t' : ''} -m-0.5`,
material: 'h-12',
},
},
Expand Down
7 changes: 6 additions & 1 deletion src/react/components/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const Navbar = (props) => {

colors: colorsProp,
translucent = true,
hairlines = true,

left,
title,
Expand Down Expand Up @@ -57,7 +58,11 @@ const Navbar = (props) => {
},
bg: {
common: cls('absolute w-full h-full left-0 top-0', bgClassName),
ios: cls(`hairline-b ${colors.bg}`, translucent && 'translucent'),
ios: cls(
colors.bg,
hairlines && 'hairline-b',
translucent && 'translucent'
),
material: `shadow-md ${colors.bg}`,
},
subnavbar: {
Expand Down
4 changes: 3 additions & 1 deletion src/react/components/Toolbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ const Toolbar = (props) => {
bgClassName = '',
innerClassName = '',

hairlines = true,

tabbar,
tabbarLabels,

Expand Down Expand Up @@ -59,7 +61,7 @@ const Toolbar = (props) => {
bg: {
common: cls('absolute w-full h-full left-0 top-0', bgClassName),
ios: cls(
top ? 'hairline-b' : 'hairline-t',
hairlines && (top ? 'hairline-b' : 'hairline-t'),
colors.bg,
translucent && 'translucent'
),
Expand Down

0 comments on commit 21c5822

Please sign in to comment.