Skip to content
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

Fix: #918 アカウントのアンテナ追加画面、除外アンテナ追加画面のデザインが崩れている問題 #922

Merged
merged 1 commit into from
Dec 3, 2024
Merged
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
19 changes: 12 additions & 7 deletions app/javascript/mastodon/features/antenna_adder/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
apiAddExcludeAccountToAntenna,
apiRemoveAccountFromAntenna,
apiRemoveExcludeAccountFromAntenna,
apiGetExcludeAccountAntennas,
} from 'mastodon/api/antennas';
import type { ApiAntennaJSON } from 'mastodon/api_types/antennas';
import { Button } from 'mastodon/components/button';
Expand Down Expand Up @@ -53,8 +54,8 @@ const AntennaItem: React.FC<{

return (
// eslint-disable-next-line jsx-a11y/label-has-associated-control
<label className='antennas__item'>
<div className='antennas__item__title'>
<label className='lists__item'>
<div className='lists__item__title'>
<Icon id='antenna-ul' icon={AntennaIcon} />
<span>{title}</span>
</div>
Expand Down Expand Up @@ -94,8 +95,8 @@ const NewAntennaItem: React.FC<{
}, [setTitle, dispatch, onCreate, title]);

return (
<form className='antennas__item' onSubmit={handleSubmit}>
<label className='antennas__item__title'>
<form className='lists__item' onSubmit={handleSubmit}>
<label className='lists__item__title'>
<Icon id='antenna-ul' icon={AntennaIcon} />

<input
Expand Down Expand Up @@ -127,15 +128,19 @@ const AntennaAdder: React.FC<{
useEffect(() => {
dispatch(fetchAntennas());

apiGetAccountAntennas(accountId)
const api = isExclude
? apiGetExcludeAccountAntennas
: apiGetAccountAntennas;

api(accountId)
.then((data) => {
setAntennaIds(data.map((l) => l.id));
return '';
})
.catch(() => {
// Nothing
});
}, [dispatch, setAntennaIds, accountId]);
}, [dispatch, setAntennaIds, accountId, isExclude]);

const handleToggle = useCallback(
(antennaId: string, checked: boolean) => {
Expand Down Expand Up @@ -205,7 +210,7 @@ const AntennaAdder: React.FC<{
</div>

<div className='dialog-modal__content'>
<div className='antennas-scrollable'>
<div className='lists-scrollable'>
<NewAntennaItem onCreate={handleCreate} />

{antennas.map((antenna) => (
Expand Down
Loading