make antispam rule channel list align properly

This commit is contained in:
janderedev 2022-03-16 20:58:48 +01:00
parent b077943e41
commit 50eda695ab
Signed by: Lea
GPG key ID: 5D5E18ACB990F57A

View file

@ -595,53 +595,55 @@ const ServerDashboard: FunctionComponent = () => {
If left empty, it will run in all channels. If left empty, it will run in all channels.
</H4> </H4>
<UserListTypeContainer> <UserListTypeContainer>
{ <div style={{ display: 'flex', flexWrap: 'wrap' }}>
channels.map(cid => { {
const channel: Channel = serverInfo.channels.find(c => c.id == cid && c.type == 'TEXT') channels.map(cid => {
|| { id: cid, name: 'Unknown channel', nsfw: false, type: 'TEXT' }; const channel: Channel = serverInfo.channels.find(c => c.id == cid && c.type == 'TEXT')
return ( || { id: cid, name: 'Unknown channel', nsfw: false, type: 'TEXT' };
<div return (
key={cid} <div
style={{ key={cid}
display: 'block',
margin: '4px 6px',
padding: '4px',
backgroundColor: 'var(--tertiary-background)',
borderRadius: '5px',
}}
>
<img
src={channel.icon ?? defaultChannelIcon}
style={{ style={{
width: '32px', display: 'block',
height: '32px', margin: '4px 6px',
objectFit: 'cover', padding: '4px',
borderRadius: '10%', backgroundColor: 'var(--tertiary-background)',
verticalAlign: 'middle', borderRadius: '5px',
display: 'inline-block',
}} }}
/> >
<span <img
style={{ src={channel.icon ?? defaultChannelIcon}
fontSize: '20px', style={{
verticalAlign: 'middle', width: '32px',
marginLeft: '4px', height: '32px',
}} objectFit: 'cover',
>{channel.name}</span> borderRadius: '10%',
<RemoveButton onClick={() => { verticalAlign: 'middle',
setChannels(channels.filter(c => c != cid)); display: 'inline-block',
setChannelsChanged(true); }}
}} /> />
</div> <span
) style={{
}) fontSize: '20px',
} verticalAlign: 'middle',
<ChannelListAddField onInput={channel => { marginLeft: '4px',
if (!channels.includes(channel.id)) { }}
setChannels([ ...channels, channel.id ]); >{channel.name}</span>
setChannelsChanged(true); <RemoveButton onClick={() => {
setChannels(channels.filter(c => c != cid));
setChannelsChanged(true);
}} />
</div>
)
})
} }
}} /> <ChannelListAddField onInput={channel => {
if (!channels.includes(channel.id)) {
setChannels([ ...channels, channel.id ]);
setChannelsChanged(true);
}
}} />
</div>
</UserListTypeContainer> </UserListTypeContainer>
</div> </div>
</span> </span>