Skip to content

add TaskTiles and update TaskDetailView.tsx #1143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/components/modals/Modal.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useContext, useEffect, type MouseEventHandler, type PropsWithChildren, type ReactNode } from 'react'
import ReactDOM from 'react-dom'
import { X } from 'lucide-react'
import { apply } from '@twind/core'
import { Span } from '../Span'
import { tx, tw } from '../../twind'
import type { Languages } from '../../hooks/useLanguage'
Expand Down Expand Up @@ -130,7 +131,8 @@ export const Modal = ({
/>
)}
<div
className={tx('fixed left-1/2 top-1/2 -translate-y-1/2 -translate-x-1/2 flex flex-col p-4 bg-white rounded-xl shadow-xl', modalClassName)}>
className={tx(apply('fixed left-1/2 top-1/2 -translate-y-1/2 -translate-x-1/2 flex flex-col p-4 bg-white rounded-xl shadow-xl'), modalClassName)}
>
<ModalHeader {...modalHeaderProps} />
{children}
</div>
Expand Down
14 changes: 8 additions & 6 deletions lib/components/user-input/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as CheckboxPrimitive from '@radix-ui/react-checkbox'
import type { CheckedState } from '@radix-ui/react-checkbox'
import { Check, Minus } from 'lucide-react'
import { tw, tx } from '../../twind'
import type { AppColor } from '../../twind/config'
import type { LabelProps } from './Label'
import { Label } from './Label'

Expand All @@ -18,7 +19,8 @@ type CheckboxProps = {
onChange?: (checked: boolean) => void,
onChangeTristate?: (checked: CheckedState) => void,
size?: number,
className?: string
className?: string,
color?: AppColor
}

/**
Expand All @@ -34,12 +36,12 @@ const ControlledCheckbox = ({
onChange,
onChangeTristate,
size = 18,
className = ''
className = '',
color = 'hw-primary',
}: CheckboxProps) => {
// Make sure there is an appropriate minimum
const usedSize = Math.max(size, 14)
const innerIconSize = usedSize - 4

return (
<div className={tw('flex justify-center items-center space-x-2')}>
<CheckboxPrimitive.Root
Expand All @@ -54,10 +56,10 @@ const ControlledCheckbox = ({
checked={checked}
disabled={disabled}
id={id}
className={tx(`w-[${usedSize}px] h-[${usedSize}px] flex items-center border border-2 border-gray-300 rounded outline-none focus:border-hw-primary-500`, {
className={tx(`w-[${usedSize}px] h-[${usedSize}px] flex items-center border border-2 border-gray-300 rounded outline-none focus:border-${color}-500`, {
'text-gray-400': disabled,
'bg-hw-primary-300 border-hw-primary-500 hover:border-hw-primary-700 text-hw-primary-500': checked === true || checked === 'indeterminate',
'bg-white hover:border-gray-400 focus:hover:border-hw-primary-700': !checked
[`bg-${color}-300 border-${color}-500 hover:border-${color}-700 text-${color}-500`]: checked === true || checked === 'indeterminate',
[`bg-white hover:border-gray-400 focus:hover:border-${color}-700`]: !checked
}, className)}
>
<CheckboxPrimitive.Indicator>
Expand Down
Loading
Loading