Skip to content

Commit e0289de

Browse files
committed
ニコニコ実況 過去ログ (番組表)
1 parent c66817a commit e0289de

File tree

8 files changed

+652
-16
lines changed

8 files changed

+652
-16
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"dependencies": {
1919
"@icons-pack/react-simple-icons": "^10.0.0",
2020
"@internationalized/date": "^3.5.6",
21-
"@midra/nco-api": "^1.8.3",
21+
"@midra/nco-api": "^1.8.4",
2222
"@midra/nco-parser": "^1.0.25",
2323
"@nextui-org/react": "^2.4.8",
2424
"@webext-core/messaging": "^1.4.0",

pnpm-lock.yaml

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/modal.tsx

+10-3
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ import {
99
ModalBody as NextUIModalBody,
1010
ModalFooter as NextUIModalFooter,
1111
} from '@nextui-org/react'
12+
import { XIcon } from 'lucide-react'
1213

1314
export type ModalProps = {
15+
fullWidth?: boolean
16+
1417
isOpen: NextUIModalProps['isOpen']
1518
onOpenChange: NextUIModalProps['onOpenChange']
1619
onClose?: NextUIModalProps['onClose']
@@ -36,7 +39,7 @@ export const Modal: React.FC<ModalProps> = (props) => {
3639
<NextUIModal
3740
classNames={{
3841
wrapper: 'justify-end',
39-
base: 'max-w-[370px]',
42+
base: !props.fullWidth && 'max-w-[370px]',
4043
header: 'border-b-1 border-foreground-200 p-2 text-medium',
4144
body: 'p-0',
4245
footer: 'border-t-1 border-foreground-200 p-2',
@@ -63,7 +66,9 @@ export const Modal: React.FC<ModalProps> = (props) => {
6366
{props.header}
6467
</div>
6568

66-
{props.headerEndContent}
69+
<div className="shrink-0 font-normal">
70+
{props.headerEndContent}
71+
</div>
6772
</NextUIModalHeader>
6873
)}
6974

@@ -79,7 +84,9 @@ export const Modal: React.FC<ModalProps> = (props) => {
7984
size="sm"
8085
variant="flat"
8186
color="default"
82-
startContent={props.cancelIcon}
87+
startContent={
88+
props.cancelIcon || <XIcon className="size-4" />
89+
}
8390
onPress={onClose}
8491
>
8592
{props.cancelText || 'キャンセル'}

src/entrypoints/popup/SidePane/Header.tsx

+24-4
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,19 @@ import {
77
useDisclosure,
88
cn,
99
} from '@nextui-org/react'
10-
import { ChevronDownIcon, PlusIcon } from 'lucide-react'
10+
import {
11+
PlusIcon,
12+
ChevronDownIcon,
13+
CalendarClockIcon,
14+
Table2Icon,
15+
} from 'lucide-react'
1116

1217
import { JikkyoSelector } from './JikkyoSelector'
18+
import { JikkyoEpgSelector } from './JikkyoEpgSelector'
1319

1420
export const Header: React.FC = () => {
1521
const jkModalDc = useDisclosure()
22+
const jkEpgModalDc = useDisclosure()
1623

1724
return (
1825
<>
@@ -40,13 +47,14 @@ export const Header: React.FC = () => {
4047
<DropdownTrigger>
4148
<Button
4249
className={cn(
43-
'[&>svg]:rotate-0 [&[aria-expanded="true"]>svg]:rotate-180',
44-
'[&>svg]:transition-transform'
50+
'[&>svg:last-child]:rotate-0 [&[aria-expanded="true"]>svg]:rotate-180',
51+
'[&>svg:last-child]:transition-transform'
4552
)}
4653
size="sm"
4754
variant="flat"
4855
color="primary"
4956
disableRipple
57+
startContent={<PlusIcon className="size-4" />}
5058
endContent={<ChevronDownIcon className="size-4" />}
5159
>
5260
追加
@@ -55,11 +63,18 @@ export const Header: React.FC = () => {
5563

5664
<DropdownMenu variant="flat" color="primary">
5765
<DropdownItem
58-
startContent={<PlusIcon className="size-4" />}
66+
startContent={<CalendarClockIcon className="size-4" />}
5967
onPress={jkModalDc.onOpen}
6068
>
6169
ニコニコ実況 過去ログ
6270
</DropdownItem>
71+
72+
<DropdownItem
73+
startContent={<Table2Icon className="size-4" />}
74+
onPress={jkEpgModalDc.onOpen}
75+
>
76+
ニコニコ実況 過去ログ (番組表)
77+
</DropdownItem>
6378
</DropdownMenu>
6479
</Dropdown>
6580
</div>
@@ -68,6 +83,11 @@ export const Header: React.FC = () => {
6883
isOpen={jkModalDc.isOpen}
6984
onOpenChange={jkModalDc.onOpenChange}
7085
/>
86+
87+
<JikkyoEpgSelector
88+
isOpen={jkEpgModalDc.isOpen}
89+
onOpenChange={jkEpgModalDc.onOpenChange}
90+
/>
7191
</>
7292
)
7393
}

0 commit comments

Comments
 (0)