* Fix: #919 リストの「Hide members in home」設定状況が、アカウントのリスト追加画面に表示されない * Fix lint
This commit is contained in:
parent
46b3fa48ae
commit
18fb6f7faa
1 changed files with 5 additions and 2 deletions
|
@ -6,6 +6,7 @@ import { isFulfilled } from '@reduxjs/toolkit';
|
||||||
|
|
||||||
import CloseIcon from '@/material-icons/400-24px/close.svg?react';
|
import CloseIcon from '@/material-icons/400-24px/close.svg?react';
|
||||||
import ListAltIcon from '@/material-icons/400-24px/list_alt.svg?react';
|
import ListAltIcon from '@/material-icons/400-24px/list_alt.svg?react';
|
||||||
|
import VisibilityOffIcon from '@/material-icons/400-24px/visibility_off.svg?react';
|
||||||
import { fetchLists } from 'mastodon/actions/lists';
|
import { fetchLists } from 'mastodon/actions/lists';
|
||||||
import { createList } from 'mastodon/actions/lists_typed';
|
import { createList } from 'mastodon/actions/lists_typed';
|
||||||
import {
|
import {
|
||||||
|
@ -39,9 +40,10 @@ const messages = defineMessages({
|
||||||
const ListItem: React.FC<{
|
const ListItem: React.FC<{
|
||||||
id: string;
|
id: string;
|
||||||
title: string;
|
title: string;
|
||||||
|
exclusive: boolean;
|
||||||
checked: boolean;
|
checked: boolean;
|
||||||
onChange: (id: string, checked: boolean) => void;
|
onChange: (id: string, checked: boolean) => void;
|
||||||
}> = ({ id, title, checked, onChange }) => {
|
}> = ({ id, title, exclusive, checked, onChange }) => {
|
||||||
const handleChange = useCallback(
|
const handleChange = useCallback(
|
||||||
(e: React.ChangeEvent<HTMLInputElement>) => {
|
(e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
onChange(id, e.target.checked);
|
onChange(id, e.target.checked);
|
||||||
|
@ -50,10 +52,10 @@ const ListItem: React.FC<{
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
// eslint-disable-next-line jsx-a11y/label-has-associated-control
|
|
||||||
<label className='lists__item'>
|
<label className='lists__item'>
|
||||||
<div className='lists__item__title'>
|
<div className='lists__item__title'>
|
||||||
<Icon id='list-ul' icon={ListAltIcon} />
|
<Icon id='list-ul' icon={ListAltIcon} />
|
||||||
|
{exclusive && <Icon id='eye-slash' icon={VisibilityOffIcon} />}
|
||||||
<span>{title}</span>
|
<span>{title}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -199,6 +201,7 @@ const ListAdder: React.FC<{
|
||||||
key={list.id}
|
key={list.id}
|
||||||
id={list.id}
|
id={list.id}
|
||||||
title={list.title}
|
title={list.title}
|
||||||
|
exclusive={list.exclusive}
|
||||||
checked={listIds.includes(list.id)}
|
checked={listIds.includes(list.id)}
|
||||||
onChange={handleToggle}
|
onChange={handleToggle}
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue