• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

teableio / teable / 8470050671

28 Mar 2024 03:54PM UTC coverage: 21.785% (-0.05%) from 21.838%
8470050671

Pull #507

github

web-flow
Merge c24fe3a68 into 53432a5aa
Pull Request #507: feat: search api

1396 of 2505 branches covered (55.73%)

23 of 544 new or added lines in 74 files covered. (4.23%)

36 existing lines in 4 files now uncovered.

14551 of 66795 relevant lines covered (21.78%)

2.08 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/apps/nextjs-app/src/features/app/components/ThemePicker.tsx
1
import { ThemeKey, useTheme } from '@teable/sdk';
×
NEW
2
import { cn } from '@teable/ui-lib/shadcn';
×
3
import { Button } from '@teable/ui-lib/shadcn/ui/button';
×
4
import {
×
5
  DropdownMenu,
×
6
  DropdownMenuContent,
×
7
  DropdownMenuRadioGroup,
×
8
  DropdownMenuRadioItem,
×
9
  DropdownMenuTrigger,
×
10
} from '@teable/ui-lib/shadcn/ui/dropdown-menu';
×
11
export const ThemePicker: React.FC<{ className?: string }> = ({ className }) => {
×
12
  const { theme, isAutoTheme, setTheme } = useTheme();
×
13
  const value = isAutoTheme ? '' : theme;
×
14
  return (
×
15
    <DropdownMenu>
×
16
      <DropdownMenuTrigger asChild>
×
NEW
17
        <Button className={cn('capitalize', className)} size={'xs'} variant="ghost">
×
18
          {value || 'system'}
×
19
        </Button>
×
20
      </DropdownMenuTrigger>
×
21
      <DropdownMenuContent className="w-56">
×
22
        <DropdownMenuRadioGroup
×
23
          value={value}
×
24
          onValueChange={(value) => {
×
25
            setTheme(value === '' ? null : (value as ThemeKey));
×
26
          }}
×
27
        >
×
28
          {[ThemeKey.Light, ThemeKey.Dark].map((item) => {
×
29
            return (
×
30
              <DropdownMenuRadioItem
×
31
                className="capitalize"
×
32
                key={item}
×
33
                disabled={!isAutoTheme && theme === item}
×
34
                value={item}
×
35
              >
×
36
                {item}
×
37
              </DropdownMenuRadioItem>
×
38
            );
×
39
          })}
×
40
          <DropdownMenuRadioItem disabled={isAutoTheme} value="">
×
41
            system
×
42
          </DropdownMenuRadioItem>
×
43
        </DropdownMenuRadioGroup>
×
44
      </DropdownMenuContent>
×
45
    </DropdownMenu>
×
46
  );
×
47
};
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc